Пример #1
0
    def __init__(self, figure, *args, **kwargs):
        DOMWidget.__init__(self, *args, **kwargs)
        FigureCanvasWebAggCore.__init__(self, figure, *args, **kwargs)

        self.on_msg(self._handle_message)

        # This will stay True for cases where there is no
        # front-end (e.g. nbconvert --execute)
        self.syncing_data_url = True
Пример #2
0
    def send_state(self, key=None):
        if key is None:
            keys = self.keys
        elif isinstance(key, string_types):
            keys = [key]
        elif isinstance(key, Iterable):
            keys = key

        if not self.syncing_data_url:
            keys = [k for k in keys if k != '_data_url']

        DOMWidget.send_state(self, key=keys)
Пример #3
0
    def __init__(self, figure, *args, **kwargs):
        DOMWidget.__init__(self, *args, **kwargs)
        FigureCanvasWebAggCore.__init__(self, figure, *args, **kwargs)

        self.on_msg(self._handle_message)
Пример #4
0
    def __init__(self, canvas, *args, **kwargs):
        DOMWidget.__init__(self, *args, **kwargs)
        NavigationToolbar2WebAgg.__init__(self, canvas, *args, **kwargs)

        self.on_msg(self.canvas._handle_message)
Пример #5
0
 def __init__(self, width=320, height=320, fixed=True):
     DOMWidget.__init__(self)
     self._canvas_width = width
     self._canvas_height = height
     self._is_canvas_fixed = fixed
     self._reset()