Visual Components¶
AbstractPlotRenderer
¶
- class chaco.api.AbstractPlotRenderer(**traits)¶
Bases:
chaco.plot_component.PlotComponent
This is the minimal interface that all plot renderers must support.
Higher-dimensionality plot renderers can implement a richer subclass of this abstract class.
This interface exists mostly to support the development of generic interactors and plot tools.
- bgcolor = "transparent"¶
Overrides the default value inherited from PlotComponent.
- map_data(screen_pt)¶
Maps a screen space point (sx, sy) to the “index” space of the plot.
Returns a floating point number, not an integer index.
- map_index(screen_pt, threshold=0.0, outside_returns_none=True, index_only=False)¶
Maps a screen space point to an index into the plot’s index array(s).
- Parameters
screen_pt ((x,y)) – The screen space point to map.
threshold (float) – Optional screen-space distance allowed between screen_pt and the plot; if non-zero, then a screen_pt within this distance is mapped to the neared plot index. (This feature is useful for sparse 2-D data.)
outside_returns_none (Boolean) – If True, then if screen_pt is outside the range of the data, the method returns None. If False, it returns the nearest end index in such a case.
index_only (Boolean) – If True, then this method maps based only on the index coordinate of screen_pt, and ignores the value coordinate.
- Returns
index – An index into the plot’s index array(s). Typically this index is just an integer, but if the plot has a 2-D index dimension, then this method returns a tuple of integers. If the input point cannot be mapped to an index, then None is returned.
If screen_pt corresponds to multiple indices, then only the first index is returned.
- Return type
int
- map_screen(data_array)¶
Maps an array of data points to screen space and returns an array of screen space points.
- resizable = "hv"¶
Overrides the default value inherited from PlotComponent.
AbstractOverlay
¶
- class chaco.api.AbstractOverlay(component=None, *args, **kw)¶
Bases:
chaco.plot_component.PlotComponent
The base class for overlays and underlays of the plot area.
The only default additional feature of an overlay is that it implements an overlay() drawing method that overlays this component on top of another, without the components necessarily having an object containment-ownership relationship.
- bgcolor = "transparent"¶
The background color (overrides PlotComponent). Typically, an overlay does not render a background.
- component = Instance(Component)¶
The component that this object overlays. This can be None. By default, if this object is called to draw(), it tries to render onto this component.
- draw_layer = "overlay"¶
The default layer that this component draws into.
- overlay(other_component, gc, view_bounds=None, mode='normal')¶
Draws this component overlaid on another component.
BasePlotFrame
¶
- class chaco.api.BasePlotFrame(**kw)¶
Bases:
enable.container.Container
,chaco.plot_component.PlotComponent
Base class for plot frames. Primarily defines the basic functionality of managing slots (sub-containers) within the plot frame.
NOTE: PlotFrames are deprecated. There is no need to use them any more. This class will be removed some time in the near future.
- add_to_slot(slot, component, stack='overlay')¶
Adds a component to the named slot using the given stacking mode. The valid modes are: ‘overlay’, ‘left’, ‘right’, ‘top’, ‘bottom’.
- auto_size = False¶
Overrides the Enable auto_size trait (which will be deprecated in the future)
- do_layout(size=None, force=False)¶
Tells this frame to do layout at a given size.
Overrides PlotComponent. If this frame needs to fit components in at least one dimension, then it checks whether any of them need to do layout; if so, the frame needs to do layout also.
- draw(gc, view_bounds=None, mode='normal')¶
Draws the plot frame.
Frames are the topmost Chaco component that knows about layout, and they are the start of the layout pipeline. When they are asked to draw, they can assume that their own size has been set properly and this in turn drives the layout of the contained components within the trame.
- fit_components = Enum("", "h", "v", "hv")¶
Dimensions in which this frame can resize to fit its components. This is similar to the resizable trait on PlotComponent. Chaco plot frames use this attribute in preference to the Enable auto_size attribute (which is overridden to be False by default).
- get_slot(slotname)¶
Returns the container in the named slot.
- set_slot(slotname, container)¶
Sets the named slot to use the given container. container can be None.
- slot_names = ()¶
A named list of places/positions/”slots” on the frame where PlotComponents can place themselves. Subclasses must redefine this trait with the appropriate values. Note that by default, __getattr__ treats these slot names as attributes on the class so they can be directly accessed. This is a class attribute.
CrossPlotFrame
¶
- class chaco.api.CrossPlotFrame(**kwtraits)¶
Bases:
chaco.base_plot_frame.BasePlotFrame
A simple, box-layout based plotframe.
This class supports a central plot area with optional axes on the top, bottom, and sides. The legend can be placed to the bottom, left, right, or inside the plot area. The title can be placed along any of the four edges.
NOTE: PlotFrames are deprecated. There is no need to use them any more. This class will be removed sometime in the future.
- bottom_height = Float(50.0)¶
Height of the bottom slot.
- default_bounds = (500, 500)¶
Default width and height. Class attribute.
- left_width = Float(50.0)¶
Width of the left slot.
- right_width = Float(50.0)¶
Width of the right slot.
- set_visible_slots(*names)¶
Convenience method to set the named slots to visible, while setting all others to not visible.
- slot_names = ('center', 'left', 'right', 'top', 'bottom')¶
Slots or positions on the frame where plot components can place themselves. Overrides PlotFrame.
- top_height = Float(50.0)¶
Height of the top slot.
DataView
¶
- class chaco.api.DataView(**kwtraits)¶
Bases:
chaco.plot_containers.OverlayPlotContainer
Represents a mapping from 2-D data space into 2-D screen space.
It can house renderers and other plot components, and otherwise behaves just like a normal PlotContainer.
- auto_axis = Bool(True)¶
Whether to automatically create the x_axis and y_axis if they were not already set by the caller.
- auto_grid = Bool(True)¶
Whether to automatically create the x_grid and y_grid if they were not already set by the caller.
- bgcolor = "white"¶
Background color (overrides Enable Component)
- default_origin = Enum("bottom left", "top left", …¶
The default location of the origin for new plots
- index_axis = AxisProperty¶
Convenience property for accessing the index axis, which can be X or Y, depending on orientation.
- index_grid = GridProperty¶
Convenience property for accessing the index grid, which can be horizontal or vertical, depending on orientation.
- index_mapper = Instance(Base1DMapper)¶
The mapper to use for the index data.
- index_range = Property¶
The range used for the index data.
- index_scale = Enum("linear", "log")¶
For x-y plots, the scale of the index axis.
- map_data(screen_pt)¶
Maps a screen space point into the 2D data space of this plot. (Note that this differs from the BaseXYPlot implementation, which by default only maps into the 1D index space.)
- map_screen(data_array)¶
Maps an array of data points to screen space and returns an array of screen space points.
- orientation = Enum("h", "v")¶
The orientation of the index axis.
- origin = Property(depends_on='default_origin')¶
The origin reported to axes, etc
- padding_top = 50¶
Padding defaults.
- range2d = Instance(DataRange2D)¶
The 2-D data range whose x- and y-ranges are exposed as the index_range and value_range property traits. This allows supporting both XY plots and 2-D (image) plots.
- value_axis = AxisProperty¶
Convenience property for accessing the value axis, which can be Y or X, depending on orientation.
- value_grid = GridProperty¶
Convenience property for accessing the value grid, which can be vertical or horizontal, depending on orientation.
- value_mapper = Instance(Base1DMapper)¶
The mapper to use for value data.
- value_range = Property¶
The range used for the value data.
- value_scale = Enum("linear", "log")¶
For x-y plots, the scale of the index axis.
- x_axis = Instance(AbstractOverlay)¶
The horizontal axis. Its position relative to the plot area can be “top”, “bottom”, or “float”. The default position for a new x-axis is “bottom”.
TODO: For now, this is an instance of AbstractOverlay instead of PlotAxis because scales_axis.PlotAxis doesn’t inherit from PlotAxis, but instead is a semi-reimplementation. Thus, rather than making scales_axis.PlotAxis inherit a concrete class, I chose to loosen this trait by specifying a more general base class of PlotAxis. This incurs lower risk of subtle and difficult-to-catch bugs being introduced by changes to the axis.PlotAxis class. This same comment applies to the y_axis trait below. –pwang x_axis = Instance(PlotAxis)
- x_grid = Instance(PlotGrid)¶
The grid that intersects the x-axis, i.e., a set of vertical lines.
- x_mapper = OrientedMapperProperty¶
Convenience property that offers access to whatever mapper corresponds to the X-axis.
- y_axis = Instance(AbstractOverlay)¶
The vertical axis. Its position relative to the plot area can be “left”, “right”, or “float”. The default position for a new y-axis is “left”. y_axis = Instance(PlotAxis)
- y_grid = Instance(PlotGrid)¶
The grid that intersects the y-axis, i.e., a set of horizontal lines.
- y_mapper = OrientedMapperProperty¶
Convenience property that offers access to whatever mapper corresponds to the Y-axis
SimplePlotFrame
¶
- class chaco.api.SimplePlotFrame(**kwtraits)¶
Bases:
chaco.base_plot_frame.BasePlotFrame
A plot frame with just a single, center container that takes up the entire frame.
NOTE: PlotFrames are deprecated. There is no need to use them any more. This class will be removed sometime in the future.
- default_bounds = (500, 500)¶
Default width and height. Class attribute.
- fit_components = ""¶
This frame does not resize to fit components. Overrides PlotFrame.
- fit_window = True¶
This frame maximizes itself within the window, if it is a top-level component. Overrides Enable Container.
- get_preferred_size()¶
Returns the size (width,height) that is preferred for this component.
Overrides PlotComponent.
- slot_names = 'center'¶
This frame has only one position for plot components. Overrides PlotFrame.
PlotComponent
¶
- class chaco.api.PlotComponent(**traits)¶
Bases:
enable.component.Component
PlotComponent is the base class for all plot-related visual components. It defines the various methods related to layout and tool handling, which virtually every subclass uses or needs to be aware of.
Several of these top-level layout and draw methods have implementations that must not be overridden; instead, subclasses implement various protected stub methods.
- draw_layer = Str("plot")¶
The default draw layer for Chaco plot components is the “plot” layer
- draw_order = Instance(list, args=(DEFAULT_DRAWING_ORDER,))¶
The order in which various rendering classes on this component are drawn. Note that if this component is placed in a container, in most cases the container’s draw order is used, since the container calls each of its contained components for each rendering pass. Typically, the definitions of the layers are:
‘background’: Background image, shading
- ‘image’: A special layer for plots that render as images. This is in
a separate layer since these plots must all render before non-image plots.
‘underlay’: Axes and grids
‘plot’: The main plot area itself
- ‘selection’: Selected content are rendered above normal plot elements
to make them stand out
‘border’: Plot borders
‘annotation’: Lines and text that are conceptually part of the “plot” but need to be rendered on top of everything else in the plot
‘overlay’: Legends, selection regions, and other tool-drawn visual elements
- use_draw_order = Bool(True)¶
Draw layers in draw_order? If False, use _do_draw() (for backwards compatibility).
PlotGraphicsContext
¶
- class chaco.api.PlotGraphicsContext(size_or_ary, *args, **kw)¶
Bases:
chaco.plot_graphics_context.PlotGraphicsContextMixin
,kiva.agg.GraphicsContextSystem
Label
¶
- class chaco.api.Label(**traits)¶
Bases:
traits.has_traits.HasTraits
A label used by overlays.
Label is not a Component; it’s just an object encapsulating text settings and appearance attributes. It can be used by components that need text labels to store state, perform layout, and render the text.
- bgcolor = transparent_color_trait¶
The background color of the label.
- border_color = black_color_trait¶
The color of the border.
- border_visible = Bool(True)¶
Whether or not the border is visible
- border_width = Int(0)¶
The width of the label border. If it is 0, then it is not shown.
- color = black_color_trait¶
The color of the label text.
- draw(gc)¶
Draws the label.
This method assumes the graphics context has been translated to the correct position such that the origin is at the lower left-hand corner of this text label’s box.
- font = KivaFont("modern 10")¶
The font of the label text.
- get_bounding_box(gc)¶
Returns a rectangular bounding box for the Label as (width,height).
- get_bounding_poly(gc)¶
Returns a list [(x0,y0), (x1,y1),…] of tuples representing a polygon that bounds the label.
- get_width_height(gc)¶
Returns the width and height of the label, in the rotated frame of reference.
- line_spacing = Int(5)¶
Number of pixels of spacing between lines of text.
- margin = Int(2)¶
Number of pixels of margin around the label, for both X and Y dimensions.
- max_width = Float(0.0)¶
Number of pixels to limit the width of the label to. Lines which are too long will be broken to fit on word boundaries. Line width is calculated without considering the value of margin. A max_width of 0.0 means that lines will not be broken.
- rotate_angle = Float(0)¶
The angle of rotation of the label.
- text = Str¶
The label text. Carriage returns (n) are always connverted into line breaks.
PlotLabel
¶
- class chaco.api.PlotLabel(text='', *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
A label used by plots.
This class wraps a simple Label instance, and delegates some traits to it.
- angle = DelegatesTo("_label", "rotate_angle")¶
The angle of rotation of the label.
- color = DelegatesTo("_label")¶
The color of the label text.
- do_layout()¶
Tells this component to do layout.
Overrides PlotComponent.
- draw_layer = "plot"¶
By default, this acts like a component and will render on the main “plot” layer unless its component attribute gets set.
- font = LabelDelegate¶
The font for the label text.
- get_preferred_size()¶
Returns the label’s preferred size.
Overrides PlotComponent.
- hjustify = Enum("center", "left", "right")¶
Horizontal justification used if the label has more horizontal space than it needs.
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws this label overlaid on another component.
Overrides AbstractOverlay.
- overlay_position = Trait("outside top", Str, None)¶
The position of this label relative to the object it is overlaying. Can be “top”, “left”, “right”, “bottom”, and optionally can be preceeded by the words “inside” or “outside”, separated by a space. If “inside” and “outside” are not provided, then defaults to “outside”. .. rubric:: Examples
inside top outside right
- resizable = "h"¶
The label has a fixed height and can be resized horizontally. (Overrides PlotComponent.)
- text = LabelDelegate¶
The text of the label.
- vjustify = Enum("center", "bottom", "top")¶
Vertical justification used if the label has more vertical space than it needs.
Legend
¶
- class chaco.api.Legend(component=None, *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
A legend for a plot.
- align = Enum("ur", "ul", "ll", "lr")¶
The position of the legend with respect to its overlaid component. (This attribute applies only if the legend is used as an overlay.)
ur = Upper Right
ul = Upper Left
ll = Lower Left
lr = Lower Right
- bgcolor = white_color_trait¶
The background color of the legend (overrides AbstractOverlay).
- border_padding = Int(10)¶
The amount of space between the content of the legend and the border.
- border_visible = True¶
The border is visible (overrides Enable Component).
- clip_to_component = Bool(False)¶
Should the legend clip to the bounds it needs, or to its parent?
- color = black_color_trait¶
The color of the text labels
- composite_icon_renderer = Instance(AbstractCompositeIconRenderer)¶
The renderer that draws the icons for the legend.
- draw_layer = "overlay"¶
The legend is drawn on the overlay layer of its parent (overrides PlotComponent).
- error_icon = Enum("skip", "blank", "questionmark")¶
Action that the legend takes when it encounters a plot whose icon it cannot render:
‘skip’: skip it altogether and don’t render its name
‘blank’: render the name but leave the icon blank (color=self.bgcolor)
‘questionmark’: render a “question mark” icon
- font = KivaFont("modern 12")¶
The font to use for the legend text.
- get_label_at(x, y)¶
Returns the label object at (x,y)
- get_preferred_size()¶
Computes the size and position of the legend based on the maximum size of the labels, the alignment, and position of the component to overlay.
- hide_invisible_plots = Bool(True)¶
Whether or not to hide plots that are not visible. (This is checked during layout.) This option will filter out the items in labels above, so if you absolutely, positively want to set the items that will always display in the legend, regardless of anything else, then you should turn this option off. Otherwise, it usually makes sense that a plot renderer that is not visible will also not be in the legend.
- icon_bounds = List([24, 24])¶
The size of the icon or marker area drawn next to the label.
- icon_spacing = Int(5)¶
Amount of spacing between each label and its icon.
- invisible_plot_alpha = Float(0.33)¶
If hide_invisible_plots is False, we can still choose to render the names of invisible plots with an alpha.
- is_in(x, y)¶
overloads from parent class because legend alignment and padding does not cooperatate with the basic implementation
This may just be caused byt a questionable implementation of the legend tool, but it works by adjusting the padding. The Component class implementation of is_in uses the outer positions which includes the padding
- labels = List¶
The list of labels to show and the order to show them in. If this list is blank, then the keys of self.plots is used and displayed in alphabetical order. Otherwise, only the items in the labels list are drawn in the legend. Labels are ordered from top to bottom.
- line_spacing = Int(3)¶
The amount of space between legend items.
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws this component overlaid on another component.
Implements AbstractOverlay.
- plots = Dict¶
Map of labels (strings) to plot instances or lists of plot instances. The Legend determines the appropriate rendering of each plot’s marker/line.
- resizable = "hv"¶
The legend is not resizable (overrides PlotComponent).
- title = Str('')¶
An optional title string to show on the legend.
- title_at_top = Bool(True)¶
If True, title is at top, if False then at bottom.
- unified_draw = True¶
The legend draws itself as in one pass when its parent is drawing the draw_layer (overrides PlotComponent).
ToolTip
¶
- class chaco.api.ToolTip(component=None, *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
An overlay that is a toolip.
- auto_adjust = Bool(True)¶
Should the tooltip automatically reposition itself to remain visible and unclipped on its overlaid component?
- bgcolor = white_color_trait¶
Use a white background color (overrides AbstractOverlay).
- border_padding = Int(4)¶
The ammount of space between the border and the text.
- border_visible = True¶
Use a visible border. (Overrides Enable Component.)
- draw(gc, view_bounds=None, mode='normal')¶
Draws the plot component.
Overrides PlotComponent.
- font = KivaFont('modern 10')¶
The font to render the tooltip.
- line_spacing = Int(4)¶
The number of pixels between lines.
- lines = List¶
List of text strings to put in the tooltip.
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws the tooltip overlaid on another component.
Overrides AbstractOverlay.
- resizable = ""¶
The tooltip is a fixed size. (Overrides PlotComponent.)
- rotate_angle = Float(0.0)¶
Angle to rotate (counterclockwise) in degrees. NB this will only currently affect text, so probably only useful if borders and background are disabled
- text_color = black_color_trait¶
The color of the text in the tooltip
DataLabel
¶
- class chaco.api.DataLabel(component=None, *args, **kw)¶
Bases:
chaco.tooltip.ToolTip
A label on a point in data space.
Optionally, an arrow is drawn to the point.
- arrow_color = ColorTrait("black")¶
The color of the arrow.
- arrow_max_length = Float(inf)¶
The maximum length of the arrow before it will be drawn. By default, the arrow will be drawn regardless of how long it is.
- arrow_min_length = Float(0)¶
The minimum length of the arrow before it will be drawn. By default, the arrow will be drawn regardless of how short it is.
- arrow_root = Trait("auto", "auto", "top left", "top right", "bottom left", …¶
The position of the base of the arrow on the label. If this is ‘auto’, then the label uses label_position. Otherwise, it treats the label as if it were at the label position indicated by this attribute.
- arrow_size = Float(10)¶
The length of the arrowhead, in screen points (e.g., pixels).
- arrow_visible = Bool(True) # FIXME: replace with some sort of ArrowStyle¶
Draw an arrow from the label to the data point? Only used if data_point is not None.
- clip_to_plot = Bool(True)¶
Does the label clip itself against the main plot area? If not, then the label draws into the padding area (where axes typically reside).
- corner_radius = Float(10)¶
The radius (in screen coordinates) of the curved corners of the “bubble”.
- custom_symbol = Any¶
The symbol to use if marker is set to “custom”. This attribute must be a compiled path for the given Kiva context.
- data_point = ArrayOrNone()¶
The point in data space where this label should anchor itself.
- label_format = Str("(%(x)f, %(y)f)")¶
The format string that determines the label’s text. This string is formatted using a dict containing the keys ‘x’ and ‘y’, corresponding to data space values.
- label_position = LabelPositionTrait¶
The location of the data label relative to the data point.
- label_style = Enum('box', 'bubble')¶
‘box’ is a simple rectangular box, with an arrow that is a single line with an arrowhead at the data point. ‘bubble’ can be given rounded corners (by setting corner_radius), and the ‘arrow’ is a thin triangular wedge with its point at the data point. When label_style is ‘bubble’, the following traits are ignored: arrow_size, arrow_color, arrow_root, and arrow_max_length.
- label_text = Str¶
The text to show on the label, or above the coordinates for the label, if show_label_coords is True
- marker = MarkerTrait¶
The type of marker to use. This is a mapped trait using strings as the keys.
- marker_color = ColorTrait("red")¶
The color of the inside of the marker.
- marker_line_color = ColorTrait("black")¶
The color out of the border drawn around the marker.
- marker_line_width = Float(1.0)¶
The thickness, in pixels, of the outline to draw around the marker. If this is 0, no outline will be drawn.
- marker_size = Int(4)¶
The pixel size of the marker (doesn’t include the thickness of the outline).
- marker_visible = Bool(True)¶
Mark the point on the data that this label refers to?
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws the tooltip overlaid on another component.
Overrides and extends ToolTip.overlay()
- show_label_coords = Bool(True)¶
Flag whether to show coordinates with the label or not.
- xmid = Property(Float, depends_on=['x', 'x2'])¶
The center x position (average of x and x2)
- ymid = Property(Float, depends_on=['y', 'y2'])¶
The center y position (average of y and y2)
LassoOverlay
¶
- class chaco.api.LassoOverlay(component=None, *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
Draws a lasso selection region on top of a plot.
LassoOverlay gets its data from a LassoSelection.
- bgcolor = 'clear'¶
The background color (overrides AbstractOverlay).
- lasso_selection = Instance('chaco.tools.lasso_selection.LassoSelection')¶
The LassoSelection that provides the data for this overlay.
- overlay(other_component, gc, view_bounds=None, mode='normal')¶
Draws this component overlaid on another component.
Implements AbstractOverlay.
- selection_alpha = Float(0.8)¶
The transparency level for the selection fill color.
- selection_border_color = ColorTrait('dodgerblue')¶
The border color for the selection region.
- selection_border_dash = LineStyle¶
The line style of the selection border.
- selection_border_width = Float(2.0)¶
The width of the selection border.
- selection_fill_color = ColorTrait('lightskyblue')¶
The fill color for the selection region.
ColorBar
¶
- class chaco.api.ColorBar(*args, **kw)¶
Bases:
chaco.abstract_plot_renderer.AbstractPlotRenderer
A color bar for a color-mapped plot.
- axis_visible = Bool(True)¶
Is there a visible axis on the colorbar?
- bgcolor = 'transparent'¶
Overrides the default background color trait in PlotComponent.
- border_visible = True¶
The border is visible (overrides enable.Component).
- color_mapper = Property #Instance(ColorMapper)¶
Screen mapper for color data
- direction = Enum('normal', 'flipped')¶
Should the bar go left-to-right or bottom-to-top (normal) or the reverse?
- grid_visible = Bool(True)¶
Is there a visible grid on the colorbar?
- index = Property¶
Optional index data source for generic tools to attach metadata to.
- index_mapper = Instance(AbstractMapper)¶
Screen mapper for index data.
- orientation = Enum('v', 'h')¶
The orientation of the index axis.
- origin = Enum('bottom left', 'top left', 'bottom right', 'top right')¶
Faux origin for the axis to look at
- plot = Any¶
Optional color-mapped plot that this color bar references. If specified, the plot must have a color_mapper attribute.
- use_draw_order = True¶
Draw layers in “draw order”
- value_mapper = Property(depends_on='color_mapper')¶
Screen mapper for value data (synonym for color_mapper)
- width = 40¶
Default width is 40 pixels (overrides enable.CoordinateBox)
- x_mapper = Property¶
Corresponds to either index_mapper or None, depending on the orientation of the plot.
- y_mapper = Property¶
Corresponds to either index_mapper or None, depending on the orientation of the plot.
TextBoxOverlay
¶
- class chaco.api.TextBoxOverlay(component=None, *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
Draws a box with text in it.
- align = Enum("ur", "ul", "ll", "lr")¶
Alignment of the text in the box:
“ur”: upper right
“ul”: upper left
“ll”: lower left
“lr”: lower right
- alpha = Trait(1.0, None, Float)¶
The alpha value to apply to bgcolor
- alternate_position = Any¶
This allows subclasses to specify an alternate position for the root of the text box. Must be a sequence of length 2.
- bgcolor = ColorTrait("transparent")¶
The background color for the box (overrides AbstractOverlay).
- border_color = ColorTrait("dodgerblue")¶
The color of the outside box.
- border_size = Int(1)¶
The thickness of box border.
- border_visible = Bool(True)¶
The border visibility. Defaults to true to duplicate previous behavior.
- font = KivaFont("modern 12")¶
The font to use for the text.
- max_text_width = Float(0.0)¶
The maximum width of the displayed text. This affects the width of the text only, not the text box, which includes margins around the text and padding. A max_text_width of 0.0 means that the width will not be restricted.
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws the box overlaid on another component.
Overrides AbstractOverlay.
- padding = Int(5)¶
Number of pixels of padding around the text within the box.
- text = Str¶
The text to display in the box.
- text_color = ColorTrait("black")¶
The color of the text.
ScatterInspectorOverlay
¶
- class chaco.api.ScatterInspectorOverlay(component=None, *args, **kw)¶
Bases:
chaco.abstract_overlay.AbstractOverlay
Highlights points on a scatterplot as the mouse moves over them. Can render the points in a different style, as well as display a DataLabel.
Used in conjuction with ScatterInspector.
- hover_metadata_name = Str('hover')¶
The style to use when a point is hovered over
- overlay(component, gc, view_bounds=None, mode='normal')¶
Draws this component overlaid on another component.
- selection_metadata_name = Str('selections')¶
The style to use when a point has been selected by a click