MCPcopy Index your code
hub / github.com/bqplot/bqplot / HandDraw

Class HandDraw

bqplot/interacts.py:78–115  ·  view source on GitHub ↗

A hand-draw interaction. This can be used to edit the 'y' value of an existing line using the mouse. The minimum and maximum x values of the line which can be edited may be passed as parameters. The y-values for any part of the line can be edited by drawing the desired path whil

Source from the content-addressed store, hash-verified

76
77@register_interaction('bqplot.HandDraw')
78class HandDraw(Interaction):
79
80 """A hand-draw interaction.
81
82 This can be used to edit the 'y' value of an existing line using the mouse.
83 The minimum and maximum x values of the line which can be edited may be
84 passed as parameters.
85 The y-values for any part of the line can be edited by drawing the desired
86 path while holding the mouse-down.
87 y-values corresponding to x-values smaller than min_x or greater than max_x
88 cannot be edited by HandDraw.
89
90 Attributes
91 ----------
92 lines: an instance Lines mark or None (default: None)
93 The instance of Lines which is edited using the hand-draw interaction.
94 The 'y' values of the line are changed according to the path of the
95 mouse. If the lines has multi dimensional 'y', then the 'line_index'
96 attribute is used to selected the 'y' to be edited.
97 line_index: nonnegative integer (default: 0)
98 For a line with multi-dimensional 'y', this indicates the index of the
99 'y' to be edited by the handdraw.
100 min_x: float or Date or None (default: None)
101 The minimum value of 'x' which should be edited via the handdraw.
102 max_x: float or Date or None (default: None)
103 The maximum value of 'x' which should be edited via the handdraw.
104 """
105 lines = Instance(Lines, allow_none=True, default_value=None)\
106 .tag(sync=True, **widget_serialization)
107 line_index = Int().tag(sync=True)
108 # TODO: Handle infinity in a meaningful way (json does not)
109 min_x = (Float(None, allow_none=True) | Date(None, allow_none=True))\
110 .tag(sync=True)
111 max_x = (Float(None, allow_none=True) | Date(None, allow_none=True))\
112 .tag(sync=True)
113
114 _view_name = Unicode('HandDraw').tag(sync=True)
115 _model_name = Unicode('HandDrawModel').tag(sync=True)
116
117
118@register_interaction('bqplot.PanZoom')

Callers

nothing calls this directly

Calls 1

DateClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…