@vanduo-oss/vd3-flowchart 1.5.1 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +16 -170
- package/SKILL.md +57 -15
- package/dist/core.d.ts +89 -2
- package/dist/index.cjs +1320 -63
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1320 -63
- package/dist/index.js.map +3 -3
- package/dist/meta.json +16 -12
- package/dist/vd3-flowchart.css +496 -0
- package/dist/vue.d.ts +34 -0
- package/package.json +1 -1
- package/recipes/editor.vue +7 -0
package/recipes/editor.vue
CHANGED
|
@@ -8,11 +8,18 @@ const document = ref<VdFlowchartDocument>({
|
|
|
8
8
|
nodes: [{ id: 'start', text: 'Start', x: 40, y: 100 }, { id: 'end', text: 'End', x: 300, y: 100 }],
|
|
9
9
|
edges: [{ id: 'next', from: { nodeId: 'start', port: 'right' }, to: { nodeId: 'end', port: 'left' } }],
|
|
10
10
|
});
|
|
11
|
+
function exportDiagram(): string {
|
|
12
|
+
return editor.value?.exportSvg({ background: 'theme', padding: 24 }) ?? '';
|
|
13
|
+
}
|
|
11
14
|
</script>
|
|
12
15
|
<template>
|
|
13
16
|
<button type="button" @click="readonly = !readonly">Toggle read-only</button>
|
|
14
17
|
<button type="button" :disabled="readonly" @click="editor?.undo()">Undo</button>
|
|
15
18
|
<button type="button" @click="editor?.fitNode('start')">Frame start</button>
|
|
19
|
+
<button type="button" :disabled="readonly" @click="editor?.setNodeColor('start', 'primary')">Color start</button>
|
|
20
|
+
<button type="button" :disabled="readonly" @click="editor?.setNodeLocked('start', true)">Lock start</button>
|
|
21
|
+
<button type="button" :disabled="readonly" @click="editor?.alignNodes('middle', ['start', 'end'])">Align</button>
|
|
22
|
+
<button type="button" @click="exportDiagram()">Export SVG</button>
|
|
16
23
|
<VdFlowchart ref="editor" :data="document" :readonly="readonly"
|
|
17
24
|
:min-scale="0.05" :max-scale="20" :min-node-size="6" :max-node-size="4800"
|
|
18
25
|
auto-fit style="height: 560px" @change="document = $event.document" />
|