Key difference from the minimal embed:
The dropdown below is rendered inside the onaViz() component — it can access availableViz and call switchViz() directly.
Loading…
Loading graph…
Hover · Click · Scroll to zoom

How to embed

Pass the VizSpec ID to onaViz(). The engine fetches the spec and graph data automatically. Use switchViz(id) to swap specs without a page reload.

API calls made

On every viz load, the engine calls:

api.php?action=viz&id={id}

api.php?action=load&dataset={dataset}

The first returns the VizSpec + list of available vizspecs for this dataset. The second returns the full graph JSON (nodes + edges).

Architecture

VizSpecs are stored in
dataset/{id}/viz-*.json

To add a new view, add a new viz-*.json file. It appears in the switcher automatically. No engine change required.

Example vizspec format

  • BA_medium/viz-defaultDefault View

VizSpec IDs follow the format dataset_id/viz-id. Create multiple views by adding JSON files to dataset/{id}/viz-*.json.

What to try: