6
Chaco is a toolkit for composing many visualization components into
7
interactive, visually appealing data graphics. It is both a software
8
architecture and a collection of visual components. It also comes bundled
9
with a number of example visualizations that can be quickly adapted for
10
specific application domains.
12
Since interactivity and the model-view-controller model is central to Chaco's
13
design, we say that it is a plotting application toolkit. (Of course, Chaco
14
can render static plots as well.)
16
Chaco is architected to support interactive data visualization and integration
17
into other applications. Its components are meant to be connected and hooked
18
up to data that might be updating in realtime, and its rendering and event
19
models are designed to be as responsive as possible.
21
Chaco primarily depends on three other Enthought packages: Traits, Enable, and
22
Kiva. Enable is a pure-python visual component canvas. It has a "backend"
23
that translates GUI toolkit-specific events and methods into a generic system.
24
Currently only the WX toolkit is supported, but there is an outdated Tk
25
backend, and someday there will hopefully be a Qt backend as well. Enable is
26
part of the Enthought Tool Suite.
28
Chaco and Enable both use Kiva for rendering. Kiva is a vector drawing API
29
for Python that is similar to Quartz, PDF, and Cairo. Like Enable, it
30
presents a common API across different backends.
36
At the highest level, Chaco classes fall into two broad groups: those that
37
mainly deal with data transformation, and those that deal with rendering.
38
The first group of data-oriented components is fairly small, but it is
39
crucial to the Chaco model. The latter group of visual components includes
40
basically everything that the user sees and interacts with.
42
All visual components in Chaco have position, bounds, a place in the
43
containment and layout hierarchy, a place in the rendering order, and can
44
respond to keyboard and mouse events. Examples of visual components include
45
axes, grids, plot renderers, legends, and tooltip overlays.
51
The data components in Chaco consist of data sources, ranges, and mappers.
58
Structure of a Basic Plot
59
-------------------------
61
Conceptually, the simplest plot (like a scatter or line plot) consists of some
62
dataspace bounds in X and Y, and some corresponding screen space bounds. In
63
Chaco, all components represent their screen space coordinates using the 'bounds'
64
and 'position' attributes:
66
position -> [x,y] of the lower left-most point that is part of the component
67
bounds -> [w,h]; the width and height of the component; can be thought of as
68
the number of pixels in the component in a pixel-/raster-based system
70
Additional convenience attributes are available:
71
x, y -> equivalent to position[0] and position[1]
72
x2, y2 -> the coordinates of the upper right-most point in the component