Looks like I was using 0.21.0
.
I upgraded to 0.22.1
. The test example wasn’t working at first, however. Here’s what I had when it didn’t work.
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
from functools import partial
import datetime as dt
from SupplyChainReportingTool import server, session, blu, cache, CACHE_TIMEOUT
app_tst = dash.Dash(__name__, server=server, url_base_pathname='/ie_test/')
app_tst.css.config.serve_locally = True
app_tst.scripts.config.serve_locally = True
app_tst.layout = html.Div([
dcc.Graph(
id='graphtest',
figure={}
)
])
It seems like part of the problem was that dash didn’t like having an empty figure. I loaded it up with an empty Scatter trace and some default settings for the y-axis I planned to use and ended up with the following:
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
from functools import partial
import datetime as dt
from SupplyChainReportingTool import server, session, blu, cache, CACHE_TIMEOUT
app_tst = dash.Dash(__name__, server=server, url_base_pathname='/ie_test/')
app_tst.css.config.serve_locally = True
app_tst.scripts.config.serve_locally = True
layout = go.Layout(
yaxis=dict(title='Count',range=[0, 100],fixedrange=True,side='right',zeroline=False,showgrid=False),
yaxis2=dict(title='percent',range=[0, 1],fixedrange=True,side='left',overlaying='y')
)
data = [go.Scatter(x=[],y=[],name='Data',mode='lines+markers')]
app_tst.layout = html.Div([
dcc.Graph(
id='graphtest',
figure={'data': data, 'layout': layout}
)
])
which works in the company IE setup. I’ve transferred the solution over to my actual app and it also fixed the issue there.
I’ll try to change back to dash-core-components==0.21.0
and see if the package version was the issue. But for now, I assume it was both the package version and the empty figure that caused the problem.