Published-release documentation · release compatibility
Runtime and Browser Compatibility
ggaction is an ESM-only package. The supported Node.js floor is 20. Continuous integration installs and tests the packed package on Node.js 20, 22, and 24; documentation interaction tests run in Playwright Chromium. Library renderer compatibility additionally exercises representative scenes in Chromium, Firefox, and WebKit. These checks do not guarantee every browser version or font configuration; see Rendering.
Entry points
| Import | Environment | Notes |
|---|---|---|
ggaction |
Modern browser bundler or Node.js 20+ | Complete chart authoring and Browser Canvas rendering |
ggaction/basic |
Modern browser bundler | Smaller creation-focused chart surface |
ggaction/svg |
Browser or Node.js 20+ | DOM-free SVG string serialization |
ggaction/png |
Node.js 20+ | Native PNG file output; do not place in a browser bundle |
ggaction/pdf |
Node.js 20+ | Native single-page PDF file output; do not place in a browser bundle |
ggaction/extension |
Browser bundler or Node.js 20+ | Extension registration and authoring primitives |
ggaction/persistence |
Browser or Node.js 20+ | Save and restore editable programs or render-only snapshots |
ggaction/accessibility |
Browser or Node.js 20+ | Read visual data for accessible tables and descriptions |
ggaction/inspection |
Browser or Node.js 20+ | Inspect schemas, applicability, changes, and concrete results |
ggaction/diagnostics |
Browser or Node.js 20+ | Read structured error details |
ggaction/scene |
Browser or Node.js 20+ | Read transition scenes and draw native Canvas scenes |
CommonJS require("ggaction") is not a supported entry. Use ESM source files
or configure the consuming project for ESM.
{
"type": "module",
"engines": { "node": ">=20" }
}
import { chart, render } from "ggaction";
import { renderToSVG } from "ggaction/svg";
Browser applications
Vite is the documented getting-started path and the installed browser consumer
is tested with a real Chromium page. Obtain a 2D rendering context only after
the Canvas exists in the DOM. Chart authoring itself does not require a DOM;
render needs a compatible Canvas 2D context supplied by the host.
Framework components should keep caller-owned rows outside the program, build
a new immutable program when relevant inputs change, render after the host
element mounts, and disconnect ResizeObserver or other host listeners during
cleanup. See Responsive charts for the lifecycle.
Do not import ggaction/png or ggaction/pdf into client code. Route those
exports to a Node worker, server action, build step, or command-line process.
ggaction/svg is the portable choice when a browser needs scalable markup.
Server rendering
Node can author programs and serialize SVG without a browser. PNG and PDF
write to explicit filesystem paths and create missing output directories.
Browser Canvas rendering requires a browser-provided
CanvasRenderingContext2D; it is not an SSR target.
Native renderer installation follows the platform support of the exact
@napi-rs/canvas dependency selected by npm. Qualify the packed application on
every deployment architecture instead of assuming that one local native build
represents all targets.
Compatibility checklist
- Confirm
node --versionis 20 or newer for Node entry points. - Confirm the project uses ESM and resolves package exports without a CommonJS compatibility transform.
- Keep Node-only renderer imports out of browser dependency graphs.
- Run one packed-package smoke test in each deployment runtime and one visual test in each browser the product promises to support.
- Verify fonts and text bounds on every target platform because system font availability can change glyph metrics.
Related
Getting Started · TypeScript · Rendering · Fonts and text
Documentation provenance
293 actions · sha256:e755591a2e5f5e2b494867583876e28020a478c5220b77bdc6ad469a6224891d