kitizz / nutmeg

A multiplatform, multilingual plotting tool. It's lightweight and asynchronous, and figure layouts are defined declaratively using QML.
GNU General Public License v3.0
21 stars 4 forks source link

Modularise Nutmeg's drawing of shapes #39

Open kitizz opened 10 years ago

kitizz commented 10 years ago

Currently, for something like LinePlot, it has an associated LineCanvas. LineCanvas assumes that its parent is a LinePlot and extracts the data it requires by accessing the LinePlot's properties.

A better architecture would be for the Canvas to have the properties of the things it can draw. For example, LineCanvas would have xData and yData properties. These properties are then bound at the QML side.

This then allows for a nice way to "construct" different types of plots. For example, a BarGraphPlot may have a RectangleCanvas and a TextCanvas (for labels).

Related to #40

kitizz commented 8 years ago

This has been implemented by CanvasPlot. But it would be nice to have "models" as well. Where a set of line segments are drawn based on four array properties: x1, y1, x2, y2. This requires some thought...