Hello Everyone,
I use dash: 0.36.0 on ubuntu 16.04 and met following problem by the Scatter3d chart:
after zoom, reset,pan the color-bar disappears and the scatter points gets black. How can i fix it ?
code:
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.plotly as py
import plotly.graph_objs as go
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
df = pd.read_csv(‘https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv’)
trace1 = go.Scatter3d(
x=df[‘year’][750:1500],
y=df[‘continent’][750:1500],
z=df[‘pop’][750:1500],
text=df[‘country’][750:1500],
mode=‘markers’,
marker=dict(
sizemode=‘diameter’,
sizeref=750,
size=df[‘gdpPercap’][750:1500],
#color = df[‘lifeExp’][750:1500],
# colorscale = ‘Viridis’,
colorbar = dict(title = ‘Life
Expectancy’),
line=dict(color=‘rgb(140, 140, 170)’)
)
)
print(dash.version)
data=[trace1]
layout=go.Layout(height=800, width=800, title=‘Examining Population and Life Expectancy Over Time’)
fig=go.Figure(data=data, layout=layout)
app.layout = html.Div(children=[
dcc.Graph(
id='example-graph',
figure= fig,
)
])
if name == ‘main’:
app.run_server(debug=True)