FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prevent display of axes, interactions outside of a figure by martinRenou · Pull Request #1683 · bqplot/bqplot · GitHub

/ bqplot Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 8 additions & 1 deletion bqplot/axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ class Axis(BaseAxis):

_view_name = Unicode('Axis').tag(sync=True)
_model_name = Unicode('AxisModel').tag(sync=True)
_ipython_display_ = None # We cannot display an axis outside of a figure.

# We cannot display axes outside of a figure
# for ipywidgets <=7
_ipython_display_ = None

# for ipywidgets >=8
def _repr_mimebundle_(self, **kwargs):
return {'text/plain': str(self)}

def __init__(self, *args, **kwargs):
super(Axis, self).__init__(**kwargs)
Expand Down
8 changes: 7 additions & 1 deletion bqplot/interacts.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ class Interaction(Widget):
_model_module = Unicode('bqplot').tag(sync=True)
_view_module_version = Unicode(__frontend_version__).tag(sync=True)
_model_module_version = Unicode(__frontend_version__).tag(sync=True)
# We cannot display an interaction outside of a figure

# We cannot display interactions outside of a figure
# for ipywidgets <=7
_ipython_display_ = None

# for ipywidgets >=8
def _repr_mimebundle_(self, **kwargs):
return {'text/plain': str(self)}


@register_interaction('bqplot.HandDraw')
class HandDraw(Interaction):
Expand Down
10 changes: 7 additions & 3 deletions bqplot/marks.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,15 @@ class Mark(Widget):
_view_module = Unicode('bqplot').tag(sync=True)
_view_module_version = Unicode(__frontend_version__).tag(sync=True)
_model_module_version = Unicode(__frontend_version__).tag(sync=True)

# We cannot display a marks outside of a figure
# for ipywidgets <=7
_ipython_display_ = None

# for ipywidgets >=8
def _repr_mimebundle_(self, **kwargs):
return {'text/plain': str(self)}

def _get_dimension_scales(self, dimension, preserve_domain=False):
"""
Return the list of scales corresponding to a given dimension.
Expand Down Expand Up @@ -278,9 +285,6 @@ def _handle_custom_msgs(self, _, content, buffers=None):

handler(self, content)

def _repr_mimebundle_(self, **kwargs):
return {'text/plain': str(self)}


@register_mark('bqplot.Lines')
class Lines(Mark):
Expand Down
Loading

Back | FazBrowse Home | New Git URL