Variable: DiagramCanvas
const DiagramCanvas: ForwardRefExoticComponent<Omit<DiagramCanvasProps, "ref"> & RefAttributes<DiagramCanvasHandle>>;
The diagram as an interactive React Flow canvas, read-only (the docs viewer) or editable (the editor: drags, auto-layout and node settings are reported as layout changes). Browser only; importing the module touches no browser API.
Example
import { useState } from 'react';
import { compileDbml, emptyLayout, type Layout } from '@relvista/core';
import { DiagramCanvas } from '@relvista/renderer';
import '@relvista/renderer/styles.css';
export function Editor({ dbml }: { dbml: string }) {
const [layout, setLayout] = useState<Layout>(emptyLayout());
const { model } = compileDbml(dbml);
return (
<div style={{ height: 600 }}>
<DiagramCanvas
model={model}
layout={layout}
editable
onLayoutChange={(next) => setLayout(next)}
/>
</div>
);
}