The Macaw logo, a scarlet macaw in flight

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

NamespaceWhat it is
Macaw.Draw.Scale, Ticks, Axis, Format, Quantityscales 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, Generatorslines, areas, arcs, symbols, bands and curves; interpolators, easing, text width, polygon measures, seeded variates, lengths, a plain SVG builder (spec/07)
Macaw.Draw.Layouttrees, treemaps, packs, partitions, force, sankey, chord, hexbin and the diagram layouts (spec/08)
Macaw.Draw.Geo, Contourprojections, clipping, paths, tiles, the viewport, Delaunay, Voronoi, contours and density (spec/09)
Macaw.Draw.IR, Renderthe 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.