Skip to content

API Index ​

Charming offers a declarative language for drawing shapes from data on Canvas, WebGL and the terminal, and a set of helpers for working with SVG, Canvas, HTML and text directly. They can be used together or independently.

Charming Core ​

Drawing shapes from data.

Charming Flow ​

Bind data to shapes and render them.

Charming Shape ​

Shapes to append to flows.

Charming Process ​

Prepare data before appending shapes.

  • cm.each — call a function for each datum.
  • cm.eachRight — like each, from the last datum to the first.
  • cm.filter — keep the matching data.
  • cm.map — map each datum to a new one.
  • cm.push — append a datum to each group.
  • cm.derive — add fields to copies of the data.

Charming Transform ​

Derive attribute values after appending shapes.

Charming Scale ​

Map abstract values to visual values.

Charming WebGL ​

Draw many shapes with WebGL.

  • cm.webgl — create a WebGL renderer.
  • cm.glsl — define an attribute as a GLSL function.

Charming Terminal ​

Draw ASCII art.

Charming DOM ​

Create and manipulate DOM elements.

  • cm.svg — SVG via tagged template literal.
  • cm.html — HTML via tagged template literal.
  • cm.attr — get, set, or remove attributes (including styles and events) on a node.

Charming Canvas ​

Set up a 2D canvas and draw shapes.

Charming Path ​

Build SVG path strings for common shapes.

Charming Pretext ​

Text measurement and path-bound layout on top of Pretext.

Charming Vector ​

2D vectors for simulating physical laws.

Charming Noise ​

Smooth random values for computational art.

  • cm.noise — smooth, continuous random values (Perlin noise).