JS API: coming soon
@defsquare/datagraph
The Pixi.js renderer: the interactive canvas, embeddable in a page.
createDataGraph(container, options) mounts the graph and returns a handle — setData, setView, search, select, focus, fit, tidy, stats, destroy — plus events for selection and lifecycle. options.config is the same ids / refs / groups object the CLI takes with -c, and options.view picks the starting view. Themes are exported alongside it, derived from the design tokens.
Source and README: packages/renderer.
@defsquare/datagraph-core
The headless half, with no rendering dependency and no DOM: buildGraph turns arbitrary JSON plus a config into a graph, CollapseState tracks what is expanded, buildSearchIndex indexes it, and createStructureLayoutEngine lays it out through elkjs.
This is the package to reach for when you want the model without the canvas — an audit, a transformation, a validation step of your own. It is also what the binary’s --check runs, bundled and evaluated headlessly.
Source and README: packages/core.
Until then
The desktop binary is the supported way to use datagraph.