(self, ax, onselect, direction, *, minspan=0, useblit=False,
props=None, onmove_callback=None, interactive=False,
button=None, handle_props=None, grab_range=10,
state_modifier_keys=None, drag_from_anywhere=False,
ignore_event_outside=False, snap_values=None)
| 2766 | """ |
| 2767 | |
| 2768 | def __init__(self, ax, onselect, direction, *, minspan=0, useblit=False, |
| 2769 | props=None, onmove_callback=None, interactive=False, |
| 2770 | button=None, handle_props=None, grab_range=10, |
| 2771 | state_modifier_keys=None, drag_from_anywhere=False, |
| 2772 | ignore_event_outside=False, snap_values=None): |
| 2773 | |
| 2774 | if state_modifier_keys is None: |
| 2775 | state_modifier_keys = dict(clear='escape', |
| 2776 | square='not-applicable', |
| 2777 | center='not-applicable', |
| 2778 | rotate='not-applicable') |
| 2779 | super().__init__(ax, onselect, useblit=useblit, button=button, |
| 2780 | state_modifier_keys=state_modifier_keys) |
| 2781 | |
| 2782 | if props is None: |
| 2783 | props = dict(facecolor='red', alpha=0.5) |
| 2784 | |
| 2785 | # Note: We set this based on the user setting during ínitialization, |
| 2786 | # not on the actual capability of blitting. But the value is |
| 2787 | # irrelevant if the backend does not support blitting, so that |
| 2788 | # we don't have to dynamically update this on the backend. |
| 2789 | # This relies on the current behavior that the request for |
| 2790 | # useblit is fixed during initialization and cannot be changed |
| 2791 | # afterwards. |
| 2792 | props['animated'] = self._useblit |
| 2793 | |
| 2794 | self.direction = direction |
| 2795 | self._extents_on_press = None |
| 2796 | self.snap_values = snap_values |
| 2797 | |
| 2798 | self.onmove_callback = onmove_callback |
| 2799 | self.minspan = minspan |
| 2800 | |
| 2801 | self.grab_range = grab_range |
| 2802 | self._interactive = interactive |
| 2803 | self._edge_handles = None |
| 2804 | self.drag_from_anywhere = drag_from_anywhere |
| 2805 | self.ignore_event_outside = ignore_event_outside |
| 2806 | |
| 2807 | self.new_axes(ax, _props=props, _init=True) |
| 2808 | |
| 2809 | # Setup handles |
| 2810 | self._handle_props = { |
| 2811 | 'color': props.get('facecolor', 'r'), |
| 2812 | **cbook.normalize_kwargs(handle_props, Line2D)} |
| 2813 | |
| 2814 | if self._interactive: |
| 2815 | self._edge_order = ['min', 'max'] |
| 2816 | self._setup_edge_handles(self._handle_props) |
| 2817 | |
| 2818 | self._active_handle = None |
| 2819 | |
| 2820 | def new_axes(self, ax, *, _props=None, _init=False): |
| 2821 | """Set SpanSelector to operate on a new Axes.""" |
nothing calls this directly
no test coverage detected