Closed
Description
Description
In the latest version of django-plotly-dash, there are errors when attempting to render a simple plot. The following code, which creates a basic scatter plot, results in the graph not being displayed:
fig = go.Figure(data=go.Scatter(x=[1, 2, 3], y=[4, 5, 6], mode='lines+markers'))
return mydbc.html.Div([
mydbc.dcc.Graph(id='prediction-graph', figure=fig)
])
The server logs show the following:
[03/Oct/2024 04:25:22] "POST /django_plotly_dash/app/SimpleExample/_dash-update-component HTTP/1.1" 200 28011
[03/Oct/2024 04:25:22] "GET /django_plotly_dash/app/SimpleExample/_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 302 0
[03/Oct/2024 04:25:22] "GET /static/dash/component/plotly/package_data/plotly.min.js HTTP/1.1" 404 1958
[03/Oct/2024 04:25:23] "POST /django_plotly_dash/app/SimpleExample/_dash-update-component HTTP/1.1" 200 188
[03/Oct/2024 04:25:23] "POST /django_plotly_dash/app/SimpleExample/_dash-update-component HTTP/1.1" 200 212
The key error appears to be related to the file plotly.min.js not being found at the expected path:
404 GET /static/dash/component/plotly/package_data/plotly.min.js
This causes the graph to not be rendered on the frontend.
Temporary Solution I had to downgrade to a previous version of django-plotly-dash, which resolved the issue temporarily.