Difference between revisions of "Diagrams"

From HaskellWiki
Jump to navigation Jump to search
(→‎Related Haskell projects: those libraries are listed on the Libraries page already)
(add ggplot2)
Line 44: Line 44:
   
 
== Inspiration ==
 
== Inspiration ==
 
=== Food for thought ===
 
 
* [http://www.adobe.com/devnet/pdf/pdf_reference.html PDF reference]
 
* [http://www.w3.org/TR/SVG11/ SVG reference]
 
   
 
=== Related non-Haskell projects ===
 
=== Related non-Haskell projects ===
   
 
* [http://asymptote.sourceforge.net/ Asymptote]
 
* [http://asymptote.sourceforge.net/ Asymptote]
  +
* [http://had.co.nz/ggplot2/ ggplot2]
 
* [http://www.tug.org/metapost.html MetaPost]
 
* [http://www.tug.org/metapost.html MetaPost]
 
* [http://www.texample.net/tikz/examples/ TikZ]
 
* [http://www.texample.net/tikz/examples/ TikZ]
  +
 
=== Food for thought ===
  +
 
* [http://www.adobe.com/devnet/pdf/pdf_reference.html PDF reference]
 
* [http://www.w3.org/TR/SVG11/ SVG reference]

Revision as of 15:31, 26 October 2009

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


Rewrite

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.

A rewrite of diagrams should include separate packages for:

High-level code

  • constraint solving
  • high-level diagrams
    • function plots
    • histograms
    • density diagrams

Low-level code

  • graphical primitives
    • text, rectangles, polygons, paths, stars, symbols
      • imho there should be primitive shape typeclass, so that shapes like circles and rectangles have a "convertToPath" function. Backends like SVG can then choose to convert shapes like a rectangle to a polygon or to a SVG rectangle
    • boolean operations of paths
  • graphical attributes
    • fill, stroke, arrows, shadow

Input/Output

Output

  • interactive drawing via Cairo
  • PDF export via pure HPDF
  • EPS export
  • LaTeX export
  • exotic backends

Input

  • pure Haskell PNG import via pngload
  • pure Haskell SVG import

Inspiration

Related non-Haskell projects

Food for thought