[Chart] A bunch of features and fixes.
Tim Docker
tim at dockerz.net
Tue Jan 31 12:04:51 GMT 2012
Thanks - I'll work my way though looking at these. I've started with the
sparkline stuff. It looks fine (and useful). Two comments:
1) field names in the SparkLine and SparkOption structures. As you would
have no doubt noticed, I add a prefix to all public structure to avoid
naming overlaps. Hence, I'd expect to see something like:
data SparkLine = SparkLine { sl_options :: SparkOptions
, sl_data :: [Double]
}
-- | Options to render the sparklines in different ways.
data SparkOptions = SparkOptions
{so_ smooth :: Bool -- ^ smooth or bars
, so_step :: Int -- ^ step size
, so_height :: Int -- ^ graph height (pixels)
, so_limits :: (Double,Double) -- ^ data point limits
, so_bgColor :: Colour Double -- ^ background color
, so_minColor :: Colour Double -- ^ color of minimum datapoint
, so_maxColor :: Colour Double -- ^ color of maximum datapoint
, so_lastColor :: Colour Double -- ^ color of last datapoint
, so_minMarker :: Bool -- ^ display minimum marker
, so_maxMarker :: Bool -- ^ display maximum marker
, so_lastMarker :: Bool -- ^ display last marker
} deriving (Show)
I concede this could be seen as ugly, but I think is necessary to work
around the haskell record field label limitations. The _ separating the
type abbreviation from the field name is the only place in names when I
use _, and hence it's become a useful syntactic marker to me.
What are your thoughts?
2) I added an exported sparkSize function (I needed it in adding your
test to the all tests structure).
Cheers,
Tim
On 31/01/12 06:27, Malcolm Wallace wrote:
> Hi Chart people,
>
> I attach a (largish) bundle of patches which contains a bunch of new features and fixes. Happy to hear discussion about any of the issues raised.
>
> * New API stackLayout1sVertically. We had a discussion about this about a year ago: it differs from renderLayout1sStacked in some important respects, and neither can be implemented purely in terms of the other.
>
> * Allow axes to be drawn in the middle of plot (e.g. at (0,0)), not just at the edges. We also had a brief discussion about this one a whole ago. Tim was in favour of making these central axes qualitatively different, rather than reusing/moving the bottom and left axes, but I have not had the chance to do that.
>
> * Allow axis tick labels to be rotated by an arbitrary angle.
>
> * Sparklines.
>
> * Multibars - allows arbitrarily clustered+stacked combinations of PlotBars.
>
> * Bugfixes: two incomplete pattern-match crashes.
>
>
>
>
> _______________________________________________
> Chart mailing list
> Chart at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/chart/attachments/20120131/ea8d11fb/attachment.htm>
More information about the Chart
mailing list