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

Question: Ideal way to return data from frontend in ipyWidget #3027

Open
anant-k-singh opened this issue Nov 29, 2020 · 0 comments
Open

Question: Ideal way to return data from frontend in ipyWidget #3027

anant-k-singh opened this issue Nov 29, 2020 · 0 comments
Labels
Custom Widget Issues related to using ipywidgets as a framework for custom widgets

Comments

@anant-k-singh
Copy link

I am creating a custom ipyWidget for Jupyter notebooks and blocked on the right architecture for my widget

These are the order of action I want to be performed:

  1. In python kernel: Call a method of my widget class, say myWidget.ExtractData()
  2. In python kernel: Somehow call a JavaScript method in frontend
    *Currently I update the shared state field and listen for state change on frontend (JS) side and execute that function
  3. In widget frontend: Execute some task (~2 sec)
  4. In widget frontend: Somehow return the computed value back to python kernel
    *Currently I update another shared state field and listen for state change on python kernel side
  5. In python kernel: Receive the data sent by JS method (in frontend) and return that data from this myWidget.ExtractData() function
    *Not able to implement this. Currently I am reading the data directly from the shared state of the widget, which is not the expectation

Q1: Is it possible to implement this expectation?

Q2: If yes, please suggest me some advise, docs or examples where such scenarios are explained/implemented

@ianhi ianhi added the Custom Widget Issues related to using ipywidgets as a framework for custom widgets label Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Custom Widget Issues related to using ipywidgets as a framework for custom widgets
Projects
None yet
Development

No branches or pull requests

2 participants