Personal tools

Diagrams

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (Core DSL)
Line 14: Line 14:
 
*** segments
 
*** segments
 
**** moveTo, lineTo, cubic bezier, quadratic bezier, arcTo
 
**** moveTo, lineTo, cubic bezier, quadratic bezier, arcTo
*** approximation
 
 
*** inset, outset
 
*** inset, outset
 
*** boolean operations
 
*** boolean operations
Line 53: Line 52:
   
 
=== Modules/Extensions ===
 
=== Modules/Extensions ===
+
* paths
  +
*** approximation (autotrace)
 
* shapes and symbols
 
* 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]
 
** stars, [http://local.wasp.uwa.edu.au/~pbourke/geometry/supershape/ supershape], [http://www.jroller.com/aalmiray/entry/jsilhouette_0_3_released symbols]

Revision as of 09:36, 29 October 2009

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


Contents

1 Rewrite

1.1 Core DSL

  • graphical primitives
    • path
      • segments
        • moveTo, lineTo, cubic bezier, quadratic bezier, arcTo
      • inset, outset
      • boolean operations
      • morphing
    • 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

1.2 Modules/Extensions

  • paths
      • approximation (autotrace)
  • shapes and symbols
  • diagrams
    • histograms, density plots

1.3 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.

1.3.1 Output

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

1.3.2 Input

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

2 Inspiration

2.1 Related non-Haskell projects

2.2 Food for thought