macaw_draw
This software is a very early release, and not ready for general use.
Public home: github.com/dcoai/macaw_draw · Docs: hexdocs.pm
The drawing library of the Macaw family, Macaw.Draw: pure functions that turn numbers, times, points, hierarchies and geometry into a scene, and a scene into SVG, canvas commands, a binary canvas stream or a PNG (spec/00). It depends on macaw_base, macaw_layers, macaw_units and macaw_format only, so an application draws (a chart image on a server, a printout) with no data layer, component or Phoenix. macaw_frame's Frame is built on it (dco-tek/macaw/macaw#478).
| Namespace | What it is |
|---|---|
Macaw.Draw.Scale, Ticks, Axis, Format, Quantity | scales of every kind, d3's tick rule, axes as scene elements, tick formats, quantity display (spec/06) |
Macaw.Draw.Shape, Interpolate, Ease, Text, Polygon, Random, Units, SVG, Generators | lines, areas, arcs, symbols, bands and curves; interpolators, easing, text width, polygon measures, seeded variates, lengths, a plain SVG builder (spec/07) |
Macaw.Draw.Layout | trees, treemaps, packs, partitions, force, sankey, chord, hexbin and the diagram layouts (spec/08) |
Macaw.Draw.Geo, Contour | projections, clipping, paths, tiles, the viewport, Delaunay, Voronoi, contours and density (spec/09) |
Macaw.Draw.IR, Render | the scene and its renderers: SVG, canvas commands, the binary and incremental canvas, motion, keyed segments, the raster through resvg (spec/10) |
Every public function answers a value, {:ok, value} or {:error, faults}, for any input; only a ! twin raises, Macaw.Draw.Error. The raster target runs a resvg binary named by its :resvg option or found on the PATH, and draws with the bundled DejaVu Sans faces.
Installation
Four runtime dependencies, macaw_base, macaw_layers, macaw_units and macaw_format. From Hex:
{:macaw_draw, "~> 0.1.0"}Part of Macaw.
License
MIT; see the LICENSE file. The bundled DejaVu faces are under the Bitstream Vera license with DejaVu's changes in the public domain; see priv/fonts/LICENSE.