Interactive chart slow with large number of data points
See original GitHub issueWhen I create an interactive scatter plot where some text element is displayed on mouseover, I’ve noticed that this becomes unusably slow if the data points go into the thousands. If I take the example from here, then all is nice on the 400 data points from the cars package, but if I increase the number of data points to 4000, then things get very slow, and with 20000 (the size of my data set), it becomes much worse:
cars = alt.load_dataset("cars")
cars = pd.concat([cars]*10)
cars["Horsepower"] = cars["Horsepower"].sample(frac=1).reset_index()
pointer = alt.selection_single(on='mouseover', nearest=True, empty='none')
base = alt.Chart().encode(
x='Miles_per_Gallon', y='Horsepower'
)
chart = alt.layer(
base.mark_point().properties(selection=pointer).encode(color='Origin'),
base.mark_text(dx=8, dy=3, align='left').encode(
text=alt.condition(pointer, 'Name', alt.value(''))
),
data=cars
)
chart
(It does not necessarily make all that much sense to have 20k data points that can be hovered over for more information, but I’m wondering whether there’s a way to speed this up or if it will generally be a slow.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
excel drawing charts with large data sets is very slow
excel drawing charts with large data sets is very slow. It appears to be from the chart design trying to show a better...
Read more >There's no hard limit, but things will slow down past ... - Plotly
There's no hard limit, but things will slow down past around 1000 points for some chart types. scatter, line, scatter_polar and line_polar ...
Read more >slow in chart display - Highcharts official support forum
Hello, I have trouble in the efficiency of chart display. I have 8 curves with 4000 points per curve. I just made one...
Read more >Offline plotting in python is very slow on big data sets
When generating huge amount of data (50 Hz IMU data, can be full day) I got few issues. 1. Generation time is way...
Read more >plotly: huge number of datapoints - Stack Overflow
(2) Trying using the image API to return an image instead of a graph URL (3) Use matplotlib (4) See if you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I’ve implemented
chart.display(renderer='svg')
in #925Not all frontends support it yet, but you can pass renderer metadata via the renderers registry… for example:
where
renderer_name
isjupyterlab
,notebook
,colab
, etc.I plan to document this better once the next version of JupyterLab is released, because the current release ignores any metadata.