[Chart] Bezier smoothing

Tim Docker tim at dockerz.net
Tue Apr 8 13:57:13 BST 2014


The geometry API of diagrams is appealing. However its currently 10 times
slower to draw charts via Cairo and diagrams, as it is to use Cairo
directly. I don't know how much of this is due to the geometry abstraction.

Also even if the speed issue were resolved, it would be a fair bit of
effort just to port the code.

Tim
On 8 Apr 2014 11:32, "Kai Zhang" <kai at kzhang.org> wrote:

> I have a question: why not deprecate Graphics.Rendering.Chart.Geometry and
> Graphics.Rendering.Chart.Drawing, and simply use the API of Diagram. Then
> we would have all the nice features of Diagram. It seems to me that some
> codes in Chart are doing the same thing as that in Diagram. I may be wrong.
>
>
> On Mon, Apr 7, 2014 at 3:51 PM, Tim Docker <tim at dockerz.net> wrote:
>
>> That makes sense - I'd still follow the steps below but add;
>>
>> 4) add a library function to construct a path of bezier segments given
>> the open/closed spline. This could either call Diagrams.CubicSpline
>> directly, or it might be preferable to take a copy of the algorithm, to
>> avoid having the chart library core depend on diagrams and all its deps.
>>
>> Tim
>> On 8 Apr 2014 02:07, "Sacha Sokoloski" <sacha404 at gmail.com> wrote:
>>
>>> So as I found out, there's a difference between being able to draw a
>>> bezier curve, and being able to calculate/interpolate a bezier spline.
>>> Diagrams exposes an algorithm for calculating the spline here:
>>>
>>> http://hackage.haskell.org/package/diagrams-lib-1.1.0.4/
>>> docs/Diagrams-CubicSpline.html
>>>
>>> It probably wouldn't be too hard to get it working, but for some reason
>>> I'm hoping someone else will do it. At some point I'll probably get around
>>> to implementing a solution myself, but my current work doesn't involve
>>> contour plots, so it's not a priority for me.
>>>
>>> On 05/04/14 01:00 PM, chart-request at projects.haskell.org wrote:
>>>
>>>> Hi.
>>>>
>>>> For this I think you would need to:
>>>>
>>>> 1) extend the abstract back end to support a bezier segment in paths
>>>>
>>>> 2) implement this in both the Cairo and diagrams renderers - with some
>>>> tests
>>>>
>>>> 3) make use of the bezier segments in your new contour plots.
>>>>
>>>> However - looking back to the thread where you raised this before, it
>>>> sounded like the Cairo beziers didnt meet your needs. Did you resolve
>>>> this?
>>>>
>>>
>>>
>>> _______________________________________________
>>> Chart mailing list
>>> Chart at projects.haskell.org
>>> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart
>>>
>>
>> _______________________________________________
>> 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/20140408/7ddc96fd/attachment.htm>


More information about the Chart mailing list