Problems using Surface in Dash

I am able to make a simple Scatter3d plot in dash.

import plotly.graph_objects as go

import dash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]

app = dash.Dash(name, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
dcc.Graph(
id=‘test’,
figure={
‘data’: [
go.Scatter3d(x=[1],y=[1],z=[1])
]
}
)
])

if name == ‘main’:
app.run_server(debug=True)

Trying the same with an Surface graph yields an error ‘t is null’ in the web interface.

import plotly.graph_objects as go

import dash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]

app = dash.Dash(name, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
dcc.Graph(
id=‘test’,
figure={
‘data’: [
go.Surface(z=[[0,1,2],[3,4,5],[6,7,8]])
]
}
)
])

if name == ‘main’:
app.run_server(debug=True)

What could be the problem?

Hm, that’s odd. Could you print your dcc.__version__ number?

Thanks for your answer.

C:\WINDOWS\system32>pip show dash-core-components
Name: dash-core-components
Version: 1.1.2
Summary: Core component suite for Dash
Home-page: UNKNOWN
Author: Chris Parmer …
Author-email: …
License: MIT
Location: c:\program files (x86)\python37-32\lib\site-packages
Requires:
Required-by: dash

C:\WINDOWS\system32>pip show dash-html-components
Name: dash-html-components
Version: 1.0.1
Summary: Vanilla HTML components for Dash
Home-page: GitHub - plotly/dash-html-components: OBSOLETE - now part of https://github.com/plotly/dash
Author: Chris Parmer chris@plot.ly
Author-email: chris@plot.ly
License: MIT
Location: c:\program files (x86)\python37-32\lib\site-packages
Requires:
Required-by: dash

C:\WINDOWS\system32>pip show dash
Name: dash
Version: 1.2.0
Summary: A Python framework for building reactive web-apps. Developed by Plotly.
Home-page: …
Author: chris p
Author-email: …
License: MIT
Location: c:\program files (x86)\python37-32\lib\site-packages
Requires: Flask, flask-compress, plotly, dash-renderer, dash-core-components, dash-html-components, dash-table, future
Required-by:

Reinstalling the packages dash, dash-core-components, dash-html-compontens with pip install --force-reinstall solved my problem.

1 Like