Re: graphing in gnumeric

On Mon, Apr 28, 2003 at 10:38:02AM -0700, William Skaggs wrote:

It turns out, incidentally, that rendering is only a small part of
the work in plotting, and can be isolated from the rest.
Generally, about 2/3 of the effort goes into setting up the
interactions that allow users to contol the type and shape of the
plots.  It might be useful to give some thought to a specification
of the types of plots that gnumeric wants and the aspects of them
that users should be able to control.  (Maybe there is a sort of
implicit specification in the things that guppi was able to do in
the previous incarnation of gnumeric, but I'm not familiar with it.)

Definitely.  There are several subsystems that divide up nicely.
I've focused on the management of the plots and assignment of data.
Plot types can be specified in plugins and demand loaded.  They are
specified partially in xml for descriptive content, and partially in
the derived Plot classes themselves for specification of
dimensionality and axis requirements.

    <Family _name="Pie"         sample_image_file="pie.xpm"/>
    <Family _name="Ring"        sample_image_file="doughnut.xpm"/>

    <Type _name="Pie" row="1" col="1"
          engine="GOPlotPie" family="Pie"
          _description="Percentage of each contributor."
    <Type _name="Split Pie" row="2" col="1"
          engine="GOPlotPie" family="Pie"
          _description="Percentage of each contributor with wedges split apart."
        <property name="default_separation">.20</property>

                static GOPlotDimDesc dimensions[] = {
                        { N_("Labels"), TRUE,  FALSE, GO_GRAPH_DIM_LABEL,
                          GO_GRAPH_AXIS_NONE, GO_GRAPH_MS_DIM_LABELS },
                        { N_("Values"), FALSE, FALSE, GO_GRAPH_DIM_VALUE,
                          GO_GRAPH_AXIS_NONE, GO_GRAPH_MS_DIM_VALUES }
                plot_klass->desc.series.dim = dimensions;
                plot_klass->desc.series.num_dim = G_N_ELEMENTS(dimensions);
        plot_klass->desc.num_axis = 0;
        plot_klass->desc.num_series_min = plot_klass->desc.num_series_max = 1;

There are even a few cheater hooks thrown in to facilitate import
from xls.

The ugly gdk based graphics, and the fact that I haven't hooked up
the style/theming code yet makes me hesitant to display screen shots
yet.  If things hold up under the stress of adding ring plots (pies
with series and a shared dimension), and simple scatter plots (to
exercise axis) we should be in good shape to add other forms fairly

To date there has not been alot of discussion of which types of
plots Gnumeric needs.  The simple answer is 'all'.  However, I'd
rather see a strong framework that supports a few types well in this
initial pass.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]