Skip to content

Instantly share code, notes, and snippets.

@cabreraalex
Last active June 25, 2021 16:33
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/31c4d8af2a1785290ba684a234191ae5 to your computer and use it in GitHub Desktop.
Save cabreraalex/31c4d8af2a1785290ba684a234191ae5 to your computer and use it in GitHub Desktop.
widget-svelte-example example.py
from ipywidgets import DOMWidget
from traitlets import Integer, Unicode
from ._frontend import module_name, module_version
class ExampleWidget(DOMWidget):
"""Example widget with a counter and increment button."""
_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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment