Skip to main content

useDiagram

useDiagram(): ShallowRef<Diagram>

Composable that provides access to a Diagram in the current scope, as a reactive ref.

<script setup>
import { useDiagram } from "@visuallyjs/browser-ui-vue"

const diagram = useDiagram()

function doSomething() {
diagram.doSomething....
}

</script>

<template>
<button :click="doSomething()">Do something</button>
</template>

Returns

ShallowRef<Diagram>