automatic downsampling
improved plotting speed removing mpld3 dependency