Inherits from
- AbstractPlotRenderer: enthought.chaco.abstract_plot_renderer.AbstractPlotRenderer
Attributes
- bgcolor
Overrides the default background color trait in PlotComponent.
bgcolor = 'transparent'
- hgrid
Read-only property for horizontal grid.
hgrid = Property
- hittest_type
The type of hit-testing that is appropriate for this renderer.
- 'line': Computes Euclidean distance to the line between the nearest adjacent points.
- 'point': Checks for adjacency to a marker or point.
hittest_type = Enum('point', 'line')
- index
The data source to use for the index coordinate.
index = Instance(ArrayDataSource)
- index_mapper
Screen mapper for index data.
index_mapper = Instance(AbstractMapper)
- index_range
Convenience property for accessing the index data range.
index_range = Property
- labels
Read-only property for labels.
labels = Property
- orientation
The orientation of the index axis.
orientation = Enum('h', 'v')
- origin_axis_color
Defines the origin axis color, for testing.
origin_axis_color = black_color_trait
- origin_axis_visible
Defines the origin axis visibility, for testing.
origin_axis_visible = Bool(False)
- origin_axis_width
Defines a the origin axis width, for testing.
origin_axis_width = Float(1.0)
- use_downsampling
Does the plot use downsampling? This is not used right now. It needs an implementation of robust, fast downsampling, which does not exist yet.
use_downsampling = Bool(False)
- use_subdivision
Does the plot use a spatial subdivision structure for fast hit-testing? This makes data updates slower, but makes hit-tests extremely fast.
use_subdivision = Bool(False)
- value
The data source to use as value points.
value = Instance(AbstractDataSource)
- value_mapper
Screen mapper for value data
value_mapper = Instance(AbstractMapper)
- value_range
Convenience property for accessing the value data range.
value_range = Property
- vgrid
Read-only property for vertical grid.
vgrid = Property
- x_axis
Read-only property for x-axis.
x_axis = Property
- x_mapper
Corresponds to either index_mapper or value_mapper, depending on the orientation of the plot.
x_mapper = Property
- y_axis
Read-only property for y-axis.
y_axis = Property
- y_mapper
Corresponds to either value_mapper or index_mapper, depending on the orientation of the plot.
y_mapper = Property
Inherited from base classes
- accepts_focus
- active_tool
- aspect_ratio
- auto_center
- auto_handle_event
- backbuffer_padding
- border_color
- border_dash
- border_visible
- border_width
- bounds
- classes
- container
- controller
- cursor_color
- cursor_style
- draw_layer
- draw_order
- draw_valid
- drawn_outer_bounds
- drawn_outer_position
- event_state
- fill_padding
- get
- height
- hpadding
- id
- inset_border
- invisible_layout
- layout_needed
- on_trait_event
- outer_bounds
- outer_height
- outer_position
- outer_width
- outer_x
- outer_x2
- outer_y
- outer_y2
- overlay_border
- overlays
- padding
- padding_accepts_focus
- padding_bottom
- padding_left
- padding_right
- padding_top
- pointer
- position
- set
- tools
- tooltip
- trait_added
- trait_modified
- underlays
- unified_draw
- use_backbuffer
- use_draw_order
- use_selection
- viewports
- visible
- vpadding
- width
- window
- wrappers
- x
- x2
- y
- y2
Method summary
- __getstate__(self)
- __init__(self, **kwtraits)
- __setstate__(self, state)
- get_closest_line(self, screen_pt, threshold = 7.0)
- get_closest_point(self, screen_pt, threshold = 7.0)
- get_screen_points(self)
- hittest(self, screen_pt, threshold = 7.0, return_distance = False)
- map_data(self, screen_pt, all_values = False)
- map_index(self, screen_pt, threshold = 2.0, outside_returns_none = True, index_only = False)
- map_screen(self, data_array)
Inherited from base classes
- __deepcopy__(self, memo)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- as_coordinates(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- cleanup(self, window)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- dispatch(self, event, suffix)
- do_layout(self, size = None, force = False)
- draw(self, gc, view_bounds = None, mode = 'default')
- draw_select_box(self, gc, position, bounds, width, dash, inset, color, bgcolor, marker_size)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- get_absolute_coords(self, *coords)
- get_event_transform(self, event = None, suffix = '')
- get_preferred_size(self)
- has_traits_interface(self, *interfaces)
- invalidate_and_redraw(self)
- invalidate_draw(self, damaged_regions = None, self_relative = False)
- is_in(self, x, y)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- request_redraw(self)
- reset_traits(self, traits = None, **metadata)
- set_outer_bounds(self, ndx, val)
- set_outer_position(self, ndx, val)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __getstate__(self)
- __init__(self, **kwtraits)
- __setstate__(self, state)
- get_closest_line(self, screen_pt, threshold = 7.0)
Tests for proximity in screen-space against lines connecting the points in this plot's dataset.
Parameters
- screen_pt : (x,y)
- A point to test.
- threshold : integer
- Optional maximum screen space distance (pixels) between the line and the plot. If 0.0, then the method returns the closest line regardless of distance from the plot.
Returns
(x1, y1, x2, y2, dist) of the endpoints of the line segment closest to screen_pt. The dist element is the perpendicular distance from screen_pt to the line. If there is only a single point in the renderer's data, then the method returns the same point twice.
If no data points are within threshold of screen_pt, returns None.
- get_closest_point(self, screen_pt, threshold = 7.0)
Tests for proximity in screen-space.
This method checks only data points, not the line segments connecting them; to do the latter use get_closest_line() instead.
Parameters
- screen_pt : (x,y)
- A point to test.
- threshold : integer
- Optional maximum screen space distance (pixels) between screen_pt and the plot. If 0.0, then no threshold tests are performed, and the nearest point is returned.
Returns
(x, y, distance) of a datapoint nearest to screen_pt. If no data points are within threshold of screen_pt, returns None.
- get_screen_points(self)
Returns the currently visible screen-space points.
Intended for use with overlays.
- hittest(self, screen_pt, threshold = 7.0, return_distance = False)
Performs proximity testing between a given screen point and the plot.
Parameters
- screen_pt : (x,y)
- A point to test.
- threshold : integer
- Optional maximum screen space distance (pixels) between screen_pt and the plot.
- return_distance : Boolean
- If True, returns the distance.
Returns
If self.hittest_type is 'point', then this method returns the screen coordinates of the closest point on the plot as a tuple (x,y)
If self.hittest_type is 'line', then this method returns the screen endpoints of the line segment closest to screen_pt, as ((x1,y1), (x2,y2))
If screen_pt does not fall within threshold of the plot, then this method returns None.
- map_data(self, screen_pt, all_values = False)
Maps a screen space point into the "index" space of the plot.
Implements the AbstractPlotRenderer interface.
If all_values is True, returns an array of (index, value) tuples; otherwise, it returns only the index values.
- map_index(self, screen_pt, threshold = 2.0, outside_returns_none = True, index_only = False)
Maps a screen space point to an index into the plot's index array(s).
Implements the AbstractPlotRenderer interface.
- map_screen(self, data_array)
Maps an array of data points into screen space and returns it as an array.
Implements the AbstractPlotRenderer interface.