apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.54k stars 13.77k forks source link

Add data sampling in line charts #11205

Closed oashton closed 2 years ago

oashton commented 4 years ago

Is your feature request related to a problem? Please describe. In dashboards with a lot of line chart with high-density/high-frequency data (> 50.000 point per line), the user experience is not the best because the performance decrease while navigating or zooming data in the mini-chart, also the initial rendering is slow.

Describe the solution you'd like I propose to enable an option to do a sampling of the data in the backend after the query is done and results are fetched. To do the sampling we can use some algorithms like lttb (largest_triangle_three_buckets - https://github.com/devoxi/lttb-py/), simple max/min value per bucket/bin (https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-high-density-sampling) or the Ramer-Douglas-Peucker (https://github.com/omarestrella/simplify.py)

Describe alternatives you've considered An alternative is to simple add the required sampling logic in the query, but I'm looking for something more straightforward for the user (dashboard creator).

Additional context I made an initial implementation adding the sampling just before the response is delivered image I'm open to hear your opinions and to contribute these feature if it's something useful

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.98. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

leeoniya commented 4 years ago

v5 might interest you:

https://github.com/apache/incubator-echarts/pull/13314 https://github.com/apache/incubator-echarts/pull/13337