Diagrams
From HaskellWiki
(Difference between revisions)
(boundingBox) |
(→Core DSL: which style?) |
||
| Line 10: | Line 10: | ||
=== Core DSL === | === Core DSL === | ||
| + | ==== Style ==== | ||
| + | Do we want | ||
| + | <code> | ||
| + | yellowCircle x y radius = yellowFill $ circleShape x y radius | ||
| + | </code> | ||
| + | |||
| + | or | ||
| + | |||
| + | <code> | ||
| + | yellowCircle x y radius = do $ | ||
| + | setFill yellow | ||
| + | drawCircel x y radius | ||
| + | </code> | ||
| + | ? | ||
| + | |||
| + | ==== Elements ==== | ||
* graphical primitives | * graphical primitives | ||
** path | ** path | ||
Revision as of 11:35, 11 November 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
1.1.1 Style
Do we want
yellowCircle x y radius = yellowFill $ circleShape x y radius
or
yellowCircle x y radius = do $
setFill yellow drawCircel x y radius
?
1.1.2 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
- path
- graphical attributes
- fill
- paint
- solid color, gradient, pattern
- fill rule
- evenOdd, nonZero
- paint
- stroke
- paint
- solid color, gradient, pattern
- width
- line cap
- line join
- miter limit
- dash
- offset
- array
- paint
- marker symbols
- effects
- shadow, blur, turbulence
- fill
- constraint solving
- animations/pages/frames
1.2 Modules/Extensions
1.2.1 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/
1.2.2 Shapes and symbols
- stars, supershape, 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
- generate Java2d or Processing source code
1.3.2 Input
- pure Haskell PNG import via pngload
- pure Haskell SVG import
