@visuallyjs/browser-ui-vue 1.1.4 → 1.2.0
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/chart.d.ts +30 -0
- package/controls-component.d.ts +1 -63
- package/decorator-component.d.ts +1 -1
- package/definitions.d.ts +8 -1
- package/diagram-palette-component.d.ts +3 -0
- package/index.d.ts +5 -0
- package/inspector-component.d.ts +5 -1
- package/package.json +1 -1
- package/shape-palette-component.d.ts +3 -0
- package/surface-component.d.ts +4 -1
- package/use-diagram.d.ts +25 -0
- package/use-paper.d.ts +25 -0
- package/use-surface.d.ts +25 -0
- package/use-visuallyjs-update.d.ts +22 -0
- package/use-zoom.d.ts +15 -4
- package/util.d.ts +2 -0
- package/visuallyjs-service.d.ts +22 -1
- package/visuallyjs.browser-ui-vue.cjs.js +1 -1
- package/visuallyjs.browser-ui-vue.es.js +1 -1
- package/vue-wrapper.d.ts +24 -0
package/chart.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export declare const ColumnChartComponent: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
props: any;
|
|
10
10
|
watch: any;
|
|
11
|
+
data: () => {
|
|
12
|
+
hasMounted: boolean;
|
|
13
|
+
};
|
|
11
14
|
/** @internal */
|
|
12
15
|
mounted(): void;
|
|
13
16
|
setup(): {
|
|
@@ -25,6 +28,9 @@ export declare const BarChartComponent: {
|
|
|
25
28
|
name: string;
|
|
26
29
|
props: any;
|
|
27
30
|
watch: any;
|
|
31
|
+
data: () => {
|
|
32
|
+
hasMounted: boolean;
|
|
33
|
+
};
|
|
28
34
|
/** @internal */
|
|
29
35
|
mounted(): void;
|
|
30
36
|
setup(): {
|
|
@@ -42,6 +48,9 @@ export declare const XYChartComponent: {
|
|
|
42
48
|
name: string;
|
|
43
49
|
props: any;
|
|
44
50
|
watch: any;
|
|
51
|
+
data: () => {
|
|
52
|
+
hasMounted: boolean;
|
|
53
|
+
};
|
|
45
54
|
/** @internal */
|
|
46
55
|
mounted(): void;
|
|
47
56
|
setup(): {
|
|
@@ -59,6 +68,9 @@ export declare const PieChartComponent: {
|
|
|
59
68
|
name: string;
|
|
60
69
|
props: any;
|
|
61
70
|
watch: any;
|
|
71
|
+
data: () => {
|
|
72
|
+
hasMounted: boolean;
|
|
73
|
+
};
|
|
62
74
|
/** @internal */
|
|
63
75
|
mounted(): void;
|
|
64
76
|
setup(): {
|
|
@@ -76,6 +88,9 @@ export declare const LineChartComponent: {
|
|
|
76
88
|
name: string;
|
|
77
89
|
props: any;
|
|
78
90
|
watch: any;
|
|
91
|
+
data: () => {
|
|
92
|
+
hasMounted: boolean;
|
|
93
|
+
};
|
|
79
94
|
/** @internal */
|
|
80
95
|
mounted(): void;
|
|
81
96
|
setup(): {
|
|
@@ -93,6 +108,9 @@ export declare const AreaChartComponent: {
|
|
|
93
108
|
name: string;
|
|
94
109
|
props: any;
|
|
95
110
|
watch: any;
|
|
111
|
+
data: () => {
|
|
112
|
+
hasMounted: boolean;
|
|
113
|
+
};
|
|
96
114
|
/** @internal */
|
|
97
115
|
mounted(): void;
|
|
98
116
|
setup(): {
|
|
@@ -110,6 +128,9 @@ export declare const ScatterChartComponent: {
|
|
|
110
128
|
name: string;
|
|
111
129
|
props: any;
|
|
112
130
|
watch: any;
|
|
131
|
+
data: () => {
|
|
132
|
+
hasMounted: boolean;
|
|
133
|
+
};
|
|
113
134
|
/** @internal */
|
|
114
135
|
mounted(): void;
|
|
115
136
|
setup(): {
|
|
@@ -127,6 +148,9 @@ export declare const BubbleChartComponent: {
|
|
|
127
148
|
name: string;
|
|
128
149
|
props: any;
|
|
129
150
|
watch: any;
|
|
151
|
+
data: () => {
|
|
152
|
+
hasMounted: boolean;
|
|
153
|
+
};
|
|
130
154
|
/** @internal */
|
|
131
155
|
mounted(): void;
|
|
132
156
|
setup(): {
|
|
@@ -144,6 +168,9 @@ export declare const GaugeChartComponent: {
|
|
|
144
168
|
name: string;
|
|
145
169
|
props: any;
|
|
146
170
|
watch: any;
|
|
171
|
+
data: () => {
|
|
172
|
+
hasMounted: boolean;
|
|
173
|
+
};
|
|
147
174
|
/** @internal */
|
|
148
175
|
mounted(): void;
|
|
149
176
|
setup(): {
|
|
@@ -192,6 +219,9 @@ export declare const SankeyChartComponent: {
|
|
|
192
219
|
default: boolean;
|
|
193
220
|
};
|
|
194
221
|
};
|
|
222
|
+
data: () => {
|
|
223
|
+
hasMounted: boolean;
|
|
224
|
+
};
|
|
195
225
|
mounted(): void;
|
|
196
226
|
watch: {
|
|
197
227
|
pivot(newVal: string): void;
|
package/controls-component.d.ts
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ControlsComponent: {
|
|
3
|
-
setup(props: ControlsComponentProps): {
|
|
4
|
-
service: unknown;
|
|
5
|
-
};
|
|
6
|
-
name: string;
|
|
7
|
-
props: {
|
|
8
|
-
clear: {
|
|
9
|
-
type: BooleanConstructor;
|
|
10
|
-
default: boolean;
|
|
11
|
-
};
|
|
12
|
-
surfaceId: {
|
|
13
|
-
type: StringConstructor;
|
|
14
|
-
};
|
|
15
|
-
undoRedo: {
|
|
16
|
-
type: BooleanConstructor;
|
|
17
|
-
default: boolean;
|
|
18
|
-
};
|
|
19
|
-
orientation: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
default: string;
|
|
22
|
-
};
|
|
23
|
-
zoomToExtents: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
zoomButtons: {
|
|
28
|
-
type: BooleanConstructor;
|
|
29
|
-
default: boolean;
|
|
30
|
-
};
|
|
31
|
-
clearMessage: {
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
default: string;
|
|
34
|
-
};
|
|
35
|
-
onMaybeClear: {
|
|
36
|
-
type: FunctionConstructor;
|
|
37
|
-
};
|
|
38
|
-
className: {
|
|
39
|
-
type: StringConstructor;
|
|
40
|
-
default: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
methods: {
|
|
44
|
-
panMode: () => void;
|
|
45
|
-
selectMode: () => void;
|
|
46
|
-
zoomToFit: () => void;
|
|
47
|
-
doClear: () => void;
|
|
48
|
-
undo: () => void;
|
|
49
|
-
redo: () => void;
|
|
50
|
-
zoomIn: () => void;
|
|
51
|
-
zoomOut: () => void;
|
|
52
|
-
resetSelection(): void;
|
|
53
|
-
updateSelectionState: () => void;
|
|
54
|
-
};
|
|
55
|
-
data: () => {
|
|
56
|
-
ready: boolean;
|
|
57
|
-
hasLasso: boolean;
|
|
58
|
-
};
|
|
59
|
-
render(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
60
|
-
[key: string]: any;
|
|
61
|
-
}>;
|
|
62
|
-
mounted(): void;
|
|
63
|
-
};
|
|
1
|
+
export declare const ControlsComponent: any;
|
package/decorator-component.d.ts
CHANGED
package/definitions.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const PROP_MODE = "mode";
|
|
|
12
12
|
export declare const PROP_OPTIONS = "options";
|
|
13
13
|
export declare const PROP_RENDER_OPTIONS = "renderOptions";
|
|
14
14
|
export declare const PROP_MODEL_OPTIONS = "modelOptions";
|
|
15
|
+
export declare const PROP_MODEL = "model";
|
|
15
16
|
export declare const PROP_VIEW_OPTIONS = "viewOptions";
|
|
16
17
|
export declare const PROP_URL = "url";
|
|
17
18
|
export declare const PROP_INTERACTIVE = "interactive";
|
|
@@ -380,15 +381,21 @@ export interface InspectorComponentProps {
|
|
|
380
381
|
filter?: (b: Base) => boolean;
|
|
381
382
|
/**
|
|
382
383
|
* Callback invoked when the inspector is cleared.
|
|
383
|
-
* @
|
|
384
|
+
* @deprecated Use `v-model` approach instead
|
|
384
385
|
*/
|
|
385
386
|
renderEmptyContainer: () => void;
|
|
386
387
|
/**
|
|
387
388
|
* Callback invoked when a new object has started to be edited.
|
|
388
389
|
* @param obj
|
|
389
390
|
* @param cb
|
|
391
|
+
* @deprecated Use `v-model` approach instead
|
|
390
392
|
*/
|
|
391
393
|
refresh: (obj: Base) => void;
|
|
394
|
+
/**
|
|
395
|
+
* A model value that this component will apply 2-way binding to. You do not actually supply a prop named `modelValue`; you supply this as `v-model="someRef"`.
|
|
396
|
+
* @since 1.2.0
|
|
397
|
+
*/
|
|
398
|
+
modelValue?: Object;
|
|
392
399
|
/**
|
|
393
400
|
* Optional extra css classes to set on the root element
|
|
394
401
|
*/
|
|
@@ -33,6 +33,9 @@ declare const DiagramPaletteComponent: {
|
|
|
33
33
|
setup(props: DiagramPaletteProps): {
|
|
34
34
|
service: unknown;
|
|
35
35
|
};
|
|
36
|
+
data: () => {
|
|
37
|
+
hasMounted: boolean;
|
|
38
|
+
};
|
|
36
39
|
mounted(): void;
|
|
37
40
|
render: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
38
41
|
[key: string]: any;
|
package/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./miniview-component";
|
|
|
19
19
|
export * from "./util";
|
|
20
20
|
export * from "./diagram-component";
|
|
21
21
|
export * from "./diagram-provider";
|
|
22
|
+
export * from "./diagram-palette-component";
|
|
22
23
|
export * from "./chart";
|
|
23
24
|
export * from "./surface-component";
|
|
24
25
|
export * from "./surface-provider";
|
|
@@ -26,3 +27,7 @@ export * from "./vue-wrapper";
|
|
|
26
27
|
export * from './decorator-component';
|
|
27
28
|
export * from './visuallyjs-service';
|
|
28
29
|
export * from './use-zoom';
|
|
30
|
+
export * from './use-visuallyjs-update';
|
|
31
|
+
export * from './use-surface';
|
|
32
|
+
export * from './use-diagram';
|
|
33
|
+
export * from './use-paper';
|
package/inspector-component.d.ts
CHANGED
|
@@ -46,10 +46,14 @@ declare const InspectorComponent: {
|
|
|
46
46
|
className: StringConstructor;
|
|
47
47
|
showCloseButton: BooleanConstructor;
|
|
48
48
|
afterUpdate: FunctionConstructor;
|
|
49
|
+
modelValue: ObjectConstructor;
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
emits: string[];
|
|
52
|
+
setup(props: InspectorComponentProps, context: any): {
|
|
51
53
|
service: unknown;
|
|
52
54
|
inspectorProvider: InspectorProviderStateUpdater;
|
|
55
|
+
inspector: Inspector;
|
|
56
|
+
emit: any;
|
|
53
57
|
};
|
|
54
58
|
mounted(): void;
|
|
55
59
|
render(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@visuallyjs/browser-ui-vue","version":"1.
|
|
1
|
+
{"name":"@visuallyjs/browser-ui-vue","version":"1.2.0","description":"VisuallyJS Vue integration","module":"visuallyjs.browser-ui-vue.es.js","main":"visuallyjs.browser-ui-vue.cjs.js","types":"index.d.ts","files":["visuallyjs.browser-ui-vue.es.js","visuallyjs.browser-ui-vue.cjs.js","**/*.d.ts"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.0"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
|
|
@@ -29,6 +29,9 @@ declare const ShapePaletteComponent: {
|
|
|
29
29
|
setup(props: ShapePaletteComponentProps): {
|
|
30
30
|
service: unknown;
|
|
31
31
|
};
|
|
32
|
+
data: () => {
|
|
33
|
+
hasMounted: boolean;
|
|
34
|
+
};
|
|
32
35
|
mounted(): void;
|
|
33
36
|
render: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
37
|
[key: string]: any;
|
package/surface-component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from "vue";
|
|
2
2
|
import { RenderOptions, ViewOptions, SurfaceComponentProps } from "./definitions";
|
|
3
|
-
import { ObjectData, ModelOptions } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { ObjectData, ModelOptions, BrowserUIModel } from "@visuallyjs/browser-ui";
|
|
4
4
|
import { VertexPlaceholder } from "./util";
|
|
5
5
|
/**
|
|
6
6
|
* Provides a pannable and zoomable canvas onto which nodes, groups and edges can be drawn, with support for various plugins.
|
|
@@ -25,6 +25,9 @@ export declare const SurfaceComponent: {
|
|
|
25
25
|
viewOptions: {
|
|
26
26
|
type: PropType<ViewOptions>;
|
|
27
27
|
};
|
|
28
|
+
model: {
|
|
29
|
+
type: PropType<BrowserUIModel>;
|
|
30
|
+
};
|
|
28
31
|
url: {
|
|
29
32
|
type: StringConstructor;
|
|
30
33
|
};
|
package/use-diagram.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ShallowRef } from "vue";
|
|
2
|
+
import type { Diagram } from "@visuallyjs/browser-ui";
|
|
3
|
+
/**
|
|
4
|
+
* Composable that provides access to a Diagram in the current scope, as a reactive ref.
|
|
5
|
+
*
|
|
6
|
+
* ```vue
|
|
7
|
+
* <script setup>
|
|
8
|
+
* import { useDiagram } from "@visuallyjs/browser-ui-vue"
|
|
9
|
+
*
|
|
10
|
+
* const diagram = useDiagram()
|
|
11
|
+
*
|
|
12
|
+
* function doSomething() {
|
|
13
|
+
* diagram.doSomething....
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <button :click="doSomething()">Do something</button>
|
|
20
|
+
* </template>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @group Hooks
|
|
24
|
+
*/
|
|
25
|
+
export declare function useDiagram(): ShallowRef<Diagram>;
|
package/use-paper.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ShallowRef } from "vue";
|
|
2
|
+
import type { Paper } from "@visuallyjs/browser-ui";
|
|
3
|
+
/**
|
|
4
|
+
* Composable that provides access to a Paper in the current scope, as a reactive ref.
|
|
5
|
+
*
|
|
6
|
+
* ```vue
|
|
7
|
+
* <script setup>
|
|
8
|
+
* import { usePaper } from "@visuallyjs/browser-ui-vue"
|
|
9
|
+
*
|
|
10
|
+
* const paper = usePaper()
|
|
11
|
+
*
|
|
12
|
+
* function doSomething() {
|
|
13
|
+
* paper.doSomething....
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <button :click="doSomething()">Do something</button>
|
|
20
|
+
* </template>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @group Hooks
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePaper(): ShallowRef<Paper>;
|
package/use-surface.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ShallowRef } from "vue";
|
|
2
|
+
import type { Surface } from "@visuallyjs/browser-ui";
|
|
3
|
+
/**
|
|
4
|
+
* Composable that provides access to a Surface in the current scope, as a reactive ref.
|
|
5
|
+
*
|
|
6
|
+
* ```vue
|
|
7
|
+
* <script setup>
|
|
8
|
+
* import { useSurface } from "@visuallyjs/browser-ui-vue"
|
|
9
|
+
*
|
|
10
|
+
* const surface = useSurface()
|
|
11
|
+
*
|
|
12
|
+
* function zoomToFit() {
|
|
13
|
+
* surface?.zoomToFit()
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <button :click="zoomToFit()">Zoom to fit</button>
|
|
20
|
+
* </template>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @group Hooks
|
|
24
|
+
*/
|
|
25
|
+
export declare function useSurface(): ShallowRef<Surface>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BrowserUIVueModel } from "./browser-ui-vue";
|
|
2
|
+
/**
|
|
3
|
+
* Simple composable that responds to all update events in the model, including when the model is cleared. You pass in a function that takes the model as argument, and that should be invoked when an update/clear event occurs. The function is also invoked when the initial model reference is obtained.
|
|
4
|
+
*
|
|
5
|
+
* ```vue
|
|
6
|
+
* <script setup>
|
|
7
|
+
* import { useVisuallyJsUpdate } from "@visuallyjs/browser-ui-vue"
|
|
8
|
+
* import { ref } from "vue"
|
|
9
|
+
*
|
|
10
|
+
* const count = ref(0)
|
|
11
|
+
* useVisuallyJsUpdate((model) => count.value = model.getNodeCount())
|
|
12
|
+
* </script>
|
|
13
|
+
*
|
|
14
|
+
* <template>
|
|
15
|
+
* <h1>{{ count }}</h1>
|
|
16
|
+
* </template>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param callback Callback to invoke when an update occurs.
|
|
20
|
+
* @group Hooks
|
|
21
|
+
*/
|
|
22
|
+
export declare function useVisuallyJsUpdate(callback: (model: BrowserUIVueModel) => any): void;
|
package/use-zoom.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { BrowserUI } from '@visuallyjs/browser-ui';
|
|
2
1
|
/**
|
|
3
|
-
* Composable to track the current zoom level of a VisuallyJS UI in Vue.
|
|
4
|
-
*
|
|
2
|
+
* Composable to track the current zoom level of a VisuallyJS UI in Vue. This returns the current zoom as a ref, and will discover the component from which to get the zoom automatically (a Surface, Paper or Diagram)
|
|
3
|
+
*
|
|
4
|
+
* ```vue
|
|
5
|
+
* <script setup>
|
|
6
|
+
* import { useZoom } from "@visuallyjs/browser-ui-vue"
|
|
7
|
+
*
|
|
8
|
+
* const zoom = useZoom()
|
|
9
|
+
* </script>
|
|
10
|
+
*
|
|
11
|
+
* <template>
|
|
12
|
+
* <p>Current zoom: {{ zoom }}</p>
|
|
13
|
+
* </template>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
5
16
|
* @group Hooks
|
|
6
17
|
*/
|
|
7
|
-
export declare function useZoom(
|
|
18
|
+
export declare function useZoom(): import("vue").Ref<number>;
|
package/util.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const BaseNodeComponent: {
|
|
|
16
16
|
data: ObjectConstructor;
|
|
17
17
|
model: typeof BrowserUIVueModel;
|
|
18
18
|
obj: typeof Vertex;
|
|
19
|
+
vertex: typeof Vertex;
|
|
19
20
|
ui: typeof BrowserUI;
|
|
20
21
|
el: {
|
|
21
22
|
new (): Element;
|
|
@@ -70,6 +71,7 @@ export declare const BaseGroupComponent: {
|
|
|
70
71
|
data: ObjectConstructor;
|
|
71
72
|
model: typeof BrowserUIVueModel;
|
|
72
73
|
obj: typeof Vertex;
|
|
74
|
+
vertex: typeof Vertex;
|
|
73
75
|
ui: typeof BrowserUI;
|
|
74
76
|
el: {
|
|
75
77
|
new (): Element;
|
package/visuallyjs-service.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Diagram, Paper, Surface } from "@visuallyjs/browser-ui";
|
|
1
|
+
import { BrowserUI, BrowserUIModel, Diagram, Paper, Surface } from "@visuallyjs/browser-ui";
|
|
2
2
|
import { BrowserUIVueModel } from "./browser-ui-vue";
|
|
3
|
+
import { ShallowRef, UnwrapRef } from "vue";
|
|
3
4
|
export declare const VisuallyJsServiceKey: unique symbol;
|
|
4
5
|
/**
|
|
5
6
|
* Provides access to Surface/Diagram/Paper ui components, as well as models. This service is provided in the root as an application-wide instance, but each of the providers also creates and provides an instance of this service.
|
|
@@ -14,6 +15,26 @@ export declare class VisuallyJsService {
|
|
|
14
15
|
_surface: Surface;
|
|
15
16
|
_diagram: Diagram;
|
|
16
17
|
_paper: Paper;
|
|
18
|
+
/**
|
|
19
|
+
* The current surface in scope. May be null.
|
|
20
|
+
*/
|
|
21
|
+
surface: ShallowRef<UnwrapRef<Surface | null>>;
|
|
22
|
+
/**
|
|
23
|
+
* The current model in scope. May be null.
|
|
24
|
+
*/
|
|
25
|
+
model: ShallowRef<BrowserUIModel>;
|
|
26
|
+
/**
|
|
27
|
+
* The current paper in scope. May be null.
|
|
28
|
+
*/
|
|
29
|
+
paper: ShallowRef<UnwrapRef<Paper | null>>;
|
|
30
|
+
/**
|
|
31
|
+
* The current diagram in scope. May be null.
|
|
32
|
+
*/
|
|
33
|
+
diagram: ShallowRef<UnwrapRef<Diagram | null>>;
|
|
34
|
+
/**
|
|
35
|
+
* The current ui (a surface or paper) in scope. May be null.
|
|
36
|
+
*/
|
|
37
|
+
ui: ShallowRef<UnwrapRef<BrowserUI | null>>;
|
|
17
38
|
constructor(context: string);
|
|
18
39
|
getSurface(cb: (s: Surface) => any): void;
|
|
19
40
|
getDiagram(cb: (s: Diagram) => any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _e=Object.defineProperty,Oo=Object.defineProperties,Po=Object.getOwnPropertyDescriptor,Eo=Object.getOwnPropertyDescriptors,Co=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols;var Zt=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable;var Yt=(e,t,o)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,z=(e,t)=>{for(var o in t||(t={}))Zt.call(t,o)&&Yt(e,o,t[o]);if(Xt)for(var o of Xt(t))_o.call(t,o)&&Yt(e,o,t[o]);return e},K=(e,t)=>Oo(e,Eo(t));var So=(e,t)=>{for(var o in t)_e(e,o,{get:t[o],enumerable:!0})},To=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Co(t))!Zt.call(e,i)&&i!==o&&_e(e,i,{get:()=>t[i],enumerable:!(n=Po(t,i))||n.enumerable});return e};var go=e=>To(_e({},"__esModule",{value:!0}),e);var Go={};So(Go,{AreaChartComponent:()=>be,BarChartComponent:()=>Ie,BaseGroupComponent:()=>ro,BaseNodeComponent:()=>oo,BrowserUIVueModel:()=>R,BubbleChartComponent:()=>Le,CLASS_VUE_GROUP:()=>vt,CLASS_VUE_NODE:()=>Dt,COMPONENT_AREA_CHART:()=>le,COMPONENT_BAR_CHART:()=>se,COMPONENT_BUBBLE_CHART:()=>ue,COMPONENT_COLUMN_CHART:()=>ie,COMPONENT_CONTROLS:()=>te,COMPONENT_DIAGRAM:()=>re,COMPONENT_DIAGRAM_PALETTE:()=>ne,COMPONENT_DIAGRAM_PROVIDER:()=>bt,COMPONENT_EXPORT_CONTROLS:()=>oe,COMPONENT_GAUGE_CHART:()=>me,COMPONENT_INSPECTOR:()=>fe,COMPONENT_LINE_CHART:()=>pe,COMPONENT_MINIVIEW:()=>q,COMPONENT_PALETTE:()=>ee,COMPONENT_PIE_CHART:()=>ce,COMPONENT_SANKEY_CHART:()=>he,COMPONENT_SCATTER_CHART:()=>de,COMPONENT_SURFACE:()=>Q,COMPONENT_SURFACE_PROVIDER:()=>Mt,COMPONENT_XY_CHART:()=>ae,ColorPickerComponent:()=>zt,ColumnChartComponent:()=>xe,ControlsComponent:()=>jt,DEFAULT_SHAPE_HEIGHT:()=>xt,DEFAULT_SHAPE_WIDTH:()=>Rt,DEFAULT_VUE_SURFACE_ID:()=>qe,DecoratorComponent:()=>Je,DiagramComponent:()=>$t,DiagramProvider:()=>Xe,EVENT_VERTEX_UPDATED:()=>to,EVENT_VERTICES_RENDERED:()=>eo,EdgeTypePickerComponent:()=>Ke,ExportControlsComponent:()=>kt,GaugeChartComponent:()=>Ve,InspectorComponent:()=>We,InspectorGetterSymbol:()=>j,InspectorSetterSymbol:()=>uo,LineChartComponent:()=>Me,MiniviewComponent:()=>Ht,PROP_ACTIVE_TRACKING:()=>ot,PROP_ALLOW_CLICK_TO_ADD:()=>At,PROP_ALLOW_DROP_ON_CANVAS:()=>Pt,PROP_ALLOW_DROP_ON_EDGE:()=>Ot,PROP_ALLOW_DROP_ON_GROUP:()=>Et,PROP_ALLOW_DROP_ON_NODE:()=>Ct,PROP_CANVAS_DROP_FILTER:()=>Nt,PROP_CLASS_NAME:()=>M,PROP_CLICK_TO_ADD_ONLY:()=>gt,PROP_CLICK_TO_CENTER:()=>et,PROP_CSV_DATA:()=>lt,PROP_DATA:()=>b,PROP_DATA_GENERATOR:()=>mt,PROP_DATA_SOURCE_FILTER:()=>Te,PROP_DRAG_SIZE:()=>yt,PROP_GROUP_IDENTIFIER:()=>ft,PROP_ID:()=>yo,PROP_IGNORE_DROP_ON_NODE:()=>_t,PROP_INTERACTIVE:()=>at,PROP_JSON_DATA:()=>ct,PROP_MODE:()=>nt,PROP_MODEL_OPTIONS:()=>J,PROP_ON_VERTEX_ADDED:()=>St,PROP_OPTIONS:()=>B,PROP_PIVOT:()=>pt,PROP_RENDER_OPTIONS:()=>it,PROP_SELECTOR:()=>ut,PROP_SELECT_AFTER_ADD:()=>Tt,PROP_SHOW_LASSO:()=>tt,PROP_SURFACE_ID:()=>g,PROP_TRACK_SELECTION:()=>rt,PROP_TYPE_FUNCTION:()=>Qe,PROP_TYPE_GENERATOR:()=>ht,PROP_URL:()=>w,PROP_USE_MODEL:()=>dt,PROP_VIEW_OPTIONS:()=>st,PaletteComponent:()=>Wt,PieChartComponent:()=>ve,SankeyChartComponent:()=>Be,ScatterChartComponent:()=>we,ShapeComponent:()=>je,ShapePaletteComponent:()=>$e,SurfaceComponent:()=>Gt,SurfaceProvider:()=>Ge,TAG_COLOR_PICKER:()=>It,TAG_DECORATOR:()=>wt,TAG_EDGE_TYPE_PICKER:()=>Z,TAG_SHAPE:()=>X,TAG_SHAPE_PALETTE:()=>Y,VisuallyJsPlugin:()=>Bo,VisuallyJsService:()=>A,VisuallyJsServiceKey:()=>s,XYChartComponent:()=>De,addSurface:()=>Ut,bindToDevLifecycle:()=>Io,doProvideInspector:()=>mo,newInstance:()=>Ao,useZoom:()=>Uo});module.exports=go(Go);var Se=require("@visuallyjs/browser-ui"),R=class extends Se.BrowserUIModel{render(t,o){return(0,Se.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Ao(e){return e=e||{},new R(e)}var qe="surfaceId",Qe="typeFunction",et="clickToCenter",tt="showLasso",ot="activeTracking",rt="trackSelection",g="surfaceId",M="className",b="data",nt="mode",B="options",it="renderOptions",J="modelOptions",st="viewOptions",w="url",at="interactive",pt="pivot",Te="dataSourceFilter",lt="csvData",ct="jsonData",dt="useModel",yo="id",ut="selector",mt="dataGenerator",ht="typeGenerator",ft="groupIdentifier",Ot="allowDropOnEdge",Pt="allowDropOnCanvas",Et="allowDropOnGroup",Ct="allowDropOnNode",_t="ignoreDropOnNode",St="onVertexAdded",Tt="selectAfterAdd",gt="clickToAddOnly",At="allowClickToAdd",yt="dragSize",Nt="canvasDropFilter",X="Shape",Y="ShapePalette",Rt=120,xt=90,Z="EdgeTypePickerComponent",It="ColorPickerComponent",Dt="vjs-vue-node",vt="vjs-vue-group",q="MiniviewComponent",Q="SurfaceComponent",Mt="SurfaceProvider",bt="DiagramProvider",ee="PaletteComponent",te="ControlsComponent",oe="ExportControlsComponent",re="DiagramComponent",ne="DiagramPaletteComponent",ie="ColumnChartComponent",se="BarChartComponent",ae="XYChartComponent",pe="LineChartComponent",le="AreaChartComponent",ce="PieChartComponent",de="ScatterChartComponent",ue="BubbleChartComponent",me="GaugeChartComponent",he="SankeyChartComponent",fe="InspectorComponent",wt="Decorator";var U=require("vue"),c=require("@visuallyjs/browser-ui"),Lt=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new c.OptimisticEventGenerator}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(eo)}vertexHasUpdated(t){this.eventManager.fire(to,t)}},eo="vertices:rendered",to="vertex:updated",Vt=new Map;function ge(e){return Vt.has(e)||Vt.set(e,new Lt),Vt.get(e)}function No(e,t){ge(e).vertexHasRendered(t)}function Ro(e,t){ge(e).vertexHasUpdated(t)}function xo(e,t){ge(e).vertexWillRender(t)}function Io(e,t,o){ge(e).eventManager.bind(t,o)}var qt={props:{data:Object,model:R,obj:c.Vertex,ui:c.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,c.isGroup)(e.obj)?vt:Dt;e.el.firstElementChild&&(0,c.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),No(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Ro(this.ui.id,this.obj)}},oo={mixins:[qt],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},ro={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[qt]},Bt=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Qt=(e,t,o,n,i,a,l,f,P)=>{let O=l.component!=null,I=(0,c.isGroup)(f),D=[];O||D.push(I?c.CLASS_DEFAULT_GROUP:c.CLASS_DEFAULT_NODE);let S=O?l.component:{render(T){return T.data.label||""}};if(S){let T=document.createElement(c.ELEMENT_DIV);(0,c.updateClasses)(T,D),S.mixins==null&&(S.mixins=[]);let v=I?ro:oo;S.mixins.find(Ce=>Ce===v)||S.mixins.push(v),xo(a.id,f);let Ee={data:o,model:(0,U.markRaw)(n),ui:(0,U.markRaw)(a),obj:f,el:T,def:(0,U.markRaw)(l),eventInfo:P==null?null:(0,U.markRaw)(P)};if(l.inject)for(let Ce in l.inject){let Ze=l.inject[Ce],fo=typeof Ze=="function"?Ze(f,n):Ze;Ee[Ce]=fo}e.push({component:(0,U.markRaw)(S),el:T,o:f.getFullId(),props:Ee})}};function Ut(e,t,o,n,i,a){let l={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(P,O,I,D)=>{},render:(P,O,I,D,S,T,v,Pe)=>Qt(n,P,O,I,D,S,T,v,Pe),cleanupVertex:Bt,cleanupPort:Bt,rerender:(P,O,I,D,S,T,v,Pe,Ee)=>{Bt(v.id,Ee),Qt(n,P,O,I,D,S,T,v,Pe)}},f=(0,c.extend)(i||{},{view:a||{},id:t});return(0,c.renderSurface)(e,o,l,f)}var L=require("@visuallyjs/browser-ui"),s=Symbol.for("visuallyjs-service"),A=class{constructor(t){this.context=t;this.i=[];this.s=[];this.a=[];this.p=[]}getSurface(t){this.e(this.s,t,this.l)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.p,t,this.u)}getModel(t){this.e(this.i,t,this.r)}getModelDirect(){return this.r}e(t,o,n){if(n!=null)try{o(n)}catch(i){(0,L.log)(`WARN: could not dispatch ${i}`)}else t.push(o)}setSurface(t){this.l=t,this.n(t.model),this.t(this.s,t)}setDiagram(t){this.c=t,this.n(t.model),t.$ui instanceof L.Surface?this.setSurface(t.$ui):t.$ui instanceof L.Paper&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.u=t,this.n(t.model),this.t(this.p,t)}n(t){this.r=t,this.t(this.i,t)}t(t,o){t.forEach(n=>{try{n(o)}catch(i){(0,L.log)(`WARN: could not flush all queue entries ${i}`)}})}};var x=require("vue"),h=require("@visuallyjs/browser-ui"),Gt={setup(e){return{service:(0,x.inject)(s),surfaceId:e.surfaceId||qe}},name:Q,props:{[b]:{type:Object},[it]:{type:Object},[J]:{type:Object},[st]:{type:Object},[w]:{type:String},[g]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=new R(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.model=t,this.surface=Ut(t,this.surfaceId,o,this.vertices,(0,h.clone)(this.renderOptions||{}),(0,h.clone)(this.viewOptions||{})),this.service.setSurface(this.surface);let n=(a,l)=>{let f=()=>{let O={};return l.originalData||l.updates?O=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(O,l.newData),O},P=this.vertices.find(O=>O.o===a);P!=null&&(P.props.data=f())},i=a=>{let l=this.vertices.findIndex(f=>f.o===a);l!==-1&&this.vertices.splice(l,1)};this.model.bind(h.EVENT_NODE_UPDATED,a=>{n(a.vertex.getFullId(),a)}),this.model.bind(h.EVENT_GROUP_UPDATED,a=>{n(a.vertex.getFullId(),a)}),this.model.bind(h.EVENT_NODE_REMOVED,a=>{i(a.node.id)}),this.model.bind(h.EVENT_GROUP_REMOVED,a=>{i(a.group.id)}),this.surface.bind(h.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return(0,x.h)(h.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>(0,x.h)(x.Teleport,{to:e.el,key:e.o},[(0,x.h)(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var p=require("vue"),r=require("@visuallyjs/browser-ui"),Do="Clear dataset?",Ft="vjs-selected-mode",no="can-undo",io="can-redo",vo="data-undo",Mo="data-redo",so="data-mode",bo="data-reset",wo="data-clear",Lo="data-zoom-in",Vo="data-zoom-out",ao="vjs-controls-has-selection",jt={setup(e){return{service:(0,p.inject)(s)}},name:te,props:{clear:{type:Boolean,default:!0},[g]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Do},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){this.service.getSurface(e=>e.setMode(r.SURFACE_MODE_PAN))},selectMode:function(){this.service.getSurface(e=>e.setMode(r.SURFACE_MODE_SELECT))},zoomToFit:function(){this.service.getSurface(e=>e.zoomToFit())},doClear:function(){this.service.getSurface(e=>{this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear()})},undo:function(){this.service.getModel(e=>e.undo())},redo:function(){this.service.getModel(e=>e.redo())},zoomIn:function(){this.service.getSurface(e=>e.zoomIn())},zoomOut:function(){this.service.getSurface(e=>e.zoomOut())},resetSelection(){this.service.getSurface(e=>{e.model.clearSelection(),(0,r.supportsPathEditing)(e)&&e.stopEditingPath()})},updateSelectionState:function(){this.service.getSurface(e=>{e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(ao):this.$refs.root.setAttribute(ao,"true")})}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,p.h)("i",{class:`vjs-pan-mode ${Ft}`,[so]:r.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,p.h)("svg",{viewBox:r.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,p.h)("path",{d:r.PAN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-select-mode",[so]:r.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,p.h)("svg",{viewBox:r.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,p.h)("i",{class:"vjs-undo",[vo]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push((0,p.h)("i",{class:"vjs-redo",[Mo]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push((0,p.h)("i",{class:"vjs-zoom-to-fit",[bo]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,p.h)("svg",{viewBox:r.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,p.h)("i",{class:"vjs-zoom-in",[Lo]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_IN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-zoom-out",[Vo]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_OUT_PATH})])]))),e.push((0,p.h)("i",{class:r.CLASS_CONTROLS_RESET_SELECTION,[r.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,p.h)("svg",{viewBox:r.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,p.h)("i",{class:"vjs-clear-dataset",[wo]:"true",onClick:()=>{this.doClear()}},[(0,p.h)("svg",{viewBox:r.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.CLEAR_PATH})])])),(0,p.h)(r.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[no]:!1,[io]:!1,[r.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,p.h)(r.ELEMENT_DIV,{ref:"root"})},mounted(){this.service.getSurface(e=>{let t=e.getPlugin(r.LassoPlugin.type);this.showPan=t!=null,e.bind(r.EVENT_SURFACE_MODE_CHANGED,o=>{e.removeClass(e.$getSelector(this.$refs.root,"[data-mode]"),Ft),e.addClass(e.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),Ft)}),e.model.bind(r.EVENT_UNDOREDO_UPDATE,o=>{this.$refs.root.setAttribute(no,o.undoCount>0?r.TRUE:r.FALSE),this.$refs.root.setAttribute(io,o.redoCount>0?r.TRUE:r.FALSE)}),e.model.bind(r.EVENT_SELECT,()=>this.updateSelectionState()),e.model.bind(r.EVENT_DESELECT,()=>this.updateSelectionState()),e.model.bind(r.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.ready=!0})}};var E=require("vue"),m=require("@visuallyjs/browser-ui"),kt={name:oe,setup(e){return{service:(0,E.inject)(s)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){this.service.getSurface(e)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new m.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,n=this.allowJpgExport!==!1,i=[];return t&&i.push((0,E.h)("i",{},[(0,E.h)("a",{href:"#","data-type":m.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),o&&i.push((0,E.h)("i",{},[(0,E.h)("a",{href:"#","data-type":m.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),n&&i.push((0,E.h)("i",{},[(0,E.h)("a",{href:"#","data-type":m.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&i.unshift((0,E.h)("span",{},[this.label])),(0,E.h)(m.ELEMENT_DIV,{class:`${m.CLASS_CONTROLS} ${m.CLASS_EXPORT_CONTROLS}`},i)}};var Ae=require("vue"),ye=require("@visuallyjs/browser-ui"),Ht={setup(e){return{service:(0,Ae.inject)(s)}},name:q,props:{[g]:{type:String},[M]:{type:String,default:""},[ot]:{type:Boolean,default:!0},[et]:{type:Boolean,default:!0},[tt]:{type:Boolean,default:!0},[rt]:{type:Boolean,default:!0},[Qe]:{type:Function}},mounted:function(){this.service.getSurface(e=>{e.addPlugin({type:ye.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})})},render:function(e){return(0,Ae.h)(ye.ELEMENT_DIV,{ref:"root",class:e.className})}};var Ne=require("vue"),Re=require("@visuallyjs/browser-ui"),$t={setup(e){return{service:(0,Ne.inject)(s)}},name:re,props:{[b]:{type:Object},[w]:{type:String},[J]:{type:Object},[B]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,Re.createDiagram)(e,this.options,this.modelOptions),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,Ne.h)(Re.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var Oe=require("vue"),d=require("@visuallyjs/browser-ui"),po={[M]:{type:String},[b]:{type:Object},[w]:{type:String},[dt]:{type:Boolean,default:!1}},lo={setup(){return{service:(0,Oe.inject)(s)}},render:function(){return(0,Oe.h)(d.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function y(e,t,o=!0){let n=K(z({},po),{[B]:{type:Object}}),i={};return o&&(n[Te]={type:Function},i[Te]=function(a){this.chart.setDataSourceFilter(a)}),K(z({},lo),{name:e,props:n,watch:i,mounted(){let a=this.$refs.root,l=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(l.data=this.data),this.url&&(l.url=this.url);let f=()=>{this.chart=new t(a,l)};this.useModel?this.service.getModel(P=>{l.dataSource=P,f()}):f()}})}var xe=y(ie,d.ColumnChart),Ie=y(se,d.BarChart),De=y(ae,d.CategoryValueChart,!1),ve=y(ce,d.PieChart),Me=y(pe,d.LineChart),be=y(le,d.AreaChart),we=y(de,d.ScatterChart),Le=y(ue,d.BubbleChart),Ve=y(me,d.GaugeChart,!1),Be=K(z({},lo),{name:he,props:K(z({},po),{[lt]:{type:String},[ct]:{type:Object},[at]:{type:Boolean},[pt]:{type:String},[B]:{type:Object}}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.chart=new d.SankeyChart(e,t)};this.useModel?this.service.getModel(n=>{t.dataSource=n,o()}):o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return(0,Oe.h)(d.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}});var Ue=require("vue"),G=require("@visuallyjs/browser-ui"),Wt={setup(e){return{service:(0,Ue.inject)(s)}},name:ee,props:{[g]:{type:String},[ut]:{type:String},[mt]:{type:Function},[ht]:{type:Function},[ft]:{type:Function},[Ot]:{type:Boolean,default:!1},[Pt]:{type:Boolean,default:!0},[Et]:{type:Boolean,default:!0},[Ct]:{type:Boolean,default:!1},[_t]:{type:Boolean,default:!1},[yt]:Object,[St]:Function,[Nt]:Function,[M]:String,[nt]:String,[Tt]:{type:Boolean,default:!1},[At]:{type:Boolean,default:!1},[gt]:{type:Boolean,default:!1}},mounted:function(){let e=this;this.service.getSurface(t=>{let o={source:this.$refs.root,selector:e.selector,dataGenerator:n=>e.dataGenerator?e.dataGenerator(n):(0,G.defaultDataGenerator)(n),allowDropOnEdge:e.allowDropOnEdge===!0,allowDropOnGroup:e.allowDropOnGroup!==!1,allowDropOnCanvas:e.allowDropOnCanvas!==!1,allowDropOnNode:e.allowDropOnNode===!0,ignoreDropOnNode:e.ignoreDropOnNode===!0,canvasDropFilter:e.canvasDropFilter,onVertexAdded:e.onVertexAdded,dragSize:e.dragSize,mode:e.mode};e.groupIdentifier!=null&&(o.groupIdentifier=e.groupIdentifier),e.typeGenerator!=null&&(o.typeGenerator=e.typeGenerator),this.palette=new G.Palette(t,o)})},render:function(){return(0,Ue.h)(G.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var co=require("vue"),Ge={setup(){(0,co.provide)(s,new A("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Fe=require("vue"),C=require("@visuallyjs/browser-ui"),je={name:X,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:C.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,Fe.inject)(s)}},mounted(){this.service.getSurface(e=>{let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&(0,C.convertToMultilineText)(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||C.DEFAULT_LABEL_FILL_RATIO))}})},updated(){this.service.getSurface(e=>{let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&(0,C.convertToMultilineText)(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||C.DEFAULT_LABEL_FILL_RATIO))}})},render:function(){return(0,Fe.h)(C.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:C.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||Rt},getHeight:function(){return this.data.height||xt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var ke=require("vue"),He=require("@visuallyjs/browser-ui"),$e={name:Y,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:(0,ke.inject)(s)}},mounted(){this.service.getSurface(e=>{new He.ShapePalette(e,{container:this.$refs.container,shapeLibrary:e.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes})})},render:function(){return(0,ke.h)(He.ELEMENT_DIV,{ref:"container"})}};var N=require("vue"),F=require("@visuallyjs/browser-ui"),j=Symbol.for("VueInspectorGetter"),uo=Symbol.for("VueInspectorSetter");function mo(){let e=[],t=null;function o(a){try{a(t)}catch(l){(0,F.log)("WARN: inspector listener threw an exception",l)}}let n={listen:a=>{t!=null?o(a):e.push(a)}},i={inspector:a=>{t=a,e.forEach(o)}};return(0,N.provide)(uo,i),(0,N.provide)(j,(0,N.readonly)(n)),i}var We={name:fe,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function},setup(e){let t=mo();return{service:(0,N.inject)(s),inspectorProvider:t}},mounted(){this.service.getSurface(e=>{let t=new F.Inspector({container:this.$refs.root,ui:e,renderEmptyContainer:this.renderEmptyContainer||(()=>console.log("rendering empty")),refresh:(o,n)=>{this.refresh&&this.refresh(o),setTimeout(n)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(e):null});this.inspectorProvider.inspector(t)})},render(){return(0,N.h)(F.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var ze=require("vue"),k=require("@visuallyjs/browser-ui"),Ke={name:Z,props:{propertyName:String},setup(){return{inspectorProvider:(0,ze.inject)(j)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new k.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,n)=>{e.setValue(this.propertyName,n)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,k.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,ze.h)(k.ELEMENT_DIV,{ref:"container"})}};var V=require("vue"),u=require("@visuallyjs/browser-ui"),zt={render(){let e=this.swatches.map(t=>(0,V.h)(u.ELEMENT_DIV,{title:t,class:u.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,V.h)(u.ELEMENT_DIV,{class:`${u.CLASS_COLOR_PICKER}`},[(0,V.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,V.h)(u.ELEMENT_DIV,{class:u.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:u.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:u.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:u.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,V.inject)(j);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(u.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(u.EVENT_CONTEXT_UPDATE,o=>{o.key===u.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(u.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(n=>n.toUpperCase()===e)!=null)){let n=this.maxColors||10,i=t.slice();i.unshift(e),i.length>n&&(i.length=n),this.inspector.updateContext(u.INSPECTOR_CONTEXT_RECENT_COLORS,i)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var _=require("vue"),H=require("@visuallyjs/browser-ui"),Je={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({mounted:!1,surface:null}),setup(e){return{service:(0,_.inject)(s)}},mounted(){this.service.getSurface(e=>{this.surface=e,this.mounted=!0;let t=this.position||{x:0,y:0};(0,_.nextTick)().then(()=>{this.placement==="floating"?e.floatElement(this.$refs.root,t):e.fixElement(this.$refs.fixedEl,t,this.constraints)})})},render(){return(0,_.h)(H.ELEMENT_DIV,{ref:"root"},this.mounted?this.placement==="floating"?(0,_.h)(H.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,_.h)(_.Teleport,{to:this.surface.vertexLayer,key:(0,H.uuid)()},(0,_.h)(H.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var ho=require("vue"),Xe={setup(){(0,ho.provide)(s,new A("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Ye=require("vue"),$=require("@visuallyjs/browser-ui"),Kt={name:ne,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:(0,Ye.inject)(s)}},mounted(){if(this.service==null&&this.diagram==null)(0,$.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{new $.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes})};this.diagram?e(this.diagram):this.service.getDiagram(e)}},render:function(){return(0,Ye.h)($.ELEMENT_DIV,{ref:"container"})}};var Bo={install:function(e,t){e.component(Mt,Ge),e.component(bt,Xe),e.component(Q,Gt),e.component(re,$t),e.component(q,Ht),e.component(te,jt),e.component(oe,kt),e.component(ee,Wt),e.component(ne,Kt),e.component(se,Ie),e.component(ie,xe),e.component(ae,De),e.component(pe,Me),e.component(le,be),e.component(ce,ve),e.component(he,Be),e.component(me,Ve),e.component(ue,Le),e.component(de,we),e.component(X,je),e.component(Y,$e),e.component(Z,Ke),e.component(It,zt),e.component(fe,We),e.component(wt,Je),e.provide(s,new A("root"))}};var W=require("vue"),Jt=require("@visuallyjs/browser-ui");function Uo(e){let t=(0,W.ref)(e.getZoom()),o=n=>{t.value=n.zoom};return(0,W.onMounted)(()=>{e.bind(Jt.EVENT_ZOOM,o),t.value=e.getZoom()}),(0,W.onUnmounted)(()=>{e.unbind(Jt.EVENT_ZOOM,o)}),t}
|
|
1
|
+
var ve=Object.defineProperty,No=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,xo=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertyNames,Qt=Object.getOwnPropertySymbols;var to=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable;var eo=(e,t,o)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,te=(e,t)=>{for(var o in t||(t={}))to.call(t,o)&&eo(e,o,t[o]);if(Qt)for(var o of Qt(t))Io.call(t,o)&&eo(e,o,t[o]);return e},oe=(e,t)=>No(e,xo(t));var Mo=(e,t)=>{for(var o in t)ve(e,o,{get:t[o],enumerable:!0})},wo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Do(t))!to.call(e,s)&&s!==o&&ve(e,s,{get:()=>t[s],enumerable:!(n=vo(t,s))||n.enumerable});return e};var bo=e=>wo(ve({},"__esModule",{value:!0}),e);var er={};Mo(er,{AreaChartComponent:()=>Ge,BarChartComponent:()=>Ve,BaseGroupComponent:()=>ao,BaseNodeComponent:()=>io,BrowserUIVueModel:()=>N,BubbleChartComponent:()=>Fe,CLASS_VUE_GROUP:()=>Bt,CLASS_VUE_NODE:()=>Lt,COMPONENT_AREA_CHART:()=>Ee,COMPONENT_BAR_CHART:()=>fe,COMPONENT_BUBBLE_CHART:()=>_e,COMPONENT_COLUMN_CHART:()=>he,COMPONENT_CONTROLS:()=>ce,COMPONENT_DIAGRAM:()=>de,COMPONENT_DIAGRAM_PALETTE:()=>me,COMPONENT_DIAGRAM_PROVIDER:()=>Gt,COMPONENT_EXPORT_CONTROLS:()=>ue,COMPONENT_GAUGE_CHART:()=>Te,COMPONENT_INSPECTOR:()=>ye,COMPONENT_LINE_CHART:()=>Pe,COMPONENT_MINIVIEW:()=>ae,COMPONENT_PALETTE:()=>pe,COMPONENT_PIE_CHART:()=>Ce,COMPONENT_SANKEY_CHART:()=>ge,COMPONENT_SCATTER_CHART:()=>Se,COMPONENT_SURFACE:()=>le,COMPONENT_SURFACE_PROVIDER:()=>Ut,COMPONENT_XY_CHART:()=>Oe,ColorPickerComponent:()=>qt,ColumnChartComponent:()=>be,ControlsComponent:()=>Jt,DEFAULT_SHAPE_HEIGHT:()=>bt,DEFAULT_SHAPE_WIDTH:()=>wt,DEFAULT_VUE_SURFACE_ID:()=>rt,DecoratorComponent:()=>Ze,DiagramComponent:()=>Yt,DiagramPaletteComponent:()=>Qe,DiagramProvider:()=>qe,EVENT_VERTEX_UPDATED:()=>so,EVENT_VERTICES_RENDERED:()=>no,EdgeTypePickerComponent:()=>Ye,ExportControlsComponent:()=>Kt,GaugeChartComponent:()=>ke,InspectorComponent:()=>Ke,InspectorGetterSymbol:()=>K,InspectorSetterSymbol:()=>Oo,LineChartComponent:()=>Ue,MiniviewComponent:()=>Xt,PROP_ACTIVE_TRACKING:()=>at,PROP_ALLOW_CLICK_TO_ADD:()=>Dt,PROP_ALLOW_DROP_ON_CANVAS:()=>gt,PROP_ALLOW_DROP_ON_EDGE:()=>Tt,PROP_ALLOW_DROP_ON_GROUP:()=>yt,PROP_ALLOW_DROP_ON_NODE:()=>Rt,PROP_CANVAS_DROP_FILTER:()=>Mt,PROP_CLASS_NAME:()=>w,PROP_CLICK_TO_ADD_ONLY:()=>xt,PROP_CLICK_TO_CENTER:()=>st,PROP_CSV_DATA:()=>ft,PROP_DATA:()=>b,PROP_DATA_GENERATOR:()=>Ct,PROP_DATA_SOURCE_FILTER:()=>De,PROP_DRAG_SIZE:()=>It,PROP_GROUP_IDENTIFIER:()=>_t,PROP_ID:()=>Lo,PROP_IGNORE_DROP_ON_NODE:()=>At,PROP_INTERACTIVE:()=>mt,PROP_JSON_DATA:()=>Ot,PROP_MODE:()=>pt,PROP_MODEL:()=>ut,PROP_MODEL_OPTIONS:()=>re,PROP_ON_VERTEX_ADDED:()=>Nt,PROP_OPTIONS:()=>U,PROP_PIVOT:()=>ht,PROP_RENDER_OPTIONS:()=>ct,PROP_SELECTOR:()=>Et,PROP_SELECT_AFTER_ADD:()=>vt,PROP_SHOW_LASSO:()=>it,PROP_SURFACE_ID:()=>y,PROP_TRACK_SELECTION:()=>lt,PROP_TYPE_FUNCTION:()=>nt,PROP_TYPE_GENERATOR:()=>St,PROP_URL:()=>V,PROP_USE_MODEL:()=>Pt,PROP_VIEW_OPTIONS:()=>dt,PaletteComponent:()=>Zt,PieChartComponent:()=>Be,SankeyChartComponent:()=>He,ScatterChartComponent:()=>je,ShapeComponent:()=>We,ShapePaletteComponent:()=>Je,SurfaceComponent:()=>Wt,SurfaceProvider:()=>$e,TAG_COLOR_PICKER:()=>Vt,TAG_DECORATOR:()=>jt,TAG_EDGE_TYPE_PICKER:()=>ie,TAG_SHAPE:()=>ne,TAG_SHAPE_PALETTE:()=>se,VisuallyJsPlugin:()=>Ko,VisuallyJsService:()=>R,VisuallyJsServiceKey:()=>i,XYChartComponent:()=>Le,addSurface:()=>$t,bindToDevLifecycle:()=>jo,doProvideInspector:()=>Po,newInstance:()=>Vo,useDiagram:()=>qo,usePaper:()=>Qo,useSurface:()=>Zo,useVisuallyJsUpdate:()=>Yo,useZoom:()=>Xo});module.exports=bo(er);var xe=require("@visuallyjs/browser-ui"),N=class extends xe.BrowserUIModel{render(t,o){return(0,xe.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Vo(e){return e=e||{},new N(e)}var rt="surfaceId",nt="typeFunction",st="clickToCenter",it="showLasso",at="activeTracking",lt="trackSelection",y="surfaceId",w="className",b="data",pt="mode",U="options",ct="renderOptions",re="modelOptions",ut="model",dt="viewOptions",V="url",mt="interactive",ht="pivot",De="dataSourceFilter",ft="csvData",Ot="jsonData",Pt="useModel",Lo="id",Et="selector",Ct="dataGenerator",St="typeGenerator",_t="groupIdentifier",Tt="allowDropOnEdge",gt="allowDropOnCanvas",yt="allowDropOnGroup",Rt="allowDropOnNode",At="ignoreDropOnNode",Nt="onVertexAdded",vt="selectAfterAdd",xt="clickToAddOnly",Dt="allowClickToAdd",It="dragSize",Mt="canvasDropFilter",ne="Shape",se="ShapePalette",wt=120,bt=90,ie="EdgeTypePickerComponent",Vt="ColorPickerComponent",Lt="vjs-vue-node",Bt="vjs-vue-group",ae="MiniviewComponent",le="SurfaceComponent",Ut="SurfaceProvider",Gt="DiagramProvider",pe="PaletteComponent",ce="ControlsComponent",ue="ExportControlsComponent",de="DiagramComponent",me="DiagramPaletteComponent",he="ColumnChartComponent",fe="BarChartComponent",Oe="XYChartComponent",Pe="LineChartComponent",Ee="AreaChartComponent",Ce="PieChartComponent",Se="ScatterChartComponent",_e="BubbleChartComponent",Te="GaugeChartComponent",ge="SankeyChartComponent",ye="InspectorComponent",jt="Decorator";var G=require("vue"),c=require("@visuallyjs/browser-ui"),Ft=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new c.OptimisticEventGenerator}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(no)}vertexHasUpdated(t){this.eventManager.fire(so,t)}},no="vertices:rendered",so="vertex:updated",kt=new Map;function Ie(e){return kt.has(e)||kt.set(e,new Ft),kt.get(e)}function Bo(e,t){Ie(e).vertexHasRendered(t)}function Uo(e,t){Ie(e).vertexHasUpdated(t)}function Go(e,t){Ie(e).vertexWillRender(t)}function jo(e,t,o){Ie(e).eventManager.bind(t,o)}var oo={props:{data:Object,model:N,obj:c.Vertex,vertex:c.Vertex,ui:c.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,c.isGroup)(e.obj)?Bt:Lt;e.el.firstElementChild&&(0,c.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Bo(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Uo(this.ui.id,this.obj)}},io={mixins:[oo],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},ao={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[oo]},Ht=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},ro=(e,t,o,n,s,a,l,h,E)=>{let O=l.component!=null,D=(0,c.isGroup)(h),I=[];O||I.push(D?c.CLASS_DEFAULT_GROUP:c.CLASS_DEFAULT_NODE);let T=O?l.component:{render(g){return g.data.label||""}};if(T){let g=document.createElement(c.ELEMENT_DIV);(0,c.updateClasses)(g,I),T.mixins==null&&(T.mixins=[]);let M=D?ao:io;T.mixins.find(Ne=>Ne===M)||T.mixins.push(M),Go(a.id,h);let Ae={data:o,model:(0,G.markRaw)(n),ui:(0,G.markRaw)(a),obj:h,vertex:h,el:g,def:(0,G.markRaw)(l),eventInfo:E==null?null:(0,G.markRaw)(E)};if(l.inject)for(let Ne in l.inject){let ot=l.inject[Ne],Ao=typeof ot=="function"?ot(h,n):ot;Ae[Ne]=Ao}e.push({component:(0,G.markRaw)(T),el:g,o:h.getFullId(),props:Ae})}};function $t(e,t,o,n,s,a){let l={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(E,O,D,I)=>{},render:(E,O,D,I,T,g,M,Re)=>ro(n,E,O,D,I,T,g,M,Re),cleanupVertex:Ht,cleanupPort:Ht,rerender:(E,O,D,I,T,g,M,Re,Ae)=>{Ht(M.id,Ae),ro(n,E,O,D,I,T,g,M,Re)}},h=(0,c.extend)(s||{},{view:a||{},id:t});return(0,c.renderSurface)(e,o,l,h)}var L=require("@visuallyjs/browser-ui"),j=require("vue"),i=Symbol.for("visuallyjs-service"),R=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=(0,j.shallowRef)(null);this.model=(0,j.shallowRef)(null);this.paper=(0,j.shallowRef)(null);this.diagram=(0,j.shallowRef)(null);this.ui=(0,j.shallowRef)(null)}getSurface(t){this.e(this.i,t,this.p)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.l,t,this.u)}getModel(t){this.e(this.s,t,this.r)}getModelDirect(){return this.r}e(t,o,n){if(n!=null)try{o(n)}catch(s){(0,L.log)(`WARN: could not dispatch ${s}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.t(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof L.Surface?this.setSurface(t.$ui):t.$ui instanceof L.Paper&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.t(this.l,t)}n(t){this.r=t,this.t(this.s,t)}t(t,o){t.forEach(n=>{try{n(o)}catch(s){(0,L.log)(`WARN: could not flush all queue entries ${s}`)}})}};var v=require("vue"),f=require("@visuallyjs/browser-ui"),Wt={setup(e){return{service:(0,v.inject)(i),surfaceId:e.surfaceId||rt}},name:le,props:{[b]:{type:Object},[ct]:{type:Object},[re]:{type:Object},[dt]:{type:Object},[ut]:{type:Object},[V]:{type:String},[y]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=this.model||new N(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.surface=$t(t,this.surfaceId,o,this.vertices,(0,f.clone)(this.renderOptions||{}),(0,f.clone)(this.viewOptions||{})),this.service.setSurface(this.surface);let n=(a,l)=>{let h=()=>{let O={};return l.originalData||l.updates?O=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(O,l.newData),O},E=this.vertices.find(O=>O.o===a);E!=null&&(E.props.data=h())},s=a=>{let l=this.vertices.findIndex(h=>h.o===a);l!==-1&&this.vertices.splice(l,1)};t.bind(f.EVENT_NODE_UPDATED,a=>{n(a.vertex.getFullId(),a)}),t.bind(f.EVENT_GROUP_UPDATED,a=>{n(a.vertex.getFullId(),a)}),t.bind(f.EVENT_NODE_REMOVED,a=>{s(a.node.id)}),t.bind(f.EVENT_GROUP_REMOVED,a=>{s(a.group.id)}),this.surface.bind(f.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return(0,v.h)(f.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>(0,v.h)(v.Teleport,{to:e.el,key:e.o},[(0,v.h)(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var p=require("vue"),r=require("@visuallyjs/browser-ui"),Fo="Clear dataset?",zt="vjs-selected-mode",lo="can-undo",po="can-redo",ko="data-undo",Ho="data-redo",co="data-mode",$o="data-reset",Wo="data-clear",zo="data-zoom-in",Jo="data-zoom-out",uo="vjs-controls-has-selection",Jt={setup(e){return{service:(0,p.inject)(i)}},name:ce,props:{clear:{type:Boolean,default:!0},[y]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Fo},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(r.SURFACE_MODE_PAN)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(r.SURFACE_MODE_SELECT)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),(0,r.supportsPathEditing)(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(uo):this.$refs.root.setAttribute(uo,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,p.h)("i",{class:`vjs-pan-mode ${zt}`,[co]:r.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,p.h)("svg",{viewBox:r.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,p.h)("path",{d:r.PAN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-select-mode",[co]:r.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,p.h)("svg",{viewBox:r.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,p.h)("i",{class:"vjs-undo",[ko]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push((0,p.h)("i",{class:"vjs-redo",[Ho]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push((0,p.h)("i",{class:"vjs-zoom-to-fit",[$o]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,p.h)("svg",{viewBox:r.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,p.h)("i",{class:"vjs-zoom-in",[zo]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_IN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-zoom-out",[Jo]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_OUT_PATH})])]))),e.push((0,p.h)("i",{class:r.CLASS_CONTROLS_RESET_SELECTION,[r.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,p.h)("svg",{viewBox:r.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,p.h)("i",{class:"vjs-clear-dataset",[Wo]:"true",onClick:()=>{this.doClear()}},[(0,p.h)("svg",{viewBox:r.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.CLEAR_PATH})])])),(0,p.h)(r.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[lo]:!1,[po]:!1,[r.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,p.h)(r.ELEMENT_DIV,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(r.LassoPlugin.type);this.showPan=o!=null,t.bind(r.EVENT_SURFACE_MODE_CHANGED,n=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),zt),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+n+"']"),zt)}),t.model.bind(r.EVENT_UNDOREDO_UPDATE,n=>{this.$refs.root.setAttribute(lo,n.undoCount>0?r.TRUE:r.FALSE),this.$refs.root.setAttribute(po,n.redoCount>0?r.TRUE:r.FALSE)}),t.model.bind(r.EVENT_SELECT,()=>this.updateSelectionState()),t.model.bind(r.EVENT_DESELECT,()=>this.updateSelectionState()),t.model.bind(r.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?(0,p.watch)(this.service.surface,e):e(this.service.surface.value)}};var C=require("vue"),m=require("@visuallyjs/browser-ui"),Kt={name:ue,setup(e){return{service:(0,C.inject)(i)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new m.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,n=this.allowJpgExport!==!1,s=[];return t&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),o&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),n&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift((0,C.h)("span",{},[this.label])),(0,C.h)(m.ELEMENT_DIV,{class:`${m.CLASS_CONTROLS} ${m.CLASS_EXPORT_CONTROLS}`},s)}};var F=require("vue"),Me=require("@visuallyjs/browser-ui"),Xt={setup(e){return{service:(0,F.inject)(i)}},name:ae,props:{[y]:{type:String},[w]:{type:String,default:""},[at]:{type:Boolean,default:!0},[st]:{type:Boolean,default:!0},[it]:{type:Boolean,default:!0},[lt]:{type:Boolean,default:!0},[nt]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:Me.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):(0,F.watch)(this.service.surface,e)},render:function(e){return(0,F.h)(Me.ELEMENT_DIV,{ref:"root",class:e.className})}};var k=require("vue"),we=require("@visuallyjs/browser-ui"),Yt={setup(e){return{service:(0,k.inject)(i)}},name:de,props:{[b]:{type:Object},[V]:{type:String},[re]:{type:Object},[U]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,k.markRaw)((0,we.createDiagram)(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,k.h)(we.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var x=require("vue"),u=require("@visuallyjs/browser-ui"),mo={[w]:{type:String},[b]:{type:Object},[V]:{type:String},[Pt]:{type:Boolean,default:!1}},ho={setup(){return{service:(0,x.inject)(i)}},render:function(){return(0,x.h)(u.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function A(e,t,o=!0){let n=oe(te({},mo),{[U]:{type:Object}}),s={};return o&&(n[De]={type:Function},s[De]=function(a){this.chart.setDataSourceFilter(a)}),oe(te({},ho),{name:e,props:n,watch:s,data:()=>({hasMounted:!1}),mounted(){let a=this.$refs.root,l=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(l.data=this.data),this.url&&(l.url=this.url);let h=()=>{this.hasMounted=!0,this.chart=new t(a,l)};this.useModel?this.service.model.value!=null?(l.dataSource=this.service.model.value,h()):(0,x.watch)(this.service.model,E=>{this.hasMounted||(l.dataSource=E,h())}):h()}})}var be=A(he,u.ColumnChart),Ve=A(fe,u.BarChart),Le=A(Oe,u.CategoryValueChart,!1),Be=A(Ce,u.PieChart),Ue=A(Pe,u.LineChart),Ge=A(Ee,u.AreaChart),je=A(Se,u.ScatterChart),Fe=A(_e,u.BubbleChart),ke=A(Te,u.GaugeChart,!1),He=oe(te({},ho),{name:ge,props:oe(te({},mo),{[ft]:{type:String},[Ot]:{type:Object},[mt]:{type:Boolean},[ht]:{type:String},[U]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new u.SankeyChart(e,t)};if(this.useModel){let n=s=>{this.hasMounted||(t.dataSource=s,o())};this.service.model.value==null?(0,x.watch)(this.service.model,n):n(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return(0,x.h)(u.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}});var H=require("vue"),$=require("@visuallyjs/browser-ui"),Zt={setup(e){return{service:(0,H.inject)(i)}},name:pe,props:{[y]:{type:String},[Et]:{type:String},[Ct]:{type:Function},[St]:{type:Function},[_t]:{type:Function},[Tt]:{type:Boolean,default:!1},[gt]:{type:Boolean,default:!0},[yt]:{type:Boolean,default:!0},[Rt]:{type:Boolean,default:!1},[At]:{type:Boolean,default:!1},[It]:Object,[Nt]:Function,[Mt]:Function,[w]:String,[pt]:String,[vt]:{type:Boolean,default:!1},[Dt]:{type:Boolean,default:!1},[xt]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:n=>this.dataGenerator?this.dataGenerator(n):(0,$.defaultDataGenerator)(n),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new $.Palette(t,o)};this.service.surface.value==null?(0,H.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,H.h)($.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var fo=require("vue"),$e={setup(){(0,fo.provide)(i,new R("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var W=require("vue"),S=require("@visuallyjs/browser-ui"),We={name:ne,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:S.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,W.inject)(i)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),n=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(n),this.showLabels){let s=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(s),this.multilineLabels!=!1&&(0,S.convertToMultilineText)(s,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||S.DEFAULT_LABEL_FILL_RATIO))}};this.service.ui.value==null?(0,W.watch)(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&(0,S.convertToMultilineText)(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||S.DEFAULT_LABEL_FILL_RATIO))}}},render:function(){return(0,W.h)(S.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:S.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||wt},getHeight:function(){return this.data.height||bt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var z=require("vue"),ze=require("@visuallyjs/browser-ui"),Je={name:se,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:(0,z.inject)(i)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new ze.ShapePalette(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?(0,z.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,z.h)(ze.ELEMENT_DIV,{ref:"container"})}};var _=require("vue"),J=require("@visuallyjs/browser-ui"),K=Symbol.for("VueInspectorGetter"),Oo=Symbol.for("VueInspectorSetter");function Po(){let e=[],t=null;function o(a){try{a(t)}catch(l){(0,J.log)("WARN: inspector listener threw an exception",l)}}let n={listen:a=>{t!=null?o(a):e.push(a)}},s={inspector:a=>{t=a,e.forEach(o)}};return(0,_.provide)(Oo,s),(0,_.provide)(K,(0,_.readonly)(n)),s}var Ke={name:ye,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=Po();return{service:(0,_.inject)(i),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new J.Inspector({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(n,s)=>{this.emit("update:modelValue",n),this.refresh&&this.refresh(n),setTimeout(s)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?(0,_.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,_.h)(J.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var Xe=require("vue"),X=require("@visuallyjs/browser-ui"),Ye={name:ie,props:{propertyName:String},setup(){return{inspectorProvider:(0,Xe.inject)(K)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new X.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,n)=>{e.setValue(this.propertyName,n)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,X.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,Xe.h)(X.ELEMENT_DIV,{ref:"container"})}};var B=require("vue"),d=require("@visuallyjs/browser-ui"),qt={render(){let e=this.swatches.map(t=>(0,B.h)(d.ELEMENT_DIV,{title:t,class:d.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,B.h)(d.ELEMENT_DIV,{class:`${d.CLASS_COLOR_PICKER}`},[(0,B.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,B.h)(d.ELEMENT_DIV,{class:d.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:d.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:d.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:d.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,B.inject)(K);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(d.EVENT_CONTEXT_UPDATE,o=>{o.key===d.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(n=>n.toUpperCase()===e)!=null)){let n=this.maxColors||10,s=t.slice();s.unshift(e),s.length>n&&(s.length=n),this.inspector.updateContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var P=require("vue"),Y=require("@visuallyjs/browser-ui"),Ze={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:(0,P.inject)(i)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};(0,P.nextTick)().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?(0,P.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,P.h)(Y.ELEMENT_DIV,{ref:"root"},this.hasMounted?this.placement==="floating"?(0,P.h)(Y.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,P.h)(P.Teleport,{to:this.surface.vertexLayer,key:(0,Y.uuid)()},(0,P.h)(Y.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var Eo=require("vue"),qe={setup(){(0,Eo.provide)(i,new R("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Z=require("vue"),q=require("@visuallyjs/browser-ui"),Qe={name:me,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:(0,Z.inject)(i)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)(0,q.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new q.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):(0,Z.watch)(this.service.diagram,e)}},render:function(){return(0,Z.h)(q.ELEMENT_DIV,{ref:"container"})}};var Ko={install:function(e,t){e.component(Ut,$e),e.component(Gt,qe),e.component(le,Wt),e.component(de,Yt),e.component(ae,Xt),e.component(ce,Jt),e.component(ue,Kt),e.component(pe,Zt),e.component(me,Qe),e.component(fe,Ve),e.component(he,be),e.component(Oe,Le),e.component(Pe,Ue),e.component(Ee,Ge),e.component(Ce,Be),e.component(ge,He),e.component(Te,ke),e.component(_e,Fe),e.component(Se,je),e.component(ne,We),e.component(se,Je),e.component(ie,Ye),e.component(Vt,qt),e.component(ye,Ke),e.component(jt,Ze),e.provide(i,new R("root"))}};var Q=require("vue"),et=require("@visuallyjs/browser-ui"),Co=require("vue");function Xo(){let e=(0,Co.inject)(i),t=(0,Q.shallowRef)(null),o=(0,Q.shallowRef)(null),n=(0,Q.shallowRef)(null),s=(0,Q.ref)(1);return e==null||e.getSurface(a=>{o.value=a,o.value.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),e==null||e.getDiagram(a=>{t.value=a,t.value.$ui.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),e==null||e.getPaper(a=>{n.value=a,n.value.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),s}var tt=require("vue"),ee=require("@visuallyjs/browser-ui");function Yo(e){let t=(0,tt.inject)(i);if(t){let o=null,n=()=>{o&&e(o)},s=()=>{o&&(o.unbind(ee.EVENT_DATA_UPDATED,n),o.unbind(ee.EVENT_GRAPH_CLEARED,n))},a=l=>{s(),o=l,o&&(o.bind(ee.EVENT_DATA_UPDATED,n),o.bind(ee.EVENT_GRAPH_CLEARED,n),n())};t.getModel(l=>{a(l)}),(0,tt.onUnmounted)(()=>{s()})}}var So=require("vue"),_o=require("vue");function Zo(){let e=(0,_o.inject)(i),t=(0,So.shallowRef)(null);return e==null||e.getSurface(o=>{t.value=o}),t}var To=require("vue"),go=require("vue");function qo(){let e=(0,go.inject)(i),t=(0,To.shallowRef)(null);return e==null||e.getDiagram(o=>{t.value=o}),t}var yo=require("vue"),Ro=require("vue");function Qo(){let e=(0,Ro.inject)(i),t=(0,yo.shallowRef)(null);return e==null||e.getPaper(o=>{t.value=o}),t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Qt=Object.defineProperty,eo=Object.defineProperties;var to=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var oo=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var we=(e,t,o)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,y=(e,t)=>{for(var o in t||(t={}))oo.call(t,o)&&we(e,o,t[o]);if(be)for(var o of be(t))ro.call(t,o)&&we(e,o,t[o]);return e},N=(e,t)=>eo(e,to(t));import{log as no,BrowserUIModel as io}from"@visuallyjs/browser-ui";var S=class extends io{render(t,o){return no("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function vn(e){return e=e||{},new S(e)}var Le="surfaceId",Ve="typeFunction",Be="clickToCenter",Ue="showLasso",Ge="activeTracking",Fe="trackSelection",f="surfaceId",T="className",g="data",je="mode",R="options",ke="renderOptions",b="modelOptions",He="viewOptions",A="url",$e="interactive",We="pivot",se="dataSourceFilter",ze="csvData",Ke="jsonData",Je="useModel",ri="id",Xe="selector",Ye="dataGenerator",Ze="typeGenerator",qe="groupIdentifier",Qe="allowDropOnEdge",et="allowDropOnCanvas",tt="allowDropOnGroup",ot="allowDropOnNode",rt="ignoreDropOnNode",nt="onVertexAdded",it="selectAfterAdd",st="clickToAddOnly",at="allowClickToAdd",pt="dragSize",lt="canvasDropFilter",w="Shape",L="ShapePalette",ct=120,dt=90,V="EdgeTypePickerComponent",ut="ColorPickerComponent",mt="vjs-vue-node",ht="vjs-vue-group",B="MiniviewComponent",U="SurfaceComponent",ft="SurfaceProvider",Ot="DiagramProvider",G="PaletteComponent",F="ControlsComponent",j="ExportControlsComponent",k="DiagramComponent",H="DiagramPaletteComponent",$="ColumnChartComponent",W="BarChartComponent",z="XYChartComponent",K="LineChartComponent",J="AreaChartComponent",X="PieChartComponent",Y="ScatterChartComponent",Z="BubbleChartComponent",q="GaugeChartComponent",Q="SankeyChartComponent",ee="InspectorComponent",Pt="Decorator";import{markRaw as x}from"vue";import{addClass as so,BrowserUI as ao,CLASS_DEFAULT_GROUP as po,CLASS_DEFAULT_NODE as lo,ELEMENT_DIV as co,extend as uo,isGroup as Et,OptimisticEventGenerator as mo,renderSurface as ho,updateClasses as fo,Vertex as Oo}from"@visuallyjs/browser-ui";var ae=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new mo}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(Po)}vertexHasUpdated(t){this.eventManager.fire(Eo,t)}},Po="vertices:rendered",Eo="vertex:updated",pe=new Map;function te(e){return pe.has(e)||pe.set(e,new ae),pe.get(e)}function Co(e,t){te(e).vertexHasRendered(t)}function _o(e,t){te(e).vertexHasUpdated(t)}function So(e,t){te(e).vertexWillRender(t)}function Ei(e,t,o){te(e).eventManager.bind(t,o)}var Ct={props:{data:Object,model:S,obj:Oo,ui:ao,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=Et(e.obj)?ht:mt;e.el.firstElementChild&&so(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Co(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),_o(this.ui.id,this.obj)}},To={mixins:[Ct],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},go={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[Ct]},le=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},_t=(e,t,o,r,s,i,a,l,d)=>{let c=a.component!=null,E=Et(l),C=[];c||C.push(E?po:lo);let u=c?a.component:{render(m){return m.data.label||""}};if(u){let m=document.createElement(co);fo(m,C),u.mixins==null&&(u.mixins=[]);let _=E?go:To;u.mixins.find(M=>M===_)||u.mixins.push(_),So(i.id,l);let v={data:o,model:x(r),ui:x(i),obj:l,el:m,def:x(a),eventInfo:d==null?null:x(d)};if(a.inject)for(let M in a.inject){let ie=a.inject[M],qt=typeof ie=="function"?ie(l,r):ie;v[M]=qt}e.push({component:x(u),el:m,o:l.getFullId(),props:v})}};function St(e,t,o,r,s,i){let a={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(d,c,E,C)=>{},render:(d,c,E,C,u,m,_,D)=>_t(r,d,c,E,C,u,m,_,D),cleanupVertex:le,cleanupPort:le,rerender:(d,c,E,C,u,m,_,D,v)=>{le(_.id,v),_t(r,d,c,E,C,u,m,_,D)}},l=uo(s||{},{view:i||{},id:t});return ho(e,o,a,l)}import{log as Tt,Paper as Ao,Surface as yo}from"@visuallyjs/browser-ui";var n=Symbol.for("visuallyjs-service"),O=class{constructor(t){this.context=t;this.i=[];this.s=[];this.a=[];this.p=[]}getSurface(t){this.e(this.s,t,this.l)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.p,t,this.u)}getModel(t){this.e(this.i,t,this.r)}getModelDirect(){return this.r}e(t,o,r){if(r!=null)try{o(r)}catch(s){Tt(`WARN: could not dispatch ${s}`)}else t.push(o)}setSurface(t){this.l=t,this.n(t.model),this.t(this.s,t)}setDiagram(t){this.c=t,this.n(t.model),t.$ui instanceof yo?this.setSurface(t.$ui):t.$ui instanceof Ao&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.u=t,this.n(t.model),this.t(this.p,t)}n(t){this.r=t,this.t(this.i,t)}t(t,o){t.forEach(r=>{try{r(o)}catch(s){Tt(`WARN: could not flush all queue entries ${s}`)}})}};import{h as ce,inject as No,Teleport as Ro}from"vue";import{ELEMENT_DIV as xo,EVENT_GROUP_REMOVED as Io,EVENT_GROUP_UPDATED as Do,EVENT_NODE_REMOVED as vo,EVENT_NODE_UPDATED as Mo,EVENT_RENDER_END as bo,clone as gt}from"@visuallyjs/browser-ui";var At={setup(e){return{service:No(n),surfaceId:e.surfaceId||Le}},name:U,props:{[g]:{type:Object},[ke]:{type:Object},[b]:{type:Object},[He]:{type:Object},[A]:{type:String},[f]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=new S(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.model=t,this.surface=St(t,this.surfaceId,o,this.vertices,gt(this.renderOptions||{}),gt(this.viewOptions||{})),this.service.setSurface(this.surface);let r=(i,a)=>{let l=()=>{let c={};return a.originalData||a.updates?c=Object.assign(a.originalData,a.updates):a.newData&&Object.assign(c,a.newData),c},d=this.vertices.find(c=>c.o===i);d!=null&&(d.props.data=l())},s=i=>{let a=this.vertices.findIndex(l=>l.o===i);a!==-1&&this.vertices.splice(a,1)};this.model.bind(Mo,i=>{r(i.vertex.getFullId(),i)}),this.model.bind(Do,i=>{r(i.vertex.getFullId(),i)}),this.model.bind(vo,i=>{s(i.node.id)}),this.model.bind(Io,i=>{s(i.group.id)}),this.surface.bind(bo,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return ce(xo,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>ce(Ro,{to:e.el,key:e.o},[ce(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as p,inject as wo}from"vue";import{LassoPlugin as Lo,SURFACE_MODE_SELECT as yt,SURFACE_MODE_PAN as Nt,PAN_PATH as Vo,PAN_VIEW_BOX as Bo,LASSO_PATH as Uo,LASSO_VIEW_BOX as Go,ZOOM_TO_FIT_PATH as Fo,ZOOM_TO_FIT_VIEW_BOX as jo,EVENT_UNDOREDO_UPDATE as ko,TRUE as Rt,FALSE as xt,EVENT_SURFACE_MODE_CHANGED as Ho,ELEMENT_DIV as It,ATTRIBUTE_CONTROLS_ORIENTATION as $o,ZOOM_IN_OUT_VIEW_BOX as Dt,ZOOM_IN_PATH as Wo,ZOOM_OUT_PATH as zo,RESET_SELECTION_PATH as Ko,RESET_SELECTION_VIEW_BOX as Jo,CLEAR_PATH as Xo,CLEAR_VIEW_BOX as Yo,ATTRIBUTE_RESET_SELECTION as Zo,CLASS_CONTROLS_RESET_SELECTION as qo,EVENT_SELECT as Qo,EVENT_DESELECT as er,EVENT_SELECTION_CLEARED as tr,supportsPathEditing as or}from"@visuallyjs/browser-ui";var rr="Clear dataset?",de="vjs-selected-mode",vt="can-undo",Mt="can-redo",nr="data-undo",ir="data-redo",bt="data-mode",sr="data-reset",ar="data-clear",pr="data-zoom-in",lr="data-zoom-out",wt="vjs-controls-has-selection",Lt={setup(e){return{service:wo(n)}},name:F,props:{clear:{type:Boolean,default:!0},[f]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:rr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){this.service.getSurface(e=>e.setMode(Nt))},selectMode:function(){this.service.getSurface(e=>e.setMode(yt))},zoomToFit:function(){this.service.getSurface(e=>e.zoomToFit())},doClear:function(){this.service.getSurface(e=>{this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear()})},undo:function(){this.service.getModel(e=>e.undo())},redo:function(){this.service.getModel(e=>e.redo())},zoomIn:function(){this.service.getSurface(e=>e.zoomIn())},zoomOut:function(){this.service.getSurface(e=>e.zoomOut())},resetSelection(){this.service.getSurface(e=>{e.model.clearSelection(),or(e)&&e.stopEditingPath()})},updateSelectionState:function(){this.service.getSurface(e=>{e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(wt):this.$refs.root.setAttribute(wt,"true")})}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(p("i",{class:`vjs-pan-mode ${de}`,[bt]:Nt,onClick:()=>this.panMode(),title:"Pan mode"},[p("svg",{viewBox:Bo,stroke:"currentColor",fill:"none"},[p("path",{d:Vo})])])),e.push(p("i",{class:"vjs-select-mode",[bt]:yt,onClick:()=>this.selectMode(),title:"Select mode"},[p("svg",{viewBox:Go,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Uo})])]))),this.undoRedo&&(e.push(p("i",{class:"vjs-undo",[nr]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push(p("i",{class:"vjs-redo",[ir]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push(p("i",{class:"vjs-zoom-to-fit",[sr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[p("svg",{viewBox:jo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Fo})])])),this.zoomButtons&&(e.push(p("i",{class:"vjs-zoom-in",[pr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[p("svg",{viewBox:Dt,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Wo})])])),e.push(p("i",{class:"vjs-zoom-out",[lr]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[p("svg",{viewBox:Dt,stroke:"currentColor",fill:"currentColor"},[p("path",{d:zo})])]))),e.push(p("i",{class:qo,[Zo]:"true",onClick:()=>{this.resetSelection()}},[p("svg",{viewBox:Jo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Ko})])])),this.clear&&e.push(p("i",{class:"vjs-clear-dataset",[ar]:"true",onClick:()=>{this.doClear()}},[p("svg",{viewBox:Yo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Xo})])])),p(It,{class:`vjs-controls ${this.className}`,ref:"root",[vt]:!1,[Mt]:!1,[$o]:this.orientation},e)}else return p(It,{ref:"root"})},mounted(){this.service.getSurface(e=>{let t=e.getPlugin(Lo.type);this.showPan=t!=null,e.bind(Ho,o=>{e.removeClass(e.$getSelector(this.$refs.root,"[data-mode]"),de),e.addClass(e.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),de)}),e.model.bind(ko,o=>{this.$refs.root.setAttribute(vt,o.undoCount>0?Rt:xt),this.$refs.root.setAttribute(Mt,o.redoCount>0?Rt:xt)}),e.model.bind(Qo,()=>this.updateSelectionState()),e.model.bind(er,()=>this.updateSelectionState()),e.model.bind(tr,()=>this.updateSelectionState()),this.ready=!0})}};import{h as P,inject as cr}from"vue";import{CLASS_CONTROLS as dr,CLASS_EXPORT_CONTROLS as ur,ELEMENT_DIV as mr,ImageExportUI as Vt,SvgExportUI as hr,TYPE_JPG as fr,TYPE_PNG as Or,TYPE_SVG as Pr}from"@visuallyjs/browser-ui";var Bt={name:j,setup(e){return{service:cr(n)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){this.service.getSurface(e)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new hr(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new Vt(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Vt(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,r=this.allowJpgExport!==!1,s=[];return t&&s.push(P("i",{},[P("a",{href:"#","data-type":Pr,onClick:()=>this.exportSVG()},"SVG")])),o&&s.push(P("i",{},[P("a",{href:"#","data-type":Or,onClick:()=>this.exportPNG()},"PNG")])),r&&s.push(P("i",{},[P("a",{href:"#","data-type":fr,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift(P("span",{},[this.label])),P(mr,{class:`${dr} ${ur}`},s)}};import{h as Er,inject as Cr}from"vue";import{ELEMENT_DIV as _r,MiniviewPlugin as Sr}from"@visuallyjs/browser-ui";var Ut={setup(e){return{service:Cr(n)}},name:B,props:{[f]:{type:String},[T]:{type:String,default:""},[Ge]:{type:Boolean,default:!0},[Be]:{type:Boolean,default:!0},[Ue]:{type:Boolean,default:!0},[Fe]:{type:Boolean,default:!0},[Ve]:{type:Function}},mounted:function(){this.service.getSurface(e=>{e.addPlugin({type:Sr.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})})},render:function(e){return Er(_r,{ref:"root",class:e.className})}};import{h as Tr,inject as gr}from"vue";import{createDiagram as Ar,ELEMENT_DIV as yr}from"@visuallyjs/browser-ui";var Gt={setup(e){return{service:gr(n)}},name:k,props:{[g]:{type:Object},[A]:{type:String},[b]:{type:Object},[R]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=Ar(e,this.options,this.modelOptions),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return Tr(yr,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Ft,inject as Nr}from"vue";import{ColumnChart as Rr,BarChart as xr,CategoryValueChart as Ir,ELEMENT_DIV as jt,LineChart as Dr,AreaChart as vr,PieChart as Mr,ScatterChart as br,BubbleChart as wr,GaugeChart as Lr,SankeyChart as Vr}from"@visuallyjs/browser-ui";var kt={[T]:{type:String},[g]:{type:Object},[A]:{type:String},[Je]:{type:Boolean,default:!1}},Ht={setup(){return{service:Nr(n)}},render:function(){return Ft(jt,{class:`${this.className}`,ref:"root"})}};function h(e,t,o=!0){let r=N(y({},kt),{[R]:{type:Object}}),s={};return o&&(r[se]={type:Function},s[se]=function(i){this.chart.setDataSourceFilter(i)}),N(y({},Ht),{name:e,props:r,watch:s,mounted(){let i=this.$refs.root,a=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(a.data=this.data),this.url&&(a.url=this.url);let l=()=>{this.chart=new t(i,a)};this.useModel?this.service.getModel(d=>{a.dataSource=d,l()}):l()}})}var ue=h($,Rr),me=h(W,xr),he=h(z,Ir,!1),fe=h(X,Mr),Oe=h(K,Dr),Pe=h(J,vr),Ee=h(Y,br),Ce=h(Z,wr),_e=h(q,Lr,!1),Se=N(y({},Ht),{name:Q,props:N(y({},kt),{[ze]:{type:String},[Ke]:{type:Object},[$e]:{type:Boolean},[We]:{type:String},[R]:{type:Object}}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.chart=new Vr(e,t)};this.useModel?this.service.getModel(r=>{t.dataSource=r,o()}):o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return Ft(jt,{class:`${this.className}`,ref:"root"})}});import{h as Br,inject as Ur}from"vue";import{defaultDataGenerator as Gr,ELEMENT_DIV as Fr,Palette as jr}from"@visuallyjs/browser-ui";var $t={setup(e){return{service:Ur(n)}},name:G,props:{[f]:{type:String},[Xe]:{type:String},[Ye]:{type:Function},[Ze]:{type:Function},[qe]:{type:Function},[Qe]:{type:Boolean,default:!1},[et]:{type:Boolean,default:!0},[tt]:{type:Boolean,default:!0},[ot]:{type:Boolean,default:!1},[rt]:{type:Boolean,default:!1},[pt]:Object,[nt]:Function,[lt]:Function,[T]:String,[je]:String,[it]:{type:Boolean,default:!1},[at]:{type:Boolean,default:!1},[st]:{type:Boolean,default:!1}},mounted:function(){let e=this;this.service.getSurface(t=>{let o={source:this.$refs.root,selector:e.selector,dataGenerator:r=>e.dataGenerator?e.dataGenerator(r):Gr(r),allowDropOnEdge:e.allowDropOnEdge===!0,allowDropOnGroup:e.allowDropOnGroup!==!1,allowDropOnCanvas:e.allowDropOnCanvas!==!1,allowDropOnNode:e.allowDropOnNode===!0,ignoreDropOnNode:e.ignoreDropOnNode===!0,canvasDropFilter:e.canvasDropFilter,onVertexAdded:e.onVertexAdded,dragSize:e.dragSize,mode:e.mode};e.groupIdentifier!=null&&(o.groupIdentifier=e.groupIdentifier),e.typeGenerator!=null&&(o.typeGenerator=e.typeGenerator),this.palette=new jr(t,o)})},render:function(){return Br(Fr,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as kr}from"vue";var Te={setup(){kr(n,new O("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Hr,inject as $r}from"vue";import{CLASS_SHAPE as Wr,convertToMultilineText as Wt,DEFAULT_LABEL_FILL_RATIO as ge,ELEMENT_SVG as zr}from"@visuallyjs/browser-ui";var Ae={name:w,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:ge},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:$r(n)}},mounted(){this.service.getSurface(e=>{let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(o),this.showLabels){let r=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(r),this.multilineLabels!=!1&&Wt(r,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ge))}})},updated(){this.service.getSurface(e=>{let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let r=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(r),this.multilineLabels!=!1&&Wt(r,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ge))}})},render:function(){return Hr(zr,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:Wr})},methods:{getWidth:function(){return this.data.width||ct},getHeight:function(){return this.data.height||dt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as Kr,inject as Jr}from"vue";import{ELEMENT_DIV as Xr,ShapePalette as Yr}from"@visuallyjs/browser-ui";var ye={name:L,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:Jr(n)}},mounted(){this.service.getSurface(e=>{new Yr(e,{container:this.$refs.container,shapeLibrary:e.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes})})},render:function(){return Kr(Xr,{ref:"container"})}};import{provide as zt,readonly as Zr,inject as qr,h as Qr}from"vue";import{ELEMENT_DIV as en,Inspector as tn,log as on}from"@visuallyjs/browser-ui";var I=Symbol.for("VueInspectorGetter"),rn=Symbol.for("VueInspectorSetter");function nn(){let e=[],t=null;function o(i){try{i(t)}catch(a){on("WARN: inspector listener threw an exception",a)}}let r={listen:i=>{t!=null?o(i):e.push(i)}},s={inspector:i=>{t=i,e.forEach(o)}};return zt(rn,s),zt(I,Zr(r)),s}var Ne={name:ee,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function},setup(e){let t=nn();return{service:qr(n),inspectorProvider:t}},mounted(){this.service.getSurface(e=>{let t=new tn({container:this.$refs.root,ui:e,renderEmptyContainer:this.renderEmptyContainer||(()=>console.log("rendering empty")),refresh:(o,r)=>{this.refresh&&this.refresh(o),setTimeout(r)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(e):null});this.inspectorProvider.inspector(t)})},render(){return Qr(en,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as sn,inject as an}from"vue";import{EdgeTypePicker as pn,ELEMENT_DIV as ln,log as cn}from"@visuallyjs/browser-ui";var Re={name:V,props:{propertyName:String},setup(){return{inspectorProvider:an(I)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new pn(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,r)=>{e.setValue(this.propertyName,r)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):cn("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return sn(ln,{ref:"container"})}};import{h as oe,inject as dn}from"vue";import{CLASS_COLOR_PICKER as Kt,CLASS_COLOR_PICKER_SWATCH as Jt,CLASS_COLOR_PICKER_SWATCHES as Xt,EVENT_CONTEXT_UPDATE as un,ELEMENT_DIV as xe,INSPECTOR_CONTEXT_RECENT_COLORS as re}from"@visuallyjs/browser-ui";var Yt={render(){let e=this.swatches.map(t=>oe(xe,{title:t,class:Jt,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return oe(xe,{class:`${Kt}`},[oe("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),oe(xe,{class:Xt},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:Kt,CLASS_COLOR_PICKER_SWATCHES:Xt,CLASS_COLOR_PICKER_SWATCH:Jt,colorInput:null,swatches:[]}),mounted(){let e=dn(I);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(re,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(un,o=>{o.key===re&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(re,()=>[]);if(e=e.toUpperCase(),!(t.find(r=>r.toUpperCase()===e)!=null)){let r=this.maxColors||10,s=t.slice();s.unshift(e),s.length>r&&(s.length=r),this.inspector.updateContext(re,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as ne,inject as mn,nextTick as hn,Teleport as fn}from"vue";import{ELEMENT_DIV as Ie,uuid as On}from"@visuallyjs/browser-ui";var De={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({mounted:!1,surface:null}),setup(e){return{service:mn(n)}},mounted(){this.service.getSurface(e=>{this.surface=e,this.mounted=!0;let t=this.position||{x:0,y:0};hn().then(()=>{this.placement==="floating"?e.floatElement(this.$refs.root,t):e.fixElement(this.$refs.fixedEl,t,this.constraints)})})},render(){return ne(Ie,{ref:"root"},this.mounted?this.placement==="floating"?ne(Ie,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):ne(fn,{to:this.surface.vertexLayer,key:On()},ne(Ie,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as Pn}from"vue";var ve={setup(){Pn(n,new O("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as En,inject as Cn}from"vue";import{DiagramPalette as _n,ELEMENT_DIV as Sn,log as Tn}from"@visuallyjs/browser-ui";var Me={name:H,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:Cn(n)}},mounted(){if(this.service==null&&this.diagram==null)Tn("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{new _n(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes})};this.diagram?e(this.diagram):this.service.getDiagram(e)}},render:function(){return En(Sn,{ref:"container"})}};var Vp={install:function(e,t){e.component(ft,Te),e.component(Ot,ve),e.component(U,At),e.component(k,Gt),e.component(B,Ut),e.component(F,Lt),e.component(j,Bt),e.component(G,$t),e.component(H,Me),e.component(W,me),e.component($,ue),e.component(z,he),e.component(K,Oe),e.component(J,Pe),e.component(X,fe),e.component(Q,Se),e.component(q,_e),e.component(Z,Ce),e.component(Y,Ee),e.component(w,Ae),e.component(L,ye),e.component(V,Re),e.component(ut,Yt),e.component(ee,Ne),e.component(Pt,De),e.provide(n,new O("root"))}};import{ref as gn,onMounted as An,onUnmounted as yn}from"vue";import{EVENT_ZOOM as Zt}from"@visuallyjs/browser-ui";function kp(e){let t=gn(e.getZoom()),o=r=>{t.value=r.zoom};return An(()=>{e.bind(Zt,o),t.value=e.getZoom()}),yn(()=>{e.unbind(Zt,o)}),t}export{Pe as AreaChartComponent,me as BarChartComponent,go as BaseGroupComponent,To as BaseNodeComponent,S as BrowserUIVueModel,Ce as BubbleChartComponent,ht as CLASS_VUE_GROUP,mt as CLASS_VUE_NODE,J as COMPONENT_AREA_CHART,W as COMPONENT_BAR_CHART,Z as COMPONENT_BUBBLE_CHART,$ as COMPONENT_COLUMN_CHART,F as COMPONENT_CONTROLS,k as COMPONENT_DIAGRAM,H as COMPONENT_DIAGRAM_PALETTE,Ot as COMPONENT_DIAGRAM_PROVIDER,j as COMPONENT_EXPORT_CONTROLS,q as COMPONENT_GAUGE_CHART,ee as COMPONENT_INSPECTOR,K as COMPONENT_LINE_CHART,B as COMPONENT_MINIVIEW,G as COMPONENT_PALETTE,X as COMPONENT_PIE_CHART,Q as COMPONENT_SANKEY_CHART,Y as COMPONENT_SCATTER_CHART,U as COMPONENT_SURFACE,ft as COMPONENT_SURFACE_PROVIDER,z as COMPONENT_XY_CHART,Yt as ColorPickerComponent,ue as ColumnChartComponent,Lt as ControlsComponent,dt as DEFAULT_SHAPE_HEIGHT,ct as DEFAULT_SHAPE_WIDTH,Le as DEFAULT_VUE_SURFACE_ID,De as DecoratorComponent,Gt as DiagramComponent,ve as DiagramProvider,Eo as EVENT_VERTEX_UPDATED,Po as EVENT_VERTICES_RENDERED,Re as EdgeTypePickerComponent,Bt as ExportControlsComponent,_e as GaugeChartComponent,Ne as InspectorComponent,I as InspectorGetterSymbol,rn as InspectorSetterSymbol,Oe as LineChartComponent,Ut as MiniviewComponent,Ge as PROP_ACTIVE_TRACKING,at as PROP_ALLOW_CLICK_TO_ADD,et as PROP_ALLOW_DROP_ON_CANVAS,Qe as PROP_ALLOW_DROP_ON_EDGE,tt as PROP_ALLOW_DROP_ON_GROUP,ot as PROP_ALLOW_DROP_ON_NODE,lt as PROP_CANVAS_DROP_FILTER,T as PROP_CLASS_NAME,st as PROP_CLICK_TO_ADD_ONLY,Be as PROP_CLICK_TO_CENTER,ze as PROP_CSV_DATA,g as PROP_DATA,Ye as PROP_DATA_GENERATOR,se as PROP_DATA_SOURCE_FILTER,pt as PROP_DRAG_SIZE,qe as PROP_GROUP_IDENTIFIER,ri as PROP_ID,rt as PROP_IGNORE_DROP_ON_NODE,$e as PROP_INTERACTIVE,Ke as PROP_JSON_DATA,je as PROP_MODE,b as PROP_MODEL_OPTIONS,nt as PROP_ON_VERTEX_ADDED,R as PROP_OPTIONS,We as PROP_PIVOT,ke as PROP_RENDER_OPTIONS,Xe as PROP_SELECTOR,it as PROP_SELECT_AFTER_ADD,Ue as PROP_SHOW_LASSO,f as PROP_SURFACE_ID,Fe as PROP_TRACK_SELECTION,Ve as PROP_TYPE_FUNCTION,Ze as PROP_TYPE_GENERATOR,A as PROP_URL,Je as PROP_USE_MODEL,He as PROP_VIEW_OPTIONS,$t as PaletteComponent,fe as PieChartComponent,Se as SankeyChartComponent,Ee as ScatterChartComponent,Ae as ShapeComponent,ye as ShapePaletteComponent,At as SurfaceComponent,Te as SurfaceProvider,ut as TAG_COLOR_PICKER,Pt as TAG_DECORATOR,V as TAG_EDGE_TYPE_PICKER,w as TAG_SHAPE,L as TAG_SHAPE_PALETTE,Vp as VisuallyJsPlugin,O as VisuallyJsService,n as VisuallyJsServiceKey,he as XYChartComponent,St as addSurface,Ei as bindToDevLifecycle,nn as doProvideInspector,vn as newInstance,kp as useZoom};
|
|
1
|
+
var io=Object.defineProperty,ao=Object.defineProperties;var lo=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var po=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable;var Be=(e,t,o)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,R=(e,t)=>{for(var o in t||(t={}))po.call(t,o)&&Be(e,o,t[o]);if(Le)for(var o of Le(t))co.call(t,o)&&Be(e,o,t[o]);return e},A=(e,t)=>ao(e,lo(t));import{log as uo,BrowserUIModel as mo}from"@visuallyjs/browser-ui";var _=class extends mo{render(t,o){return uo("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Qn(e){return e=e||{},new _(e)}var Ue="surfaceId",Ge="typeFunction",je="clickToCenter",Fe="showLasso",ke="activeTracking",He="trackSelection",f="surfaceId",T="className",g="data",$e="mode",N="options",We="renderOptions",b="modelOptions",ze="model",Je="viewOptions",y="url",Ke="interactive",Xe="pivot",ae="dataSourceFilter",Ye="csvData",Ze="jsonData",qe="useModel",Rs="id",Qe="selector",et="dataGenerator",tt="typeGenerator",ot="groupIdentifier",rt="allowDropOnEdge",nt="allowDropOnCanvas",st="allowDropOnGroup",it="allowDropOnNode",at="ignoreDropOnNode",lt="onVertexAdded",pt="selectAfterAdd",ct="clickToAddOnly",ut="allowClickToAdd",dt="dragSize",mt="canvasDropFilter",V="Shape",L="ShapePalette",ht=120,ft=90,B="EdgeTypePickerComponent",Ot="ColorPickerComponent",Pt="vjs-vue-node",Et="vjs-vue-group",U="MiniviewComponent",G="SurfaceComponent",Ct="SurfaceProvider",St="DiagramProvider",j="PaletteComponent",F="ControlsComponent",k="ExportControlsComponent",H="DiagramComponent",$="DiagramPaletteComponent",W="ColumnChartComponent",z="BarChartComponent",J="XYChartComponent",K="LineChartComponent",X="AreaChartComponent",Y="PieChartComponent",Z="ScatterChartComponent",q="BubbleChartComponent",Q="GaugeChartComponent",ee="SankeyChartComponent",te="InspectorComponent",_t="Decorator";import{markRaw as v}from"vue";import{addClass as ho,BrowserUI as fo,CLASS_DEFAULT_GROUP as Oo,CLASS_DEFAULT_NODE as Po,ELEMENT_DIV as Eo,extend as Co,isGroup as Tt,OptimisticEventGenerator as So,renderSurface as _o,updateClasses as To,Vertex as gt}from"@visuallyjs/browser-ui";var le=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new So}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(go)}vertexHasUpdated(t){this.eventManager.fire(yo,t)}},go="vertices:rendered",yo="vertex:updated",pe=new Map;function oe(e){return pe.has(e)||pe.set(e,new le),pe.get(e)}function Ro(e,t){oe(e).vertexHasRendered(t)}function Ao(e,t){oe(e).vertexHasUpdated(t)}function No(e,t){oe(e).vertexWillRender(t)}function js(e,t,o){oe(e).eventManager.bind(t,o)}var yt={props:{data:Object,model:_,obj:gt,vertex:gt,ui:fo,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=Tt(e.obj)?Et:Pt;e.el.firstElementChild&&ho(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Ro(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Ao(this.ui.id,this.obj)}},vo={mixins:[yt],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},xo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[yt]},ce=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Rt=(e,t,o,r,n,i,a,p,u)=>{let c=a.component!=null,E=Tt(p),C=[];c||C.push(E?Oo:Po);let d=c?a.component:{render(m){return m.data.label||""}};if(d){let m=document.createElement(Eo);To(m,C),d.mixins==null&&(d.mixins=[]);let S=E?xo:vo;d.mixins.find(w=>w===S)||d.mixins.push(S),No(i.id,p);let M={data:o,model:v(r),ui:v(i),obj:p,vertex:p,el:m,def:v(a),eventInfo:u==null?null:v(u)};if(a.inject)for(let w in a.inject){let ie=a.inject[w],so=typeof ie=="function"?ie(p,r):ie;M[w]=so}e.push({component:v(d),el:m,o:p.getFullId(),props:M})}};function At(e,t,o,r,n,i){let a={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(u,c,E,C)=>{},render:(u,c,E,C,d,m,S,I)=>Rt(r,u,c,E,C,d,m,S,I),cleanupVertex:ce,cleanupPort:ce,rerender:(u,c,E,C,d,m,S,I,M)=>{ce(S.id,M),Rt(r,u,c,E,C,d,m,S,I)}},p=Co(n||{},{view:i||{},id:t});return _o(e,o,a,p)}import{log as Nt,Paper as Do,Surface as Io}from"@visuallyjs/browser-ui";import{shallowRef as x}from"vue";var s=Symbol.for("visuallyjs-service"),O=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=x(null);this.model=x(null);this.paper=x(null);this.diagram=x(null);this.ui=x(null)}getSurface(t){this.e(this.i,t,this.p)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.l,t,this.u)}getModel(t){this.e(this.s,t,this.r)}getModelDirect(){return this.r}e(t,o,r){if(r!=null)try{o(r)}catch(n){Nt(`WARN: could not dispatch ${n}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.t(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof Io?this.setSurface(t.$ui):t.$ui instanceof Do&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.t(this.l,t)}n(t){this.r=t,this.t(this.s,t)}t(t,o){t.forEach(r=>{try{r(o)}catch(n){Nt(`WARN: could not flush all queue entries ${n}`)}})}};import{h as ue,inject as Mo,Teleport as wo}from"vue";import{ELEMENT_DIV as bo,EVENT_GROUP_REMOVED as Vo,EVENT_GROUP_UPDATED as Lo,EVENT_NODE_REMOVED as Bo,EVENT_NODE_UPDATED as Uo,EVENT_RENDER_END as Go,clone as vt}from"@visuallyjs/browser-ui";var xt={setup(e){return{service:Mo(s),surfaceId:e.surfaceId||Ue}},name:G,props:{[g]:{type:Object},[We]:{type:Object},[b]:{type:Object},[Je]:{type:Object},[ze]:{type:Object},[y]:{type:String},[f]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=this.model||new _(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.surface=At(t,this.surfaceId,o,this.vertices,vt(this.renderOptions||{}),vt(this.viewOptions||{})),this.service.setSurface(this.surface);let r=(i,a)=>{let p=()=>{let c={};return a.originalData||a.updates?c=Object.assign(a.originalData,a.updates):a.newData&&Object.assign(c,a.newData),c},u=this.vertices.find(c=>c.o===i);u!=null&&(u.props.data=p())},n=i=>{let a=this.vertices.findIndex(p=>p.o===i);a!==-1&&this.vertices.splice(a,1)};t.bind(Uo,i=>{r(i.vertex.getFullId(),i)}),t.bind(Lo,i=>{r(i.vertex.getFullId(),i)}),t.bind(Bo,i=>{n(i.node.id)}),t.bind(Vo,i=>{n(i.group.id)}),this.surface.bind(Go,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return ue(bo,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>ue(wo,{to:e.el,key:e.o},[ue(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as l,inject as jo,watch as Fo}from"vue";import{LassoPlugin as ko,SURFACE_MODE_SELECT as Dt,SURFACE_MODE_PAN as It,PAN_PATH as Ho,PAN_VIEW_BOX as $o,LASSO_PATH as Wo,LASSO_VIEW_BOX as zo,ZOOM_TO_FIT_PATH as Jo,ZOOM_TO_FIT_VIEW_BOX as Ko,EVENT_UNDOREDO_UPDATE as Xo,TRUE as Mt,FALSE as wt,EVENT_SURFACE_MODE_CHANGED as Yo,ELEMENT_DIV as bt,ATTRIBUTE_CONTROLS_ORIENTATION as Zo,ZOOM_IN_OUT_VIEW_BOX as Vt,ZOOM_IN_PATH as qo,ZOOM_OUT_PATH as Qo,RESET_SELECTION_PATH as er,RESET_SELECTION_VIEW_BOX as tr,CLEAR_PATH as or,CLEAR_VIEW_BOX as rr,ATTRIBUTE_RESET_SELECTION as nr,CLASS_CONTROLS_RESET_SELECTION as sr,EVENT_SELECT as ir,EVENT_DESELECT as ar,EVENT_SELECTION_CLEARED as lr,supportsPathEditing as pr}from"@visuallyjs/browser-ui";var cr="Clear dataset?",de="vjs-selected-mode",Lt="can-undo",Bt="can-redo",ur="data-undo",dr="data-redo",Ut="data-mode",mr="data-reset",hr="data-clear",fr="data-zoom-in",Or="data-zoom-out",Gt="vjs-controls-has-selection",jt={setup(e){return{service:jo(s)}},name:F,props:{clear:{type:Boolean,default:!0},[f]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:cr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(It)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(Dt)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),pr(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(Gt):this.$refs.root.setAttribute(Gt,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(l("i",{class:`vjs-pan-mode ${de}`,[Ut]:It,onClick:()=>this.panMode(),title:"Pan mode"},[l("svg",{viewBox:$o,stroke:"currentColor",fill:"none"},[l("path",{d:Ho})])])),e.push(l("i",{class:"vjs-select-mode",[Ut]:Dt,onClick:()=>this.selectMode(),title:"Select mode"},[l("svg",{viewBox:zo,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Wo})])]))),this.undoRedo&&(e.push(l("i",{class:"vjs-undo",[ur]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push(l("i",{class:"vjs-redo",[dr]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push(l("i",{class:"vjs-zoom-to-fit",[mr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[l("svg",{viewBox:Ko,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Jo})])])),this.zoomButtons&&(e.push(l("i",{class:"vjs-zoom-in",[fr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[l("svg",{viewBox:Vt,stroke:"currentColor",fill:"currentColor"},[l("path",{d:qo})])])),e.push(l("i",{class:"vjs-zoom-out",[Or]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[l("svg",{viewBox:Vt,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Qo})])]))),e.push(l("i",{class:sr,[nr]:"true",onClick:()=>{this.resetSelection()}},[l("svg",{viewBox:tr,stroke:"currentColor",fill:"currentColor"},[l("path",{d:er})])])),this.clear&&e.push(l("i",{class:"vjs-clear-dataset",[hr]:"true",onClick:()=>{this.doClear()}},[l("svg",{viewBox:rr,stroke:"currentColor",fill:"currentColor"},[l("path",{d:or})])])),l(bt,{class:`vjs-controls ${this.className}`,ref:"root",[Lt]:!1,[Bt]:!1,[Zo]:this.orientation},e)}else return l(bt,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(ko.type);this.showPan=o!=null,t.bind(Yo,r=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),de),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+r+"']"),de)}),t.model.bind(Xo,r=>{this.$refs.root.setAttribute(Lt,r.undoCount>0?Mt:wt),this.$refs.root.setAttribute(Bt,r.redoCount>0?Mt:wt)}),t.model.bind(ir,()=>this.updateSelectionState()),t.model.bind(ar,()=>this.updateSelectionState()),t.model.bind(lr,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?Fo(this.service.surface,e):e(this.service.surface.value)}};import{h as P,inject as Pr}from"vue";import{CLASS_CONTROLS as Er,CLASS_EXPORT_CONTROLS as Cr,ELEMENT_DIV as Sr,ImageExportUI as Ft,SvgExportUI as _r,TYPE_JPG as Tr,TYPE_PNG as gr,TYPE_SVG as yr}from"@visuallyjs/browser-ui";var kt={name:k,setup(e){return{service:Pr(s)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new _r(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new Ft(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Ft(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,r=this.allowJpgExport!==!1,n=[];return t&&n.push(P("i",{},[P("a",{href:"#","data-type":yr,onClick:()=>this.exportSVG()},"SVG")])),o&&n.push(P("i",{},[P("a",{href:"#","data-type":gr,onClick:()=>this.exportPNG()},"PNG")])),r&&n.push(P("i",{},[P("a",{href:"#","data-type":Tr,onClick:()=>this.exportJPG()},"JPG")])),e&&n.unshift(P("span",{},[this.label])),P(Sr,{class:`${Er} ${Cr}`},n)}};import{h as Rr,inject as Ar,watch as Nr}from"vue";import{ELEMENT_DIV as vr,MiniviewPlugin as xr}from"@visuallyjs/browser-ui";var Ht={setup(e){return{service:Ar(s)}},name:U,props:{[f]:{type:String},[T]:{type:String,default:""},[ke]:{type:Boolean,default:!0},[je]:{type:Boolean,default:!0},[Fe]:{type:Boolean,default:!0},[He]:{type:Boolean,default:!0},[Ge]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:xr.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):Nr(this.service.surface,e)},render:function(e){return Rr(vr,{ref:"root",class:e.className})}};import{h as Dr,inject as Ir,markRaw as Mr}from"vue";import{createDiagram as wr,ELEMENT_DIV as br}from"@visuallyjs/browser-ui";var $t={setup(e){return{service:Ir(s)}},name:H,props:{[g]:{type:Object},[y]:{type:String},[b]:{type:Object},[N]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=Mr(wr(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return Dr(br,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Wt,inject as Vr,watch as zt}from"vue";import{ColumnChart as Lr,BarChart as Br,CategoryValueChart as Ur,ELEMENT_DIV as Jt,LineChart as Gr,AreaChart as jr,PieChart as Fr,ScatterChart as kr,BubbleChart as Hr,GaugeChart as $r,SankeyChart as Wr}from"@visuallyjs/browser-ui";var Kt={[T]:{type:String},[g]:{type:Object},[y]:{type:String},[qe]:{type:Boolean,default:!1}},Xt={setup(){return{service:Vr(s)}},render:function(){return Wt(Jt,{class:`${this.className}`,ref:"root"})}};function h(e,t,o=!0){let r=A(R({},Kt),{[N]:{type:Object}}),n={};return o&&(r[ae]={type:Function},n[ae]=function(i){this.chart.setDataSourceFilter(i)}),A(R({},Xt),{name:e,props:r,watch:n,data:()=>({hasMounted:!1}),mounted(){let i=this.$refs.root,a=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(a.data=this.data),this.url&&(a.url=this.url);let p=()=>{this.hasMounted=!0,this.chart=new t(i,a)};this.useModel?this.service.model.value!=null?(a.dataSource=this.service.model.value,p()):zt(this.service.model,u=>{this.hasMounted||(a.dataSource=u,p())}):p()}})}var me=h(W,Lr),he=h(z,Br),fe=h(J,Ur,!1),Oe=h(Y,Fr),Pe=h(K,Gr),Ee=h(X,jr),Ce=h(Z,kr),Se=h(q,Hr),_e=h(Q,$r,!1),Te=A(R({},Xt),{name:ee,props:A(R({},Kt),{[Ye]:{type:String},[Ze]:{type:Object},[Ke]:{type:Boolean},[Xe]:{type:String},[N]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new Wr(e,t)};if(this.useModel){let r=n=>{this.hasMounted||(t.dataSource=n,o())};this.service.model.value==null?zt(this.service.model,r):r(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return Wt(Jt,{class:`${this.className}`,ref:"root"})}});import{h as zr,inject as Jr,watch as Kr}from"vue";import{defaultDataGenerator as Xr,ELEMENT_DIV as Yr,Palette as Zr}from"@visuallyjs/browser-ui";var Yt={setup(e){return{service:Jr(s)}},name:j,props:{[f]:{type:String},[Qe]:{type:String},[et]:{type:Function},[tt]:{type:Function},[ot]:{type:Function},[rt]:{type:Boolean,default:!1},[nt]:{type:Boolean,default:!0},[st]:{type:Boolean,default:!0},[it]:{type:Boolean,default:!1},[at]:{type:Boolean,default:!1},[dt]:Object,[lt]:Function,[mt]:Function,[T]:String,[$e]:String,[pt]:{type:Boolean,default:!1},[ut]:{type:Boolean,default:!1},[ct]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:r=>this.dataGenerator?this.dataGenerator(r):Xr(r),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new Zr(t,o)};this.service.surface.value==null?Kr(this.service.surface,e):e(this.service.surface.value)},render:function(){return zr(Yr,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as qr}from"vue";var ge={setup(){qr(s,new O("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Qr,inject as en,watch as tn}from"vue";import{CLASS_SHAPE as on,convertToMultilineText as Zt,DEFAULT_LABEL_FILL_RATIO as ye,ELEMENT_SVG as rn}from"@visuallyjs/browser-ui";var Re={name:V,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:ye},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:en(s)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),r=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(r),this.showLabels){let n=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&Zt(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ye))}};this.service.ui.value==null?tn(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let r=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(r),this.multilineLabels!=!1&&Zt(r,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ye))}}},render:function(){return Qr(rn,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:on})},methods:{getWidth:function(){return this.data.width||ht},getHeight:function(){return this.data.height||ft},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as nn,inject as sn,watch as an}from"vue";import{ELEMENT_DIV as ln,ShapePalette as pn}from"@visuallyjs/browser-ui";var Ae={name:L,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:sn(s)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new pn(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?an(this.service.surface,e):e(this.service.surface.value)},render:function(){return nn(ln,{ref:"container"})}};import{provide as qt,readonly as cn,inject as un,h as dn,watch as mn}from"vue";import{ELEMENT_DIV as hn,Inspector as fn,log as On}from"@visuallyjs/browser-ui";var D=Symbol.for("VueInspectorGetter"),Pn=Symbol.for("VueInspectorSetter");function En(){let e=[],t=null;function o(i){try{i(t)}catch(a){On("WARN: inspector listener threw an exception",a)}}let r={listen:i=>{t!=null?o(i):e.push(i)}},n={inspector:i=>{t=i,e.forEach(o)}};return qt(Pn,n),qt(D,cn(r)),n}var Ne={name:te,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=En();return{service:un(s),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new fn({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(r,n)=>{this.emit("update:modelValue",r),this.refresh&&this.refresh(r),setTimeout(n)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?mn(this.service.surface,e):e(this.service.surface.value)},render(){return dn(hn,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Cn,inject as Sn}from"vue";import{EdgeTypePicker as _n,ELEMENT_DIV as Tn,log as gn}from"@visuallyjs/browser-ui";var ve={name:B,props:{propertyName:String},setup(){return{inspectorProvider:Sn(D)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new _n(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,r)=>{e.setValue(this.propertyName,r)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):gn("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return Cn(Tn,{ref:"container"})}};import{h as re,inject as yn}from"vue";import{CLASS_COLOR_PICKER as Qt,CLASS_COLOR_PICKER_SWATCH as eo,CLASS_COLOR_PICKER_SWATCHES as to,EVENT_CONTEXT_UPDATE as Rn,ELEMENT_DIV as xe,INSPECTOR_CONTEXT_RECENT_COLORS as ne}from"@visuallyjs/browser-ui";var oo={render(){let e=this.swatches.map(t=>re(xe,{title:t,class:eo,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return re(xe,{class:`${Qt}`},[re("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),re(xe,{class:to},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:Qt,CLASS_COLOR_PICKER_SWATCHES:to,CLASS_COLOR_PICKER_SWATCH:eo,colorInput:null,swatches:[]}),mounted(){let e=yn(D);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(ne,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(Rn,o=>{o.key===ne&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(ne,()=>[]);if(e=e.toUpperCase(),!(t.find(r=>r.toUpperCase()===e)!=null)){let r=this.maxColors||10,n=t.slice();n.unshift(e),n.length>r&&(n.length=r),this.inspector.updateContext(ne,n)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as se,inject as An,nextTick as Nn,Teleport as vn,watch as xn}from"vue";import{ELEMENT_DIV as De,uuid as Dn}from"@visuallyjs/browser-ui";var Ie={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:An(s)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};Nn().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?xn(this.service.surface,e):e(this.service.surface.value)},render(){return se(De,{ref:"root"},this.hasMounted?this.placement==="floating"?se(De,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):se(vn,{to:this.surface.vertexLayer,key:Dn()},se(De,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as In}from"vue";var Me={setup(){In(s,new O("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Mn,inject as wn,watch as bn}from"vue";import{DiagramPalette as Vn,ELEMENT_DIV as Ln,log as Bn}from"@visuallyjs/browser-ui";var we={name:$,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:wn(s)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)Bn("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new Vn(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):bn(this.service.diagram,e)}},render:function(){return Mn(Ln,{ref:"container"})}};var up={install:function(e,t){e.component(Ct,ge),e.component(St,Me),e.component(G,xt),e.component(H,$t),e.component(U,Ht),e.component(F,jt),e.component(k,kt),e.component(j,Yt),e.component($,we),e.component(z,he),e.component(W,me),e.component(J,fe),e.component(K,Pe),e.component(X,Ee),e.component(Y,Oe),e.component(ee,Te),e.component(Q,_e),e.component(q,Se),e.component(Z,Ce),e.component(V,Re),e.component(L,Ae),e.component(B,ve),e.component(Ot,oo),e.component(te,Ne),e.component(_t,Ie),e.provide(s,new O("root"))}};import{shallowRef as be,ref as Un}from"vue";import{EVENT_ZOOM as Ve}from"@visuallyjs/browser-ui";import{inject as Gn}from"vue";function Cp(){let e=Gn(s),t=be(null),o=be(null),r=be(null),n=Un(1);return e==null||e.getSurface(i=>{o.value=i,o.value.bind(Ve,a=>{n.value=a.zoom})}),e==null||e.getDiagram(i=>{t.value=i,t.value.$ui.bind(Ve,a=>{n.value=a.zoom})}),e==null||e.getPaper(i=>{r.value=i,r.value.bind(Ve,a=>{n.value=a.zoom})}),n}import{inject as jn,onUnmounted as Fn}from"vue";import{EVENT_DATA_UPDATED as ro,EVENT_GRAPH_CLEARED as no}from"@visuallyjs/browser-ui";function xp(e){let t=jn(s);if(t){let o=null,r=()=>{o&&e(o)},n=()=>{o&&(o.unbind(ro,r),o.unbind(no,r))},i=a=>{n(),o=a,o&&(o.bind(ro,r),o.bind(no,r),r())};t.getModel(a=>{i(a)}),Fn(()=>{n()})}}import{shallowRef as kn}from"vue";import{inject as Hn}from"vue";function Vp(){let e=Hn(s),t=kn(null);return e==null||e.getSurface(o=>{t.value=o}),t}import{shallowRef as $n}from"vue";import{inject as Wn}from"vue";function Fp(){let e=Wn(s),t=$n(null);return e==null||e.getDiagram(o=>{t.value=o}),t}import{shallowRef as zn}from"vue";import{inject as Jn}from"vue";function Jp(){let e=Jn(s),t=zn(null);return e==null||e.getPaper(o=>{t.value=o}),t}export{Ee as AreaChartComponent,he as BarChartComponent,xo as BaseGroupComponent,vo as BaseNodeComponent,_ as BrowserUIVueModel,Se as BubbleChartComponent,Et as CLASS_VUE_GROUP,Pt as CLASS_VUE_NODE,X as COMPONENT_AREA_CHART,z as COMPONENT_BAR_CHART,q as COMPONENT_BUBBLE_CHART,W as COMPONENT_COLUMN_CHART,F as COMPONENT_CONTROLS,H as COMPONENT_DIAGRAM,$ as COMPONENT_DIAGRAM_PALETTE,St as COMPONENT_DIAGRAM_PROVIDER,k as COMPONENT_EXPORT_CONTROLS,Q as COMPONENT_GAUGE_CHART,te as COMPONENT_INSPECTOR,K as COMPONENT_LINE_CHART,U as COMPONENT_MINIVIEW,j as COMPONENT_PALETTE,Y as COMPONENT_PIE_CHART,ee as COMPONENT_SANKEY_CHART,Z as COMPONENT_SCATTER_CHART,G as COMPONENT_SURFACE,Ct as COMPONENT_SURFACE_PROVIDER,J as COMPONENT_XY_CHART,oo as ColorPickerComponent,me as ColumnChartComponent,jt as ControlsComponent,ft as DEFAULT_SHAPE_HEIGHT,ht as DEFAULT_SHAPE_WIDTH,Ue as DEFAULT_VUE_SURFACE_ID,Ie as DecoratorComponent,$t as DiagramComponent,we as DiagramPaletteComponent,Me as DiagramProvider,yo as EVENT_VERTEX_UPDATED,go as EVENT_VERTICES_RENDERED,ve as EdgeTypePickerComponent,kt as ExportControlsComponent,_e as GaugeChartComponent,Ne as InspectorComponent,D as InspectorGetterSymbol,Pn as InspectorSetterSymbol,Pe as LineChartComponent,Ht as MiniviewComponent,ke as PROP_ACTIVE_TRACKING,ut as PROP_ALLOW_CLICK_TO_ADD,nt as PROP_ALLOW_DROP_ON_CANVAS,rt as PROP_ALLOW_DROP_ON_EDGE,st as PROP_ALLOW_DROP_ON_GROUP,it as PROP_ALLOW_DROP_ON_NODE,mt as PROP_CANVAS_DROP_FILTER,T as PROP_CLASS_NAME,ct as PROP_CLICK_TO_ADD_ONLY,je as PROP_CLICK_TO_CENTER,Ye as PROP_CSV_DATA,g as PROP_DATA,et as PROP_DATA_GENERATOR,ae as PROP_DATA_SOURCE_FILTER,dt as PROP_DRAG_SIZE,ot as PROP_GROUP_IDENTIFIER,Rs as PROP_ID,at as PROP_IGNORE_DROP_ON_NODE,Ke as PROP_INTERACTIVE,Ze as PROP_JSON_DATA,$e as PROP_MODE,ze as PROP_MODEL,b as PROP_MODEL_OPTIONS,lt as PROP_ON_VERTEX_ADDED,N as PROP_OPTIONS,Xe as PROP_PIVOT,We as PROP_RENDER_OPTIONS,Qe as PROP_SELECTOR,pt as PROP_SELECT_AFTER_ADD,Fe as PROP_SHOW_LASSO,f as PROP_SURFACE_ID,He as PROP_TRACK_SELECTION,Ge as PROP_TYPE_FUNCTION,tt as PROP_TYPE_GENERATOR,y as PROP_URL,qe as PROP_USE_MODEL,Je as PROP_VIEW_OPTIONS,Yt as PaletteComponent,Oe as PieChartComponent,Te as SankeyChartComponent,Ce as ScatterChartComponent,Re as ShapeComponent,Ae as ShapePaletteComponent,xt as SurfaceComponent,ge as SurfaceProvider,Ot as TAG_COLOR_PICKER,_t as TAG_DECORATOR,B as TAG_EDGE_TYPE_PICKER,V as TAG_SHAPE,L as TAG_SHAPE_PALETTE,up as VisuallyJsPlugin,O as VisuallyJsService,s as VisuallyJsServiceKey,fe as XYChartComponent,At as addSurface,js as bindToDevLifecycle,En as doProvideInspector,Qn as newInstance,Fp as useDiagram,Jp as usePaper,Vp as useSurface,xp as useVisuallyJsUpdate,Cp as useZoom};
|
package/vue-wrapper.d.ts
CHANGED
|
@@ -4,11 +4,35 @@ import { BrowserUI, ObjectData, Vertex, BrowserUIModel } from "@visuallyjs/brows
|
|
|
4
4
|
* @group Props
|
|
5
5
|
*/
|
|
6
6
|
export interface VueWrapperProps<T extends Vertex = Vertex> {
|
|
7
|
+
/**
|
|
8
|
+
* Data that backs the vertex. Reactive.
|
|
9
|
+
*/
|
|
7
10
|
data: ObjectData;
|
|
11
|
+
/**
|
|
12
|
+
* Underlying model.
|
|
13
|
+
*/
|
|
8
14
|
model: BrowserUIModel;
|
|
15
|
+
/**
|
|
16
|
+
* Underlying UI
|
|
17
|
+
*/
|
|
9
18
|
ui: BrowserUI;
|
|
19
|
+
/**
|
|
20
|
+
* The vertex (node or group) that is being rendered
|
|
21
|
+
* @deprecated use `vertex` from 1.2.0 onwards
|
|
22
|
+
*/
|
|
10
23
|
obj: T;
|
|
24
|
+
/**
|
|
25
|
+
* The vertex (node or group) that is being rendered
|
|
26
|
+
* @since 1.2.0
|
|
27
|
+
*/
|
|
28
|
+
vertex: T;
|
|
29
|
+
/**
|
|
30
|
+
* The underlying DOM element
|
|
31
|
+
*/
|
|
11
32
|
el: any;
|
|
33
|
+
/**
|
|
34
|
+
* Definition for this node/group type
|
|
35
|
+
*/
|
|
12
36
|
def: any;
|
|
13
37
|
eventInfo: any;
|
|
14
38
|
}
|