From 19a6b54d75ab68418f0efeb4d26dff0daa6ebbfc Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 18 Mar 2021 10:53:25 -0500 Subject: [PATCH] remove SelectableOverlayPlotContainer and references to it --- chaco/api.py | 1 - chaco/selectable_overlay_container.py | 72 --------------------------- docs/source/api/containers.rst | 7 --- 3 files changed, 80 deletions(-) delete mode 100644 chaco/selectable_overlay_container.py diff --git a/chaco/api.py b/chaco/api.py index 40b60d8b9..4e526e80c 100644 --- a/chaco/api.py +++ b/chaco/api.py @@ -44,7 +44,6 @@ from .simple_plot_frame import SimplePlotFrame from .plot_component import PlotComponent from .plot_graphics_context import PlotGraphicsContext, PlotGraphicsContextMixin -from .selectable_overlay_container import SelectableOverlayPlotContainer from .plot_containers import OverlayPlotContainer, HPlotContainer, VPlotContainer, \ GridPlotContainer GridContainer = GridPlotContainer diff --git a/chaco/selectable_overlay_container.py b/chaco/selectable_overlay_container.py deleted file mode 100644 index 13cfdb0b8..000000000 --- a/chaco/selectable_overlay_container.py +++ /dev/null @@ -1,72 +0,0 @@ -""" Defines the SelectableOverlayPlotContainer class. -""" - - - -from numpy import array, float64 - -# Enthought library imports -from traits.api import Bool, Float, Enum -from enable.api import ColorTrait - -# Local imports -from .plot_containers import OverlayPlotContainer - -class SelectableOverlayPlotContainer(OverlayPlotContainer): - """ - An OverlayPlotContainer that can show a selection region on top of it. - """ - - #: Screen position of the start of the selection, which can be in the x- or - #: y-dimension, depending on **selection_direction**. - selection_screen_start = Float(0.0) - #: Screen position of the end of the selection, which can be in the x- or - #: y-dimension, depending on **selection_direction**. - selection_screen_end = Float(0.0) - #: Is there an active selection? - selection_active = Bool(False) - #: The direction of the selection. - selection_direction = Enum('v', 'h') - #: The color to use to fill the selected region. - selection_fill_color = ColorTrait('lightskyblue') - #: The color to use to draw the border of the selected region. - selection_border_color = ColorTrait('dodgerblue') - #: The transparency of the **selection_fill_color**. - selection_alpha = Float(0.3) - - def _draw_overlays(self, gc, view_bounds=None, mode='normal'): - """ Method for backward compatability with old drawing scheme. - - Overrides BasePlotContainer. - """ - self._draw_selection(gc, view_bounds=view_bounds, mode=mode) - return - - def _draw_selection(self, gc, view_bounds=None, mode='normal'): - """ Renders a selected subset of a component's data. - - Overrides PlotComponent. - """ - if self.selection_active: - if self.selection_direction == 'h': - x1 = self.selection_screen_start - x2 = self.selection_screen_end - y1 = self.y - y2 = self.position[1] + self.bounds[1] - 1 - else: - x1 = self.x - x2 = self.position[0] + self.bounds[0] - 1 - y1 = self.selection_screen_start - y2 = self.selection_screen_end - lowerleft = array((min(x1, x2), min(y1, y2)), float64) - upperright = array((max(x1, x2), max(y1, y2)), float64) - with gc: - gc.translate_ctm(*self.position) - gc.set_fill_color(self.selection_fill_color_) - gc.set_stroke_color(self.selection_border_color_) - gc.set_alpha(self.selection_alpha) - gc.rect(lowerleft[0], lowerleft[1], upperright[0], upperright[1]) - gc.draw_path() - return - - diff --git a/docs/source/api/containers.rst b/docs/source/api/containers.rst index 22327b7dc..18fd90a61 100644 --- a/docs/source/api/containers.rst +++ b/docs/source/api/containers.rst @@ -35,10 +35,3 @@ Containers .. autoclass:: GridPlotContainer :members: :show-inheritance: - -:class:`SelectableOverlayPlotContainer` -======================================= -.. autoclass:: SelectableOverlayPlotContainer - :members: - :show-inheritance: -