]> git.cworth.org Git - acre/log
acre
15 years agoRemove code duplication for X and Y ticks
Carl Worth [Tue, 27 Jan 2009 15:34:23 +0000 (07:34 -0800)]
Remove code duplication for X and Y ticks

I knew this code was repeated, and fortunately it wasn't as hard to
share it as I thought it might be. Adding minor-tick rendering will
be much easier now that this is shared.

15 years agoAccount for space between tick values and frames
Carl Worth [Tue, 27 Jan 2009 15:10:50 +0000 (07:10 -0800)]
Account for space between tick values and frames

With this correctly accounted for the axis labels now have consistent
padding above and below.

15 years agoChange test data to go all the way to 100
Carl Worth [Tue, 27 Jan 2009 08:55:42 +0000 (00:55 -0800)]
Change test data to go all the way to 100

This makes the value 100 appear along the X axis which just looks nicer.

15 years agoLeave sufficient space for Y-axis value labels
Carl Worth [Tue, 27 Jan 2009 08:55:08 +0000 (00:55 -0800)]
Leave sufficient space for Y-axis value labels

Things look much nicer now that the Y-axis label isn't crashing into
the value labels along the Y axis.

15 years agoAdd function to create a pango layout with a printf-style format string
Carl Worth [Tue, 27 Jan 2009 08:30:37 +0000 (00:30 -0800)]
Add function to create a pango layout with a printf-style format string

This eliminates a tiny bit of redundant code now, and then more in
the future.

15 years agoAdd code to cleanup PangoLayout objects when done with them
Carl Worth [Tue, 27 Jan 2009 08:21:19 +0000 (00:21 -0800)]
Add code to cleanup PangoLayout objects when done with them

We're still not even close to being leak free, but this is one
baby step on the way.

15 years agoAdd some value labels next to the ticks.
Carl Worth [Tue, 27 Jan 2009 08:11:35 +0000 (00:11 -0800)]
Add some value labels next to the ticks.

Not yet accounting for these when doing the chart layout, so
we'll still need to fix that obviously.

15 years agoEliminate some code duplication in the tick adjustment phase.
Carl Worth [Tue, 27 Jan 2009 07:23:25 +0000 (23:23 -0800)]
Eliminate some code duplication in the tick adjustment phase.

We were repeating calculations for X and Y that can just happen
once in _expand_range_for_width.

15 years agoFinish adjustment of tick positions for pixel-snapping.
Carl Worth [Tue, 27 Jan 2009 07:17:42 +0000 (23:17 -0800)]
Finish adjustment of tick positions for pixel-snapping.

This is the final step of adjusting the axis ranges so that
the ticks aligne nicely with integer pixel boundaries. Notably
we don't round the ticks at all while drawing them---instead
we only adjust the axis ranges so that when we draw the ticks
at their numerical positions they will look good.

15 years agoCleverly adjust axis ranges for integer tick spacing.
Carl Worth [Sun, 25 Jan 2009 17:30:50 +0000 (04:30 +1100)]
Cleverly adjust axis ranges for integer tick spacing.

This will help avoid one of my major pet peeves with chartting
packages, which is non-pixel-aligned ticks. This is part of
the problem solved, (integer spacing between ticks), but we
still need integer alignment.

15 years agoRemove bogus 0.5 offset when setting up data transform.
Carl Worth [Sun, 25 Jan 2009 16:46:16 +0000 (03:46 +1100)]
Remove bogus 0.5 offset when setting up data transform.

I think my intuition here had been to provide at least some padding
between the frame and data. But we should do that explicitly (and
correctly) rather than just throwing in a 0.5 offset.

15 years agoDraw major ticks along the X and Y axes.
Carl Worth [Sun, 25 Jan 2009 16:40:47 +0000 (03:40 +1100)]
Draw major ticks along the X and Y axes.

Many thanks to Keith Packard for suggesting the math to
normalize and choose a step spacing.

15 years agoAdd preliminary data plotting.
Carl Worth [Sun, 25 Jan 2009 09:42:38 +0000 (20:42 +1100)]
Add preliminary data plotting.

It's all in black for now, with no colors or styles.

Also, we don't yet have ticks nor axis value labels nor a key.

15 years agoPut frame and ticks into its own function as well.
Carl Worth [Sun, 25 Jan 2009 09:03:21 +0000 (20:03 +1100)]
Put frame and ticks into its own function as well.

15 years agoSplit drawing of title and labels into its own function.
Carl Worth [Sun, 25 Jan 2009 08:56:56 +0000 (19:56 +1100)]
Split drawing of title and labels into its own function.

This will make things much more clear as we now add functions
for drawing the chart outline, the ticks, and the data itself.

15 years agoDraw title and axis labels with pango
Carl Worth [Sun, 25 Jan 2009 08:48:28 +0000 (19:48 +1100)]
Draw title and axis labels with pango

Many thanks to Owen and Behdad for all the pango love.

The layout iterates if necessary do to any wrapping from overly long
title or axis labels.

15 years agoAdd preliminary implementation of acre
Carl Worth [Sun, 25 Jan 2009 07:18:49 +0000 (18:18 +1100)]
Add preliminary implementation of acre

This is a simple chart-drawing library using cairo. We will use
this to replace the image-magick and perl-using csv2png script,
(and then also use this to do interactive charts within a GUI).

15 years agoCreate README file
Carl Worth [Thu, 16 Apr 2009 18:32:06 +0000 (11:32 -0700)]
Create README file

Just need an initial commit to boostrap this repository.