();
return (
a.slug}
getTags={(a) => a.tags}
getLabel={(a) => a.title}
preset="glyphs"
theme="dark"
clusteringStrategy={createSoftSimplexTagClusteringStrategy({ triangleSpread: 0.45 })}
layoutStrategy={createCollisionDrivenLayoutStrategy()}
zoomStrategy={createSubspaceZoomStrategy()}
showZoomBreadcrumbs
itemFilter={(a) => a.tags.length > 0}
itemFilterMode="dim"
ariaLabel="Interactive research articles atlas"
keyboardNavigation
tooltip
onZoomStateChange={(state) => {
console.log('Current drill depth:', state.depth);
}}
/>
);
}
```
## Imperative Handle Methods (`handle`)
Returned by `useSimplexGraphController()`:
- **Live Corpus Mutations & Filtering**: `handle.addItems(items)`, `handle.removeItems(ids)`, `handle.setItems(items)`, `handle.setItemFilter(predicate, options?)`, `handle.getItemFilter()`
- **Multi-Selection & Deep-Linking**: `handle.setSelectedIds(ids)`, `handle.toggleSelectedId(id)`, `handle.clearSelection()`, `handle.getSelectedIds()`, `handle.selectItemsInScreenRect(rect, options?)`, `handle.getViewState()`, `handle.restoreViewState(state, options?)`
- **Linked-View Search & Navigation**: `handle.setHighlightedIds(ids)`, `handle.getHighlightedIds()`, `handle.focusItem(itemId | null, options?)`, `handle.getFocusedItemId()`, `handle.zoomToItem(itemId, options?)`
- **Client-Side Snapshot Export**: `handle.exportSvg(options?)`, `handle.exportPng(options?)` (`format: 'blob' | 'dataUrl'`, HiDPI `scale`)
- **Atomic Batching & Options**: `handle.batch(fn)`, `handle.setOptions(options)`
- **Hierarchical Drill-Down**: `handle.drillDownTriangle(index)`, `handle.drillDownCluster(uid)`, `handle.drillToNeighbor(neighborId)`, `handle.drillUp()`, `handle.drillToDepth(depth)`, `handle.drillToRoot()`, `handle.getZoomState()`
- **Focus, Motion, Accessibility, Camera & Telemetry**: `handle.setFocusedTriangleIndex(index | null)`, `handle.setReducedMotion(pref)`, `handle.getReducedMotion()`, `handle.isReducedMotionActive()`, `handle.getKeyboardFocusTarget()`, `handle.clearKeyboardFocus()`, `handle.zoomBy(factor)`, `handle.resetCamera()`, `handle.relayout()`, `handle.getMetrics()`, `handle.getClusters()`, `handle.getLegendModel(options?)`, `handle.getTimeline()`, `handle.subscribeTimeline(listener)`
---
# [API] @simplex-viz/wc (v1.0.0)
Dedicated Custom Element package with zero React dependency, SSR-safe registration (@simplex-viz/wc/define), 24 reactive HTML attributes, inline JSON support, custom DOM tooltip renderers, structured legend snapshots, standard CustomEvents, and full imperative delegation.
Install: `npm install @simplex-viz/wc`
Entry Points:
- `@simplex-viz/wc` (Browser Custom Elements & SSR-safe module imports (zero React); DOM / Host; sideEffects: false; root): Exports SimplexTopicGraphElement and SSR-safe defineSimplexTopicGraphElement() cleanly with zero side effects on import.
- `@simplex-viz/wc/define` (Browser (side-effect auto-registration); DOM / Host; sideEffects: true; exclusive subpath): Exclusive side-effect subpath that automatically registers on CustomElementRegistry and exports DEFAULT_SIMPLEX_TAG_NAME.
Exports:
- `SimplexTopicGraphElement` [@simplex-viz/wc] (Class): `class SimplexTopicGraphElement<
TItem = DefaultTaggedItem
> extends HTMLElement` — Light-DOM Custom Element () mounting SimplexSvgController inside .sv-wc-stage (preserving getBBox(), webfonts, CSS inheritance, and SVG/PNG export) with pre-upgrade property preservation, 24 reactive HTML attributes, inline
```
## Inline JSON Data (HTML-Only)
For static pages, blogs, or Markdown/Astro embeds without writing imperative JavaScript, place a `
```
## Reactive Attributes & Standard `CustomEvent`s
- **Observed Attributes (24)**: `preset`, `theme`, `renderer` (`'svg'`), `tooltip`, `aria-label`, `keyboard-navigation`, `reduced-motion`, `marquee-selection`, `shift-click-selects`, `show-zoom-breadcrumbs`, `show-hulls`, `empty-cluster-behavior`, `defer-initial-layout`, `item-filter-mode`, `touch-scroll-lock-px`, `click-tolerance-px`, `focus-on-cluster-click`, `focus-on-triangle-click`, `relayout-on-font-load`, `timeline`, `items`, `selected-ids`, `highlighted-ids`, `pinned-ids`.
- **Bubbling & Composed Events**: `simplex-click` *(cancelable via `preventDefault()`)*, `simplex-hover` *(cancelable)*, `simplex-selection-change` (`{ selectedIds, ids }`), `simplex-zoom`, `simplex-timeline-change`, `simplex-metrics`, `simplex-clusters-change`, and `simplex-legend-change` (`SimplexLegendModel`).
- **Imperative Methods**: `getLegendModel()`, `getTimeline()`, `subscribeTimeline()`, `getViewState()`, `restoreViewState()`, `exportSvg()`, `exportPng()`, `setSelectedIds()`, `toggleSelectedId()`, `clearSelection()`, `selectItemsInScreenRect()`, `setHighlightedIds()`, `focusItem()`, `zoomToItem()`, `setItemFilter()`, `drillDownTriangle()`, `drillDownCluster()`, `drillUp()`, `drillToRoot()`, `resetCamera()`, `zoomBy()`, `setReducedMotion()`, `batch()`, `setOptions()`, and `relayout()`.
---
# [API] @simplex-viz/canvas (v1.0.0)
Framework-agnostic Canvas 2D renderer with viewport frustum culling, automatic LOD simplification, HiDPI scaling, 1:4 zoom/drill-down, timeline playback, and native PNG export.
Install: `npm install @simplex-viz/canvas`
Entry Points:
- `@simplex-viz/canvas` (Browser HTML5 Canvas 2D (Framework-agnostic, zero @simplex-viz/svg dependency); DOM / Host; sideEffects: false; root): High-capacity Canvas 2D controller & adapter, stateless snapshot painter, frustum culling, automatic LOD simplification, and native PNG export.
Exports:
- `createSimplexCanvas` [@simplex-viz/canvas] (Function): `createSimplexCanvas(
container: HTMLElement | string,
itemsOrOptions: readonly TItem[] | SimplexCanvasControllerOptions<...>,
): SimplexCanvasController<...>` — Zero-boilerplate factory mounting an interactive high-capacity Canvas 2D simplex atlas into an HTMLElement or CSS selector.
- `SimplexCanvasController` [@simplex-viz/canvas] (Class): `new SimplexCanvasController<
TItem, TContentVisual, TClusterVisual, TTagMeta, TClusterMeta
>(container: HTMLElement | string, options: SimplexCanvasControllerOptions<...>)` — Manages ResizeObserver (with 0x0 auto-recovery & deferInitialLayout), relayoutOnFontLoad, rAF spring loop with onFpsUpdate, frustum-culled Canvas 2D rendering, hierarchical 1:4 zoom with built-in breadcrumb HUD, timeline playback bar & subscribeTimeline(), Shift+Click/Shift+Drag marquee multi-selection, WCAG 2.1 AA keyboard navigation & focus target APIs, custom DOM/HTML tooltips (SimplexDomTooltipRenderer), getLegendModel()/setOnLegendChange(), getViewState()/restoreViewState(), full atomic setOptions()/batch(), highlightedIds, onClustersChange, and native exportPng().
- `CanvasRendererAdapter` [@simplex-viz/canvas] (Class): `new CanvasRendererAdapter(options: CanvasRendererAdapterOptions)` — Low-level SimplexRendererAdapter implementing HiDPI DPR scaling, world-space viewport culling, automatic LOD simplification (lodThresholdPx), dual-layer crossfades, and pluggable CanvasNodeRenderer / CanvasTriangleRenderer / CanvasEdgeRenderer hooks.
- `renderSimplexSnapshotToCanvas` [@simplex-viz/canvas] (Function): `renderSimplexSnapshotToCanvas(
canvas: HTMLCanvasElement,
snapshot: SimplexLayoutSnapshot,
options?: RenderSimplexSnapshotToCanvasOptions,
): CanvasRenderStats` — Stateless one-shot renderer painting a pre-solved SimplexLayoutSnapshot (from solveSimplexSnapshot() or @simplex-viz/core/worker) directly onto a