[rrd-developers] FW: Optional change in graph behavior:--full-size-mode patch

Matthew Chambers matthew.chambers at vanderbilt.edu
Tue May 29 16:22:07 CEST 2007

Thanks Tobi, I hope it's ok if I paste the response back to the list.  It
would be useful for developers who've only worked with 1.2.x to have a brief
summary of what is currently different about the 1.3 trunk.  Has the graph
sizing stuff already been changed from what it was in 1.2.x?

As for code duplication in the patch, in the graph sizing code it's pretty
unavoidable, because the default way of sizing and the full size way use a
different order of calculations.  Ease of code maintenance is not really an
issue because of how different the two methods are in how they calculate the
sizes.  Having one big if-branch to contain the new behavior will probably
improve optimization and running time.  Would it be right to think that that
is a bigger concern for most people?

Now the legend_place code that I duplicated probably wasn't necessary,
there's a lot of ways to do that and keep it in one function.  That would
make it easier to maintain the code for that function, without sacrificing
much performance, if any.

The title sizing thing could be a separate feature with its own command line
option.  Is that what you had in mind?  I warn you though you're running out
of capital letter abbreviations. ;)

-Matt Chambers

> -----Original Message-----
> From: Tobias Oetiker [mailto:tobi at oetiker.ch]
> Sent: Sunday, May 27, 2007 12:14 PM
> To: Matthew Chambers
> Subject: Re: FW: [rrd-developers] Optional change in graph behavior:--
> full-size-mode patch
> Hi Matthew,
> I looked at your patch ... for the 1.2.x series this change is too big ...
> I like the feature though, so if you want to help with 1.3 by
> altering the sizeing code accordingly, I will be glad to
> incoorperate your patch into trunk.
> if you doit in a way so that code does not get duplicated so much,
> this would be even better.
> also the title sizing thing should be a separate feature, not tied
> in the the sizing ...
> note that the 1.3 code re-indented, so it should be easier to read
> ...
> cheers
> tobi
> May 17 Matthew Chambers wrote:
> >
> >
> > -----Original Message-----
> > From: rrd-developers-bounces at lists.oetiker.ch
> > [mailto:rrd-developers-bounces at lists.oetiker.ch] On Behalf Of Matthew
> > Chambers
> > Sent: Monday, May 14, 2007 12:55 PM
> > To: rrd-developers at lists.oetiker.ch
> > Subject: [rrd-developers] Optional change in graph behavior:--full-size-
> mode
> > patch (sorry about the "No topic" last week)
> >
> > I have made changes to the development version of rrdtool?s graph mode
> that
> > introduces a ?--full-size-mode? option which, when enabled, will cause
> the
> > -width and -height parameters to specify the actual size of the output
> > image. B The main graph area is automatically adjusted based on the
> space
> > necessary for the legend, border spacing, graph title, axis labels, and
> the
> > y axis name (and also the pie chart, but does anybody use that?).B
> Without
> > --full-size-mode, the -width and -height parameters control the main
> graph
> > area?s dimensions as usual.B  To do this, I copied a large part of the
> > graph_location() function and modified it, wrapping the new and the old
> code
> > with if/else of the full-size-mode option. B I had to make graph_init()
> call
> > graph_location() before data_proc() because the latter function
> precomputes
> > the data points which wouldn?t be correct if the graph area was changed
> > after that. B The --only-graph option should still work as well. B I?ve
> > updated the documentation and contributors to reflect the new option
> (but I
> > couldn?t find the ?CHANGES? file).B  I made another change in
> > --full-size-mode that won?t apply to the other modes: if the graph title
> is
> > too big to fit within the specified x space, it will be reduced by 1
> point
> > and retested (down to a minimum of size 4) until it does fit.
> >
> > -Matt Chambers
> >
> > SVN diff attached.
> >
> --
> Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
> http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902

More information about the rrd-developers mailing list