@xenolithengine/graph-vue
v0.7.0-beta.3
Published
Vue adapter for XenolithGraph — <XenolithGraph> component.
Maintainers
Readme
@xenolithengine/graph-vue
Vue 3 adapter for XenolithGraph — <XenolithGraph> component + composables.
Beta — public API in
STABLE-API.mdis the surface we plan to freeze, but it is NOT frozen yet — breaking changes can land at any point before v1.0. If you adopt now, pin an exact version.
Part of XenolithGraph — an AI-native, embeddable node-graph editor for the web with its own visual design language (Xen).
Install
pnpm add @xenolithengine/graph-vue pixi.jsPeer deps: vue@^3.4.0, pixi.js@^8.6.0. WebGL/client-only.
Usage
<script setup lang="ts">
import { XenolithGraph, XenolithControls, XenolithMiniMap } from '@xenolithengine/graph-vue'
import savedGraph from './graph.json'
const onReady = (editor) => editor.fitView()
</script>
<template>
<XenolithGraph
:graph="savedGraph"
:minimap="true"
@ready="onReady"
@node-click="({ nodeId }) => console.log(nodeId)"
>
<XenolithControls position="bottom-left" />
<XenolithMiniMap position="bottom-right" />
</XenolithGraph>
</template>What's exported
<XenolithGraph>— Vue 3 component (props:theme,graph,zoomBounds,minimap,disableGrid,snap,resizeToWindow,fitOnLoad; emits camelCase versions of every editor event plusready)- In-editor panels:
<XenolithPanel>,<XenolithButton>,<XenolithControls>,<XenolithMiniMap> - Composables:
useEditor,useEditorOrNull,useEditorReady,useEditorEvent,useNodes,useEdges,useSelection,useViewport,useGraphJSON,useUndoRedo XenolithEditorKey— Vue injection key (for hand-rolledprovide/inject)- Custom widgets:
vueWidget,WidgetProps
Docs
- Vue guide
- API reference — every method exposed by
XenolithEditor - GitHub
MIT © XenolithEngine
