How to use ipyevents - 3 common examples

To help you get started, we’ve selected a few ipyevents examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ejeschke / ginga / ginga / web / jupyterw / ImageViewJpw.py View on Github external
def set_widget(self, jp_imgw):
        """Call this method with the Jupyter image widget (image_w)
        that will be used.
        """
        super(ImageViewEvent, self).set_widget(jp_imgw)

        self.jp_evt = EventListener(source=jp_imgw)
        self.jp_evt.watched_events = [
            'keydown', 'keyup', 'mouseenter', 'mouseleave',
            'mousedown', 'mouseup', 'mousemove', 'wheel',
            'contextmenu'
        ]
        self.jp_evt.prevent_default_action = True

        self.jp_evt.on_dom_event(self._handle_event)
        self.logger.info("installed event handlers")

        return self.make_callback('map')
github WorldWideTelescope / pywwt / pywwt / jupyter.py View on Github external
from .core import BaseWWTWidget
from .layers import ImageLayer
from .jupyter_server import serve_file
from . import __version__

__all__ = ['WWTJupyterWidget']

_npm_version = (__version__.replace('.alpha', '-alpha.')
                           .replace('.beta', '-beta.')
                           .replace('.dev', '-dev.')
                           .replace('.rc', '-rc.'))
VIEW_MODULE_VERSION = _npm_version
MODEL_MODULE_VERSION = _npm_version

dom_listener = DOMListener()


@widgets.register
class WWTJupyterWidget(widgets.DOMWidget, BaseWWTWidget):
    """
    An AAS WorldWide Telescope Jupyter widget.
    """

    _view_name = Unicode('WWTView').tag(sync=True)
    _model_name = Unicode('WWTModel').tag(sync=True)
    _view_module = Unicode('pywwt').tag(sync=True)
    _model_module = Unicode('pywwt').tag(sync=True)
    _view_module_version = Unicode(VIEW_MODULE_VERSION).tag(sync=True)
    _model_module_version = Unicode(MODEL_MODULE_VERSION).tag(sync=True)

    _ra = Float(0.0).tag(sync=True, wwt=None)
github enthought / mayavi / mayavi / tools / remote / ipy_remote.py View on Github external
def __init__(self, scene_proxy, bridge, *args, **kw):
        super(IPyRemoteWidget, self).__init__(scene_proxy, bridge, *args, **kw)
        self.image = Image(format='PNG')
        self.event = Event(
            source=self.image,
            watched_events=[
                'dragstart', 'mouseenter', 'mouseleave',
                'mousedown', 'mouseup', 'mousemove', 'wheel',
                'keyup', 'keydown'
            ],
            prevent_default_action=True
        )
        self.event.on_dom_event(self.handle_ipyevent)
        self._update_image()

ipyevents

A custom widget for returning mouse and keyboard events to Python

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis

Popular ipyevents functions

Similar packages