Personal tools

Diagrams

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Related non-Haskell projects)
(cleanup)
Line 5: Line 5:
 
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/diagrams HackageDB]
 
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/diagrams HackageDB]
   
 
== Rewrite ==
 
 
=== Core DSL ===
 
 
==== Style ====
 
Do we either want
 
 
<code>
 
yellowCircle x y radius = yellowFill $ circleShape x y radius
 
</code>
 
 
or
 
 
<code>
 
drawYellowCircle x y radius = do $
 
setFill yellow
 
drawCircle x y radius
 
</code>
 
?
 
 
The first version allows better reuse and functional composition.
 
 
==== Elements ====
 
* graphical primitives
 
** path
 
*** boundingBox
 
*** moveTo, lineTo, cubic bezier, quadratic bezier, arcTo
 
** text
 
*** boundingBox
 
*** convertToPath
 
** circle
 
*** boundingBox
 
*** convertToPath
 
** ellipse
 
*** boundingBox
 
*** convertToPath
 
** rectangle
 
*** boundingBox
 
*** convertToPath
 
** polygon
 
*** boundingBox
 
*** convertToPath
 
** polyline
 
*** boundingBox
 
*** convertToPath
 
* graphical attributes
 
** fill
 
*** paint
 
**** solid color, gradient, pattern
 
*** fill rule
 
**** evenOdd, nonZero
 
** stroke
 
*** paint
 
**** solid color, gradient, pattern
 
*** width
 
*** line cap
 
*** line join
 
*** miter limit
 
*** dash
 
**** offset
 
**** array
 
** marker symbols
 
** effects
 
*** shadow, blur, turbulence
 
* constraint solving
 
* animations/pages/frames
 
 
 
 
=== Modules/Extensions ===
 
 
==== Paths ====
 
* inset, outset
 
* boolean operations
 
* morphing
 
* approximation (autotrace)
 
 
See
 
* http://lib2geom.sourceforge.net/
 
* http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/live_effects/
 
 
==== Shapes and symbols ====
 
* stars, [http://local.wasp.uwa.edu.au/~pbourke/geometry/supershape/ supershape], [http://www.jroller.com/aalmiray/entry/jsilhouette_0_3_released symbols]
 
* diagrams
 
** histograms, density plots
 
 
=== Input/Output ===
 
 
Many Haskell graphic libraries are tied to a specific rendering backend (Cairo, OpenGL, libGD etc) which makes collaboration and reuse of code and data structures very hard or impossible.
 
 
Also some dependencies are hard to fulfill. Cairo is very difficult to install on Mac OS 10.6. If you just need to generate PDF diagrams, you could choose the pure HPDF library where e.g. Hieroglyph can not be installed because of its Cairo dependence.
 
 
==== Output ====
 
* interactive drawing via Cairo
 
* PDF export via pure [http://hackage.haskell.org/package/HPDF HPDF]
 
* EPS export
 
* SWF export
 
* LaTeX export
 
* exotic backends
 
** generate Java2d or [http://www.processing.org/ Processing] source code
 
 
==== Input ====
 
* pure Haskell PNG import via [http://hackage.haskell.org/package/pngload pngload]
 
* pure Haskell SVG import
 
   
 
== Inspiration ==
 
== Inspiration ==
Line 128: Line 23:
   
 
* [http://www.adobe.com/devnet/pdf/pdf_reference.html PDF reference]
 
* [http://www.adobe.com/devnet/pdf/pdf_reference.html PDF reference]
  +
* [http://local.wasp.uwa.edu.au/~pbourke/geometry/supershape/ supershape]
  +
* [http://www.jroller.com/aalmiray/entry/jsilhouette_0_3_released symbols]
 
* [http://www.w3.org/TR/SVG11/ SVG reference]
 
* [http://www.w3.org/TR/SVG11/ SVG reference]
 
* [http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v10.pdf SWF reference]
 
* [http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v10.pdf SWF reference]

Revision as of 06:42, 26 May 2010

The diagrams library provides an embedded domain-specific language (EDSL) for creating simple pictures and diagrams in Haskell


1 Inspiration

1.1 Related non-Haskell projects

1.2 Food for thought