Diagrams

From HaskellWiki
Revision as of 09:37, 29 October 2009 by Lenny222 (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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


Rewrite

Core DSL

  • graphical primitives
    • path
      • segments
        • moveTo, lineTo, cubic bezier, quadratic bezier, arcTo
    • text
      • convertToPath
    • circle
      • convertToPath
    • ellipse
      • convertToPath
    • rectangle
      • convertToPath
    • polygon
      • convertToPath
    • polyline
      • 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)
  • shapes and 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 HPDF
  • EPS export
  • SWF export
  • LaTeX export
  • exotic backends

Input

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

Inspiration

Related non-Haskell projects

Food for thought