Chartbuilder icon indicating copy to clipboard operation
Chartbuilder copied to clipboard

Datapoint simplification

Open yanofsky opened this issue 9 years ago • 3 comments

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

test_l4mfi_chartbuilder

yanofsky avatar Jun 23 '15 04:06 yanofsky

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
})

yanofsky avatar Jun 23 '15 04:06 yanofsky

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

yanofsky avatar Jan 05 '16 02:01 yanofsky

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

yanofsky avatar Feb 12 '16 00:02 yanofsky