Ahoy,
I have done local development getting my dashboard to where i want it and have deployed to a small EC2 instance (with some nginx config stuff to do https redirects) however I am getting different results between my local and remote instances.
I have attached some gifs showing the two cases. What I am doing is plotting a barchart based on some data (which shows means and quantiles) and then i have a mouse over callback to plot the histogram of the underlying data next to it. This works great on my local machine for all the datasets i have tried.
However, on the remove machine it only works for certain datasets, in other cases it shows ‘updating’ but nothing happens. Note, it does not even trigger the call back (which i can see by monitoring the dash output directly). I have verified that all underlying package versions are the same, which are
dash==1.13.4
dash-bootstrap-components==0.10.3
dash-core-components==1.10.1
dash-daq==0.5.0
dash-html-components==1.0.3
dash-renderer==1.5.1
dash-table==4.8.1
plotly==4.8.2
Actually remote had a newer version of plotly (4.9 i think) and i downgraded to see if that helped but it did not.
The call back function is
@app.callback(Output('transit-stats-plot2','figure'), [Input('transit-storage','data'), Input('transit-stats-plot','hoverData')])
def test(df_json, hover_data):
print('mouseover callback')
df = pd.DataFrame(json.loads(df_json))
if hover_data is not None:
lane = hover_data['points'][0]['label']
else:
lane = '-1'
if len(df)> 0:
times = df[df['lane'] == lane]['actual_transit'].tolist()
else:
times = []
return calculations.histogram(times)
and what i have found is if i remove the storage input, the remote call back fires (though this is not useful as obviously i need that data!). I found another thread suggesting i had to specify a type for the storage so i did but to no avail (i tried session and memory)
The store is defined as
dcc.Store(id='transit-storage',storage_type='local'),
Any ideas?
Thanks,
Z
LOCAL VERSION (only showing 1 dataset, works for all)
REMOTE VERSION (works on 2nd dataset shown not first)
2 posts - 1 participant