|
From: Joerg L. <jo...@us...> - 2004-07-22 15:49:27
|
Hi André,
On 22.07.04, Andre Wobst wrote:
> On 22.07.04, Joerg Lehmann wrote:
[...snip...]
> > Btw, we could also introduce a new style method which is responsible for
> > returning the return value, when called with the corresponding sharedata
> > and privatedata objects.
>
> This is too complicated for the user. You need the
> sharedata/privatedatalist from a given plot command and put it into
> the styles to recieve some information. Hmmm. I don't see any
> advantage of this quite complicated way to extract information.
You misunderstood me. I did not mean that the user should call this
function, but I was just suggesting that the style handles the return
value separately, i.e., not in the function donedrawpoints. But this
is not so important at all.
> First I thought it would be a bad idea to return something else than
> the data instance at the plot command (because its like what we do in
> canvas.insert etc.). On the other hand, the data is not -- *never* --
> bound tightly to the graph. It contains no information about what's
> plotted. (Currently, it does, because sharedata and privatedatalist is
> storred in the data instance, but thats a misfeature we will resolve
> in the future. Once we did, there seems to be no reason at all, why a
> data instance does not contain any information about the output
> created. In the future I don't see any reason, why the data would need
> a container like privatedata/sharedata/styledata. It does not have to
> store anything related to the graph.)
I'm getting confused...
> Hence I think it would be good to allow the styles to return something
> related to the stuff actually drawn. The only remaining question is,
> whether this fancy_return is the right thing to do. I'm still not
> satisfied. In some sense it makes sense to make the finish process
> visible. Back to #2: Explicit is better than implicit. What about
> something along the lines:
>
> pd = graph.plot(data(...), [graph.style.line()])
>
> p = pd.finish()
I do not like this idea. Why should one finish the plot data? This
sounds very strange to me. However, I could imagine a
p = pd.getX()
with X={styleinfo,styledata,...} whathever you like.
> where pd are the "plot data" and p is the path. Its more or less back
> to what we had in the sense, that we have this plot data construct,
> which takes care about the graph instance needed, the data and styles
> in use, the return values, the finishing process etc. Still, the
> styles should be responsible to create the return value(s). In the
> first we only need to return the path when creating a line. The plot
> data instances will have a finish method only, which will take care of
> the internals and return the draw results from the styles. And that's
> it. I think that's probably ok. Its not that complicated and its quite
> explicit.
As I said above, I do not like the name at all. And I also don't see
a problem in returning something from the plot command which will
only be populated with data later, namely when the graph has been
finished.
Jörg
|