I would like to make a scatter plot using D3 with the ability of only looking at a small section at a time using some sort of slider across the x-axis. Is there a method in javascript where I can efficiently buffer the data and quickly access the elements as the user scrolls left or right?
My goal is similar to this protovis example here, but with 10 times the amount of data. This example chokes when I make that many data points.
D3 charts are most often rendered using SVG, a retained mode graphics model, which is easy to use, but performance is limited. SVG charts can typically handle around 1,000 datapoints.
Moreover, we can confirm that D3 transitions do not use any GPU power to slim the process.
I have done a scatterplot with around 10k points where I needed to filter sections of the plot interactively. I share a series of tips that worked for me, which I hope some may hopefully help you too:
.data()
operator as it is done at the end of this tutorial. The advantage of using keys is that you do not need to update elements that do not change..transition()
is not very smooth when thousand of SVG elements are selected (it may be better now in newer versions or with faster processors).attr("display","none")
) or visible rather than removing and creating SVG elements (I wonder if this is more time efficient too)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With