@@ -2,82 +2,92 @@ Here are some of the things I would like to accomplish with mpl1. Any
22and all of this is open to discussion. What I present below is pretty
33ambitious, so if there is support, we will need significant
44contributions from several developers for several months. Ideally, we
5- would get a good sketch working, and then organize a spint (4 days?)
5+ would get a good sketch working, and then organize a spint (3- 4 days?)
66for late August, where we try get as far as possible to making this
77viable.
88
9- = data copying =
9+ = Data copying =
1010
11- Push the data to the backend only once, or only when required. update
12- the transforms to the backend, but do not push transformed data on
11+ Push the data to the backend only once, or only when required. Update
12+ the transforms in the backend, but do not push transformed data on
1313every draw. This is potentially a major win, because we currently
14- move the data around on every draw
14+ move the data around on every draw. Eg see how mpl1.py handles pusing
15+ the paths when the renderer is set (Figure.set_renderer) but on draw
16+ commands (Figure.draw) only pushes the current affine.
1517
16-
17- = transformations =
18+ = Transformations =
1819
1920Support a normal transformation architecture. The current draft
20- implmentation assumes one nonlinear transformation, which happens at a
21- high layer, and all transformations after that are affines. Currently
22- there are three affines: the transformation from view limits -> axes
23- units, the transformation from axes units to normalized figure untis,
24- and the transformation from normalized figure units to display
21+ implementation assumes one nonlinear transformation, which happens at
22+ a high layer, and all transformations after that are affines. In the
23+ mpl1 draft, there are three affines: the transformation from view
24+ limits -> axes units (AxesCoords.affineview), the transformation from
25+ axes units to normalized figure units (AxesCoords.affineaxes), and the
26+ transformation from normalized figure units to display
27+ (Renderer.affine)
2528
2629Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
2730
28- = objects that talk to the backend "primitives" =
31+ = Objects that talk to the backend "primitives" =
2932
3033Have just a few, fairly rich obects, that the backends need to
3134understand. Clear candidates are a Path, Text and Image, but despite
32- some similar names, don't confuse these with the current matplotlib
33- Artists by the same name, which are considerably higher level than
34- what I'm thinking of here. Each of these will carry their metadata,
35- eg a path will carry its stroke color, facecolor, linewidth, etc..
36- Text will carry its font size, color, etc. We may need some
37- optimizations down the road, but start small. For now, let's call
38- these objects "primitives".
35+ similar names, don't confuse these with the current matplotlib Artists
36+ by the same name, which are considerably higher level than what I'm
37+ thinking of here. Each of these will carry their metadata, eg a path
38+ will carry its stroke color, facecolor, linewidth, etc. Text will
39+ carry its font size, color, etc. We may need some optimizations down
40+ the road, but start small. For now, let's call these objects
41+ "primitives".
3942
40- = where do the plot functions live? =
43+ = Where do the plot functions live? =
4144
4245In matplotlib, the plot functions are axes methods and I think there
4346is consensus that this is a poor design. Where should these live,
4447what should they create, etc?
4548
46- = how much of an intermediate artist layer do we need =
49+ = How much of an intermediate artist layer do we need? =
4750
4851Do we want to create high level objects like Circle, Rectangle and
4952Line, each of which manage a Path object under the hood? Probably,
5053for user convenience and general compability with matplotlib. By
5154using traits properly here, these will be thin interfaces around one
52- of our primitives.
55+ of our primitives. I think the whole collections module is poorly
56+ designed, and should be chucked wholesale, if favor of faster, more
57+ elegant, optimizations and special cases. Just having the right Path
58+ object will reduce the need for many of these, eg LineCollection,
59+ PolygonCollection, etc... Also, everything should be numpy enabled,
60+ and the list of python tuples approach that many of the collections
61+ take should be shed.
5362
54- = z -ordering, containers, etc =
63+ = Z -ordering, containers, etc =
5564
5665Peter has been doing a lot of nice work on z-order and layers and
5766stuff like that for chaco, stuff that looks really useful for picking,
5867interactive, etc... We should look at their approach, and think
5968carefully about how this should be handled. Paul may be a good
6069candidate for this, since he has been working on picking.
6170
62- = extension code =
71+ = Extension code =
6372
6473I would like to shed all of the CXX extension code -- it is just too
6574small a nitch of the python world to base our project on. SWIG is
6675pretty clearly the right choice. mpl1 will use numpy for
6776transformations with some carefully chosen extension code where
6877necessary, so this gets rid of _transforms.cpp. I also plan to use
6978the SWIG agg wrapper, so this gets rid of _backend_agg. If we can
70- enhance the SWIG agg wrapper, we can also do images through here.
71- Having a fully featured python agg wrapper will be a plus. But with
72- the agg license change, I'm open to discussion of alternatives.
79+ enhance the SWIG agg wrapper, we can also do images through there.
80+ Having a fully featured python exposed agg wrapper will be a plus.
81+ But with the agg license change, I'm open to discussion of
82+ alternatives.
7383
7484I want to do away with *all* GUI extension code. This should live
75- outside MPL, eg in a toolkit, if we need it. This means someone needs
76- to figure out how to get tk talking to a python buffer or numpy array.
77- Maintaining the GUI extension code across platforms is an unending
78- headache.
85+ outside MPL if at all , eg in a toolkit, if we need it. This means
86+ someone needs to figure out how to get tk talking to a python buffer
87+ object or numpy array. Maintaining the GUI extension code across
88+ platforms is an unending headache.
7989
80- = traits =
90+ = Traits =
8191
8292I think we should make a major committment to traits and use them from
8393the ground up. Without the UI stuff, they add plenty to make them
@@ -86,29 +96,36 @@ the UI (wx only) , they are a major win for GUI developers. Compare
8696the logic for sharing an x-axis in matplotlib transforms with sharex
8797with the approach used in mpl1.py with synch-ed affines.
8898
89- = axis handling =
99+ = Axis handling =
90100
91101The whole conception of the Axes needs to be rethought, in light of
92102the fact that we need to support multiple axis objects on one Axes.
93103The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
94104and we hack two y-axis support with some transform shenanigans via
95- twinx, but the approach is not generalizable and is unweildy .
105+ twinx, but the approach is not generalizable and is unwieldy .
96106
97107This will require a fair amount of thought, but we should aim for
98108supporting an arbitrary number of axis obects, presumably associated
99109with individual artists or primitives, on each Axes. They also need
100110to be *much* faster. matplotlib uses Artists for each tick, tickline,
101- gridline, ticklabel, etc, and this is mind-numbingsly slow.
111+ gridline, ticklabel, etc, and this is mind-numbingsly slow. I have
112+ some proto-type axis implementations that draw all the ticks with a
113+ single path using repeated MOVETO and LINETO, for example, which will
114+ be incomparably faster, than using a separate object from each tick.
102115
103- = breakage =
116+ = Breakage =
104117
105118I think we need to be prepared to break the hell out of matplotlib.
106119The API will basically be a total rewrite. pylab will still mostly
107120work unchanged -- that is the beauty of pylab - though API calls on
108- return obects will probably be badly broken. We'll probably want to
109- install into a new namespace, eg mpl, and envision both matplotlib and
110- mpl co-existing for some time. In fact, mpl might depend on
111- matplotlib for a while (eg until a CXX free ft2font is available)
121+ return obects will probably be badly broken. We can mitigate this
122+ pain if we desire with clever wrapper objects, but once you start
123+ calling methods on return objects, you oin the community of power
124+ users, and this is the community I'm most willing to inconvenience
125+ with breakage. We'll probably want to install into a new namespace,
126+ eg "mpl", and envision both matplotlib and mpl co-existing for some
127+ time. In fact, mpl might depend on matplotlib initially (eg until a
128+ CXX free ft2font is available)
112129
113130We should expect to be supporting and using matplotlib for a long
114131time, since the proposals discussed here imply that it will be a long
@@ -120,25 +137,25 @@ It's a nominal difference so I don't really have a preference.
120137Or we could forget all this wild speculation and resume our normally
121138scheduled lives.
122139
123- = chaco and kiva =
140+ = Chaco and Kiva =
124141
125142It is a good idea for an enterprising developer to take a careful look
126- at tghe current Chaco and Kiva to see if we can further integrate with
143+ at the current Chaco and Kiva to see if we can further integrate with
127144them. I am gun shy because they seem formiddable and complex, and one
128145of my major goals here is to streamline and simplify, but they are
129146incredible pieces of work and we need to carefully consider them,
130147especially as we integrate other parts of the enthought suite into our
131148core, eg traits, increasing the possibility of synergies.
132149
133150
134- = unit handling, custom object types =
151+ = Unit handling, custom object types =
135152
136153There is a legitimate need to be able to feed custom objects into
137154matplotlib. Recent versions of matplotlib support this with a unit
138- registry. A clear use case is plotting with native datetime objects,
139- which is supported in the latest release of matplotlib via the unit
140- handling, which should probably be called "custom object handling and
141- conversion". This is a deep and complicaed subect, involving
142- questions of where the original data live, how they are converted to
143- useful types (arrays of floats) etc. It's worth thinking about as we
144- discuss redesign issues.
155+ registry in the "units" module . A clear use case is plotting with
156+ native datetime objects, which is supported in the latest release of
157+ matplotlib via the unit handling, which should probably be called
158+ "custom object handling and conversion". This is a deep and
159+ complictaed subject, involving questions of where the original data
160+ live, how they are converted to useful types (arrays of floats) etc.
161+ It's worth thinking about as we discuss redesign issues.
0 commit comments