Skip to content

Instantly share code, notes, and snippets.

@cabreraalex
Last active June 25, 2021 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cabreraalex/c00a66fff72d539515dcd0ccb6a1d23c to your computer and use it in GitHub Desktop.
Save cabreraalex/c00a66fff72d539515dcd0ccb6a1d23c to your computer and use it in GitHub Desktop.
widget-svelte-example example.py units
from ipywidgets import DOMWidget
from traitlets import Integer, Unicode
from ._frontend import module_name, module_version
class ExampleWidget(DOMWidget):
"""Example widget with a counter, increment button, and units string."""
_model_name = Unicode('ExampleModel').tag(sync=True)
_model_module = Unicode(module_name).tag(sync=True)
_model_module_version = Unicode(module_version).tag(sync=True)
_view_name = Unicode('ExampleView').tag(sync=True)
_view_module = Unicode(module_name).tag(sync=True)
_view_module_version = Unicode(module_version).tag(sync=True)
value = Unicode('Hello World').tag(sync=True)
count = Integer(0).tag(sync=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment