No scattergl clustering below 1e5 pts #3578
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An attempts at fixing #2334 by skipping point clustering (done by
point-cluster
) forscattergl
traces with less than 1e5 pts.Previously, we were subject to the
regl-scatter2d
default value of1e4
meaningscattergl
traces with more than 1e4 pts but less than 1e5 pts (ourTOO_MANY_POINTS
constant) were clustered fromregl-scatter2d
whereas traces with more than 1e5 pts were clustered fromScattergl.calc
.With the PR, I noticed that panning is slightly slower for graphs 1e4 < pts < 1e5, but otherwise performance appears the same. I think this small performance lost is worth it to get the correct rendering and to make us call
point-cluster
from one place i.e. fromScattergl.calc
.Here are some updated codepens from #2334:
We may eventually still want to lower the
maxDepth
clustering option as @dy has suggested in #2334 (comment) to potentially correct rendering of traces with > 1e5 pts, but I'd like to wait to find a currently failing example before doing so. We could also try to bring back clustering for 1e4 < pts < 1e5 traces together with a lowermaxDepth
down the road.cc @plotly/plotly_js I'd like to slide to in the 1.45.0 - as this PR may have consequences I don't want to release in a patch version.