Scattergl renderer default transition uncertainty after plotly chart_studio split
0 reputation · 27 Jul 2020, 07:49 UTC
0 reputation · 27 Jul 2020, 07:49 UTC
Plotly's core rendering pipeline does not prescribe an automatic transition from SVG-based Scatter to WebGL-accelerated Scattergl for traces exceeding a point count threshold, leaving the cutoff entirely user‑specified. This design choice creates ambiguity when scaling large scatter plots, particularly across environments where renderer defaults differ between classic Notebook, JupyterLab, and VS Code. The separation of Chart Studio publishing into the chart_studio package further isolates core rendering decisions from online workflow concerns, but does not resolve the offline trace‑type selection problem.
What criteria determine the Scatter-to-Scattergl transition for a trace of N points? Does any plotly version provide a configurable default renderer selection beyond explicit trace type assignment? How does the renderer default interact with the chart_studio publishing pipeline when large traces are exported?
34775 reputation · 27 Jul 2020, 09:13 UTC
Plotly’s core library does not automatically switch a Scatter trace to Scattergl when the point count grows. The renderer is chosen only by the trace type you supply; there is no internal threshold or automatic transition.
In other words:
Scattergl trace (e.g., go.Scattergl in Python or type: 'scattergl' in JavaScript).chart_studio package, the renderer default of the notebook (e.g., notebook, vscode) does not alter the trace type; Chart Studio stores exactly what you sent.Some community wrappers (e.g., cufflinks, certain Plotly Express helpers) apply heuristics that automatically choose scattergl for large datasets. These are not part of the core Plotly implementation and vary by wrapper version. Relying on them introduces uncertainty because the threshold and behavior are not documented in the official API.
go.Scattergl (Python) or set type: 'scattergl' (JavaScript). Example in Python:import plotly.graph_objects as go
fig = go.Figure(go.Scattergl(x=x_vals, y=y_vals))
fig.show()plotly.io.renderers.default setting controls where the figure is displayed (browser, notebook, etc.), not the trace type. Example:import plotly.io as pio
pio.renderers.default = 'notebook' # or 'vscode', 'browser', etc.chart_studio.plotly.iplot(fig) or fig.show(config={'cloud': True}). The figure will be stored with the same trace type you created. No conversion to SVG will occur.<canvas> element indicates scattergl, while a large number of <path> elements indicates SVG.Across Plotly 5.15.0 to 5.22.0 (the latest as of 2026‑10‑13), this behavior has remained unchanged. No release notes indicate an automatic transition mechanism.
If you are seeing unexpected SVG rendering in a particular environment, confirm whether a community wrapper or custom helper is being used to construct the trace. That could be the source of the automatic switch.
Scattergl for large point counts to avoid performance issues.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.