Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing data between callbacks error #31

Open
vinaykumar80 opened this issue Feb 15, 2019 · 4 comments
Open

Sharing data between callbacks error #31

vinaykumar80 opened this issue Feb 15, 2019 · 4 comments

Comments

@vinaykumar80
Copy link

vinaykumar80 commented Feb 15, 2019

Hi,

I am trying to execute the example code given in Dash user guide and documentation explaining Caching and Signaling concept of Sharing data between callbacks - https://dash.plot.ly/sharing-data-between-callbacks , when I try to integrate this code in JupyterDash and run in notebook cell it gives me the following error:

AttributeError Traceback (most recent call last)
in
18 #app = dash.Dash(name, external_stylesheets=external_stylesheets)
19 app=JupyterDash('Caching and Signaling')
---> 20 cache = Cache(app.server, config={
21 'CACHE_TYPE': 'redis',
22 # Note that filesystem cache doesn't work on systems with ephemeral

AttributeError: 'JupyterDash' object has no attribute 'server'

Am I doing something wrong here or how can we get this example working in Jupyter-plotly-dash?
Complete code file (.py) is attached in the zip file

Thanks!

@vinaykumar80
Copy link
Author

@GibbsConsulting : Did you get a chance to look into above question? Please let me know if you need additional information.

Thanks!

@GibbsConsulting
Copy link
Owner

If you are going to remain within a Jupyter notebook, then you can use the notebook environment to store state. This would avoid the need to use an external cache or similar, but at the same time would require code changes to not use the cache.

Going forward, we could add a cache variant to make this relatively transparent. See GibbsConsulting/django-plotly-dash#120

@vinaykumar80
Copy link
Author

Ok, are you aware of any example code to store the state within notebook? If yes, it will help me integrating it into dash apps within notebooks.

Regarding the cache variant implementation in jupyter-plotly-dash, is there any tentative timeline as to when this feature could be completed?

Thanks!

@delsim
Copy link
Contributor

delsim commented Feb 24, 2019

Just reference a local (to the notebook) variable in a callback. The value used will be that of the time the callback is invoked. Note that changing the value of the variable will not automatically propagate to the Dash app until a callback is invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants