Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Datapoint simplification #154

Open yanofsky opened 9 years ago

yanofsky commented 9 years ago

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 commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

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