Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
The sample code below plots a Figure with some Scattergl traces, rendered inside a dcc.Graph component.
Each trace has mode “lines+text”.
With Plotly 5 this used to work as expected; after updating to Plotly >= 6.0.0, the graph component still loads, but no data points are visible.
No errors are shown in the browser console or Python logs (as a note, Dash 3 was used).
Sample Code
importdashfromdashimportdcc,htmlimportplotly.graph_objsasgoimportnumpyasnp# Generate data for many scattergl tracesnum_points=10000num_traces=4traces= []foriinrange(num_traces):x=np.arange(num_points)y=np.random.rand(num_points)+icustomdata= [f"Trace{i+1} - Point{j}"forjinrange(num_points)]labels= [f"Trace{i+1} - Point{j}"ifj==0else""forjinrange(num_points)]trace=go.Scattergl(x=x,y=y,mode='lines+text',name=f'Trace{i+1}',customdata=customdata,text=labels,textposition='top center',hovertemplate="%{customdata}<br>X: %{x}<br>Y: %{y}<extra></extra>" )traces.append(trace)# Create the figurefig=go.Figure(data=traces)fig.update_layout(title=f'ScatterGL with{num_traces} Traces',xaxis_title='X',yaxis_title='Y')# Create Dash appapp=dash.Dash(__name__)app.layout=html.Div([html.H1("Dash ScatterGL Example"),dcc.Graph(figure=fig)])if__name__=="__main__":app.run(debug=True)
Turning Scattergl mode from “lines+text” into “lines” restores the expected behaviour.
Playing with the number of traces or data points seems to have no effect.
Environment
The issue occurs with the following environment:
Python version: 3.9.7
Dash version: 3.2.0
Plotly version: 6.3.0
Browser: Chrome 139
OS: Windows 11
As already mentioned, downgrading Plotly (e.g. from version 6.3.0 to 5.24.1) restores the expected behaviour.