mariobuikhuizen / voila-embed

Embed jupyter widgets in existing websites
Other
52 stars 7 forks source link

debugging callback widget events #9

Open havok2063 opened 4 years ago

havok2063 commented 4 years ago

What's the best way to debug callback widget events in Voila? I put a bunch of print statements inside my callback, and started Voila in debug mode, but that info didn't seem to print to stdout. I get everything else. This link seems to only refer to debugging within the notebook. Running through Voila, I can't access the debug_viewer.

mariobuikhuizen commented 4 years ago

The output widget can be made available to Voila by adding a mount-id:

import ipywidgets as widgets
import traitlets

out = widgets.Output()
out.add_traits(_metadata=traitlets.Dict(default_value={'mount_id': 'out'}).tag(sync=True))
out
mariobuikhuizen commented 4 years ago

Added an example in d4cde49

havok2063 commented 4 years ago

Awesome, thanks! This is helpful.