|
| 1 | +Here are some of the things I would like to accomplish with mpl1. Any |
| 2 | +and all of this is open to discussion. What I present below is pretty |
| 3 | +ambitious, so if there is support, we will need significant |
| 4 | +contributions from several developers for several months. Ideally, we |
| 5 | +would get a good sketch working, and then organize a spint (4 days?) |
| 6 | +for late August, where we try get as far as possible to making this |
| 7 | +viable. |
| 8 | + |
| 9 | += data copying = |
| 10 | + |
| 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 |
| 13 | +every draw. This is potentially a major win, because we currently |
| 14 | +move the data around on every draw |
| 15 | + |
| 16 | + |
| 17 | += transformations = |
| 18 | + |
| 19 | +Support 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 two 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 |
| 25 | + |
| 26 | +do we want to use 3x3 or 4x4 to leave the door open for 3D developers? |
| 27 | + |
| 28 | += objects that talk to the backend "primitives" = |
| 29 | + |
| 30 | +Have just a few, fairly rich obects the backends need to understand. |
| 31 | +clear candidates are a Path, Text and Image. Each of these will carry |
| 32 | +their metadata, eg a path will carry its stroke color, facecolor, |
| 33 | +linewidth, etc.. Text will carry its font size, color, etc. We may |
| 34 | +need some optimizations down the road, but start small. For now, |
| 35 | +let's call these objects primitives |
| 36 | + |
| 37 | += where do the plot functions live? = |
| 38 | + |
| 39 | +In matplotlib, the plot functions are axes methods and this is a poor |
| 40 | +design. Where should these live, what should they create, etc? |
| 41 | + |
| 42 | += how much of an intermediate artist layer do we need = |
| 43 | + |
| 44 | +Do we want to create high level objects like Circle, Rectangle and |
| 45 | +Line, each of which manage a Path object under the hood? Probably. |
| 46 | +By using traits properly here, these will be thin interfaces around |
| 47 | +one of our primitives. |
| 48 | + |
| 49 | += z-ordering, containers, etc = |
| 50 | + |
| 51 | +Peter has been doing a lot of nice work on z-order and layers and |
| 52 | +stuff like that for chaco, stuff that looks really useful for picking, |
| 53 | +interactive, etc... We should look at their approach, and think |
| 54 | +carefully about how this should be handled. Paul is a good candidate |
| 55 | +for this. |
| 56 | + |
| 57 | += extension code = |
| 58 | + |
| 59 | +I would like to shed all of the CXX extension code -- it is just too |
| 60 | +small a nitch of the python world to base our proect on. SWIG is |
| 61 | +pretty clearly the right choice. mpl1 will use numpy for |
| 62 | +transformations with some carefully chosen extension code where |
| 63 | +necessary, so this gets rid of _transforms.cpp. I also plan to use |
| 64 | +the SWIG agg wrapper, so this gets rid of _backend_agg. If we can |
| 65 | +enhance the SWIG agg wrapper, we can also do images through here. |
| 66 | +Having a fully featured python agg wrapper will be a plus. But with |
| 67 | +the agg license change, I'm open to discussion of alternatives. |
| 68 | + |
| 69 | +I want to do away with *all* GUI extension code. This should live |
| 70 | +outside MPL, eg in a toolkit, if we need it. This means someone |
| 71 | +(Michael is probably a good choice) needs to figure out how to get tk |
| 72 | +talking to a python buffer or numpy array. Maintaining the GUI |
| 73 | +extension code is a drag. |
| 74 | + |
| 75 | += traits = |
| 76 | + |
| 77 | +I think we should make a major committment to traits and use them from |
| 78 | +the ground up. w/o the UI stuff, they add plenty to make them |
| 79 | +worthwhile. With the UI (wx only) , they are a major win for GUI |
| 80 | +developers. |
| 81 | + |
| 82 | += axis handling = |
| 83 | + |
| 84 | +The whole conception of the Axes needs to be reworked, in light of the |
| 85 | +fact that we need to support multiple axis objects on one Axes. This |
| 86 | +will require a fair amount of thought, but we should aim for |
| 87 | +supporting an arbitrary number of axis obects, presumably associated |
| 88 | +with individual artists or primitives, on each Axes. They also need |
| 89 | +to be *much* faster. matplotlib uses Artists for each tick, tickline, |
| 90 | +gridline, ticklabel, etc, and this is mind-numbingsly slow. |
| 91 | + |
| 92 | += breakage = |
| 93 | + |
| 94 | +I think we need to be prepared to break the hell out of this thing. |
| 95 | +The API will basically be a total rewrite. pylab will still mostly |
| 96 | +work unchanged -- that is the beauty of pylab. We'll probably want to |
| 97 | +install into a new namespace, eg mpl, and envision both matplotlib and |
| 98 | +mpl co-existing for some time. In fact, mpl might depend on |
| 99 | +matplotlib for a while (eg until a CXX free ft2font is available) |
| 100 | + |
| 101 | +We should expect to be supporting and using matplotlib for a long |
| 102 | +time, since the proposals discussed here imply that it will be a long |
| 103 | +wait until mpl1 is feature complete with matplotlib. In fact, we could |
| 104 | +rightly consider this to be the mpl2 proposal, and keep releaseing |
| 105 | +matplotlib ehancements to 1.0 and beyond w/o signfificant breakage. |
| 106 | +It's a nominal difference so I don't really have a preference. |
| 107 | + |
| 108 | += chaco and kiva = |
| 109 | + |
| 110 | +This is probably a good idea for an enterprising developer to take a |
| 111 | +careful look at Chaco and Kiva to see if we can integrate with them. |
| 112 | +I am gunshy because they seem formiddable and complex, and one of my |
| 113 | +maor goals here is to streamline and simplify, but they are incredible |
| 114 | +pieces of work and we need to consider them, especially if we |
| 115 | +integrate other parts of the enthought suite into our core, eg traits |
| 116 | + |
0 commit comments