Skip to content

The JavaScript library for dynamic SVGs, crafting expressive generative art and visualization with minimal effort.

License

Notifications You must be signed in to change notification settings

charming-art/charming

Repository files navigation

Charming

Note

The current next branch is implementing the new proposal API for production use. Please refer to the main branch for the current release.

The JavaScript library for reactive SVG manipulation.

import {shape, reactive, $} from "charmingjs";

const [scope] = reactive().let("x", 0).join();

requestAnimationFrame(animate);

function animate() {
  scope.x = Math.abs(Math.sin(Date.now() / 1000)) * 200;
  requestAnimationFrame(animate);
}

const svg = shape.svg({width: 200, height: 50}, [
  shape.circle({
    cx: $(() => scope.x),
    cy: 25,
    r: 20,
  }),
]);

document.body.append(svg);

Resources 📚

License 📄

MIT@Bairui SU

About

The JavaScript library for dynamic SVGs, crafting expressive generative art and visualization with minimal effort.

Topics

Resources

License

Stars

Watchers

Forks