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
How to combine Floweaver with interactive widgets? #67
Comments
I'd use a VBox widget. You can create the button and SankeyWidget once and display them (by putting them at the end of a cell, or calling Note that |
Thank you for the answer. For the benefit of future archaeologists, here is the working solution
The My guess is that it might be useful to add a section to the manual, that provides this basic example of interactive diagrams, and maybe something beyond it too; since I doubt that I am the only person on the planet who bumped into this use case :-). If you're OK with this, I can make a pull request with an initial version. |
Glad you figured it out! More examples would be great 👍 Maybe add it to the cookbook section of the docs? |
I am building an interactive system that uses Jupyter widgets to control the settings that go into the Sankey diagram definition. The idea is to render the diagram when a button is pressed, at this stage I check the custom values entered by the user and adjust the diagram parameters accordingly.
I have the following proof of concept code, which is just a minor extension of the example from the tutorial, it doesn't have any diagram tweaking controls, but it is tied to the button that should trigger the rendering:
It displays the button, and when I click it, the console says "Rendering done", but the diagram is not shown. However, if I take this line
SankeyWidget(links=flows.to_dict('records'))
into a separate cell, the diagram is rendered:As I am no expert in Jupyter nor Floweaver, my guess is that only one entity can decide what is drawn in the cell - and since the button widget is the first one that's shown, it takes over the entire cell output. I would like to know
Thanks!
The text was updated successfully, but these errors were encountered: