Chartbuilder
Chartbuilder copied to clipboard
Datapoint simplification
If there are 1000 data points per series but the chart is only 500px wide we're over rendering
Perhaps this should be a warning?
this also becomes an issue related to the thickness of a line
maybe something like this (I haven't tested it)
dataPerPixelPair = Math.ceil(data.length/width*2);
dataResampled = data.filter(function(d,i){
segment = data.slice(i*dataPerPixelPair,(i+1)*dataPerPixelPair)
return d == d3.max(segment) || d == d3.min(segment) || i == 0 || i == data.length -1
})
all that's left to do on the above branch is to make some magic numbers a little more configureable and have the data reduction be done based on the current chart width
Data reduction based on chart width is turning out to be more difficult than I thought since we parse/reduce the data well ahead of rendering the RendererWrapper
It's the only work left to do on this branch https://github.com/Quartz/Chartbuilder/tree/feature-154-data-simplification
The branch is currently based on master before nikhil's error messaging refactor, I think those changes might help crack this nut. so we shall see