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

check https://github.com/pipefunc/graphviz-anywidget #3

Open
basnijholt opened this issue Nov 22, 2024 · 1 comment
Open

check https://github.com/pipefunc/graphviz-anywidget #3

basnijholt opened this issue Nov 22, 2024 · 1 comment

Comments

@basnijholt
Copy link

basnijholt commented Nov 22, 2024

Just came across your repo and I should have probably looked for it earlier!

Anyway, here's my version that uses the same WASM binary and has interactivity too: https://github.com/pipefunc/graphviz-anywidget

@psychemedia
Copy link
Contributor

@basnijholt Thanks for sharing that link... Your widget seems far more elaborate:-) I'm very much just exploring the potential for exposing packages that are typically shipped as operating system installs via browser based environments.

One of the issues with anywidget , at least, the last time I checked, is the lack of an obvious way of handling waits/blocking commands in Jupyter.

I've been using jupyter_ui_poll.ui_events to handle this, although that solution doesn't work in JupyterLite.

def _wait(self, timeout, conditions=("status", "completed")):
start_time = time.time()
with ui_events() as ui_poll:
while self.response[conditions[0]] != conditions[1]:
ui_poll(10)
if timeout and ((time.time() - start_time) > timeout):
raise TimeoutError(
"Action not completed within the specified timeout."
)
time.sleep(0.1)
self.response["time"] = time.time() - start_time
return

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

2 participants