Difference between revisions of "Diagrams"

From HaskellWiki
Jump to navigation Jump to search
Line 7: Line 7:
   
 
== Rewrite ==
 
== Rewrite ==
 
=== Ideas ===
 
   
 
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.
 
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.
Line 15: Line 13:
   
 
A rewrite of diagrams should include separate packages for:
 
A rewrite of diagrams should include separate packages for:
  +
* high-level code
+
=== High-level code ===
** constraint solving
+
* constraint solving
** high-level diagrams
 
* low-level code
+
* high-level diagrams
  +
** graphical primitives
 
  +
=== Low-level code ===
*** text, rectangles, polygons, paths, stars, [http://www.jroller.com/aalmiray/entry/jsilhouette_0_3_released symbols]
 
 
* graphical primitives
*** 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
 
 
** text, rectangles, polygons, paths, stars, [http://www.jroller.com/aalmiray/entry/jsilhouette_0_3_released symbols]
*** boolean operations of paths
 
 
** 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
** graphical attributes
 
 
** boolean operations of paths
*** fill, stroke, arrows, shadow
 
 
* graphical attributes
* input/output backends
 
 
** fill, stroke, arrows, shadow
** pure Haskell SVG loader
 
  +
** interactive painting via Cairo
 
  +
=== Input/Output ===
** pure Haskell PDF conversion via HPDF
 
** pure Haskell PNG conversion via ???
+
* pure Haskell SVG loader
 
* interactive painting via Cairo
** etc.
 
 
* pure Haskell PDF conversion via HPDF
 
* pure Haskell PNG conversion via ???
 
* etc.
   
 
== Inspiration ==
 
== Inspiration ==

Revision as of 12:10, 23 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

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

  • pure Haskell SVG loader
  • interactive painting via Cairo
  • pure Haskell PDF conversion via HPDF
  • pure Haskell PNG conversion via ???
  • etc.

Inspiration

Food for thought

Related non-Haskell projects

Related Haskell projects