On 03/25/2013 08:20 PM, Brent Yorgey wrote:
> Hmm, can you say a bit about the way it is currently done in dcharts,
> at a high level? Actually, that's not super important, what I'm
> really interested to know is what sorts of operations you want to be
> able to do, regardless of how they are actually accomplished?
In our case we want to give the image a certain structure, e.g.:
title === (chartBody ||| legend)
Then we want to give certain layouting constraints, e.g.:
- the chartBody should take up 80% of the height and 70% of the width
- the complete image should have an aspect ratio of (4 : 3)
- we want to have padding spaces of 2% between the rendered elements and
between the elements and the image edges
There are lots of other kinds of constraints that might make sense in
some situations:
- An element might need to force an aspect ratio (or even size) for
itself.
- An element might need to know its aspect ratio (that was
chosen during layouting) to be able to render itself properly.
(Layouting of course would ideally know the sizes of all elements in
advance leading to cyclic dependencies.)
- Elements may have size minima (or maxima).
I am sure there other constraints you could come up with.
You asked which operations I would like to be able to perform and I am
aware that I didn't answer that question, as I am unsure myself. I hope
I have given some useful insights nonetheless.
(One very special requirement that we had for bubblecharts was this: the
chart itself and the size legend cannot be scaled arbitrarily during
layouting because, well, the sizes of the bubbles in the size legend
have to correspond to the sizes of the bubbles in the chart. But this is
a very special case and I don't expect some generic layouting operations
to account for something like this.)