Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Retrieve components properties outside of dash app #28

Open
emmanuelle opened this issue May 31, 2019 · 2 comments
Open

Retrieve components properties outside of dash app #28

emmanuelle opened this issue May 31, 2019 · 2 comments

Comments

@emmanuelle
Copy link

I have the following usecase: I would like to have a jupyter notebook in jupyterlab where I do some computations (say, on images), then create a dash app to process my data, and then retrieve (back) the value of some component properties (for example an image generated by a segmentation made from users annotations), so that I can continue the computations in the notebook. Is this possible at the moment?

I'm happy to give more explanations or provide a notebook with some mock-up code if it's clearer.

@chriddyp
Copy link
Member

chriddyp commented May 31, 2019

The Dash apps are run in a separate process which has its own memory scope. So, extracting the scoped variables from within a function with global won't necessary work.

In our integration tests, we use multiprocessing.Value - https://docs.python.org/3.6/library/multiprocessing.html#sharing-state-between-processes, see e.g. https://github.com/plotly/dash/blob/f958d9e0910a860cc5cc0b3b6a98a8f205c29d6a/tests/integration/test_render.py#L325

I think only primitive data types are supported, so you might need to serialize back and forth into strings.

@emmanuelle
Copy link
Author

Thanks @chriddyp I'll look into this. It would be a great feature for users who want at the same time to process data in a notebook and to benefit from the rich interactivity of a Dash app.

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

No branches or pull requests

2 participants