@visuallyjs/browser-ui-vue 1.1.3 → 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 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;
@@ -1,63 +1 @@
1
- import { ControlsComponentProps } from "./definitions";
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;
@@ -32,7 +32,7 @@ declare const DecoratorComponent: {
32
32
  };
33
33
  };
34
34
  data: () => {
35
- mounted: boolean;
35
+ hasMounted: boolean;
36
36
  surface: Surface;
37
37
  };
38
38
  setup(props: DecoratorComponentProps): {
package/definitions.d.ts CHANGED
@@ -2,7 +2,9 @@ import { BrowserElement, CanvasDropFilter, DataGeneratorFunction, GroupIdentifie
2
2
  export declare const DEFAULT_VUE_SURFACE_ID = "surfaceId";
3
3
  export declare const PROP_TYPE_FUNCTION = "typeFunction";
4
4
  export declare const PROP_CLICK_TO_CENTER = "clickToCenter";
5
+ export declare const PROP_SHOW_LASSO = "showLasso";
5
6
  export declare const PROP_ACTIVE_TRACKING = "activeTracking";
7
+ export declare const PROP_TRACK_SELECTION = "trackSelection";
6
8
  export declare const PROP_SURFACE_ID = "surfaceId";
7
9
  export declare const PROP_CLASS_NAME = "className";
8
10
  export declare const PROP_DATA = "data";
@@ -10,6 +12,7 @@ export declare const PROP_MODE = "mode";
10
12
  export declare const PROP_OPTIONS = "options";
11
13
  export declare const PROP_RENDER_OPTIONS = "renderOptions";
12
14
  export declare const PROP_MODEL_OPTIONS = "modelOptions";
15
+ export declare const PROP_MODEL = "model";
13
16
  export declare const PROP_VIEW_OPTIONS = "viewOptions";
14
17
  export declare const PROP_URL = "url";
15
18
  export declare const PROP_INTERACTIVE = "interactive";
@@ -222,6 +225,14 @@ export interface MiniviewComponentProps {
222
225
  * miniview is attached to.
223
226
  */
224
227
  clickToCenter?: boolean;
228
+ /**
229
+ * Defaults to true - the miniview will display a lasso as the user is using the lasso in the canvas
230
+ */
231
+ showLasso?: boolean;
232
+ /**
233
+ * Defaults to true - the miniview will add a CSS class to elements whose model object is in the current selection.
234
+ */
235
+ trackSelection?: boolean;
225
236
  }
226
237
  /**
227
238
  * Supported props for the {@link SurfaceComponent}.
@@ -370,15 +381,21 @@ export interface InspectorComponentProps {
370
381
  filter?: (b: Base) => boolean;
371
382
  /**
372
383
  * Callback invoked when the inspector is cleared.
373
- * @internal
384
+ * @deprecated Use `v-model` approach instead
374
385
  */
375
386
  renderEmptyContainer: () => void;
376
387
  /**
377
388
  * Callback invoked when a new object has started to be edited.
378
389
  * @param obj
379
390
  * @param cb
391
+ * @deprecated Use `v-model` approach instead
380
392
  */
381
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;
382
399
  /**
383
400
  * Optional extra css classes to set on the root element
384
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';
@@ -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
- setup(props: InspectorComponentProps): {
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, {
@@ -23,6 +23,14 @@ export declare const MiniviewComponent: {
23
23
  type: BooleanConstructor;
24
24
  default: boolean;
25
25
  };
26
+ showLasso: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ trackSelection: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
26
34
  typeFunction: {
27
35
  type: FunctionConstructor;
28
36
  };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@visuallyjs/browser-ui-vue","version":"1.1.3","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.1.3"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
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;
@@ -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
  };
@@ -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>;
@@ -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
- * @param ui The UI instance provided to the component via props.
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(ui: BrowserUI): import("vue").Ref<number>;
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;
@@ -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,ho=Object.defineProperties,fo=Object.getOwnPropertyDescriptor,Oo=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertyNames,Kt=Object.getOwnPropertySymbols;var Yt=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Jt=(e,t,o)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,W=(e,t)=>{for(var o in t||(t={}))Yt.call(t,o)&&Jt(e,o,t[o]);if(Kt)for(var o of Kt(t))Eo.call(t,o)&&Jt(e,o,t[o]);return e},K=(e,t)=>ho(e,Oo(t));var Co=(e,t)=>{for(var o in t)_e(e,o,{get:t[o],enumerable:!0})},_o=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Po(t))!Yt.call(e,i)&&i!==o&&_e(e,i,{get:()=>t[i],enumerable:!(n=fo(t,i))||n.enumerable});return e};var To=e=>_o(_e({},"__esModule",{value:!0}),e);var Bo={};Co(Bo,{AreaChartComponent:()=>be,BarChartComponent:()=>Ie,BaseGroupComponent:()=>to,BaseNodeComponent:()=>eo,BrowserUIVueModel:()=>R,BubbleChartComponent:()=>Ve,CLASS_VUE_GROUP:()=>It,CLASS_VUE_NODE:()=>xt,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:()=>vt,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:()=>Dt,COMPONENT_XY_CHART:()=>ae,ColorPickerComponent:()=>$t,ColumnChartComponent:()=>xe,ControlsComponent:()=>Gt,DEFAULT_SHAPE_HEIGHT:()=>yt,DEFAULT_SHAPE_WIDTH:()=>Nt,DEFAULT_VUE_SURFACE_ID:()=>qe,DecoratorComponent:()=>Je,DiagramComponent:()=>kt,DiagramProvider:()=>Ye,EVENT_VERTEX_UPDATED:()=>Qt,EVENT_VERTICES_RENDERED:()=>qt,EdgeTypePickerComponent:()=>Ke,ExportControlsComponent:()=>Ft,GaugeChartComponent:()=>Le,InspectorComponent:()=>ze,InspectorGetterSymbol:()=>j,InspectorSetterSymbol:()=>lo,LineChartComponent:()=>Me,MiniviewComponent:()=>jt,PROP_ACTIVE_TRACKING:()=>tt,PROP_ALLOW_CLICK_TO_ADD:()=>St,PROP_ALLOW_DROP_ON_CANVAS:()=>ft,PROP_ALLOW_DROP_ON_EDGE:()=>ht,PROP_ALLOW_DROP_ON_GROUP:()=>Ot,PROP_ALLOW_DROP_ON_NODE:()=>Pt,PROP_CANVAS_DROP_FILTER:()=>At,PROP_CLASS_NAME:()=>M,PROP_CLICK_TO_ADD_ONLY:()=>Tt,PROP_CLICK_TO_CENTER:()=>et,PROP_CSV_DATA:()=>at,PROP_DATA:()=>b,PROP_DATA_GENERATOR:()=>dt,PROP_DATA_SOURCE_FILTER:()=>Se,PROP_DRAG_SIZE:()=>gt,PROP_GROUP_IDENTIFIER:()=>mt,PROP_ID:()=>go,PROP_IGNORE_DROP_ON_NODE:()=>Et,PROP_INTERACTIVE:()=>it,PROP_JSON_DATA:()=>pt,PROP_MODE:()=>ot,PROP_MODEL_OPTIONS:()=>J,PROP_ON_VERTEX_ADDED:()=>Ct,PROP_OPTIONS:()=>B,PROP_PIVOT:()=>st,PROP_RENDER_OPTIONS:()=>rt,PROP_SELECTOR:()=>ct,PROP_SELECT_AFTER_ADD:()=>_t,PROP_SURFACE_ID:()=>g,PROP_TYPE_FUNCTION:()=>Qe,PROP_TYPE_GENERATOR:()=>ut,PROP_URL:()=>w,PROP_USE_MODEL:()=>lt,PROP_VIEW_OPTIONS:()=>nt,PaletteComponent:()=>Ht,PieChartComponent:()=>ve,SankeyChartComponent:()=>Be,ScatterChartComponent:()=>we,ShapeComponent:()=>je,ShapePaletteComponent:()=>$e,SurfaceComponent:()=>Bt,SurfaceProvider:()=>Ge,TAG_COLOR_PICKER:()=>Rt,TAG_DECORATOR:()=>Mt,TAG_EDGE_TYPE_PICKER:()=>Z,TAG_SHAPE:()=>Y,TAG_SHAPE_PALETTE:()=>X,VisuallyJsPlugin:()=>Vo,VisuallyJsService:()=>A,VisuallyJsServiceKey:()=>s,XYChartComponent:()=>De,addSurface:()=>Lt,bindToDevLifecycle:()=>Ro,doProvideInspector:()=>co,newInstance:()=>So,useZoom:()=>Lo});module.exports=To(Bo);var Te=require("@visuallyjs/browser-ui"),R=class extends Te.BrowserUIModel{render(t,o){return(0,Te.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function So(e){return e=e||{},new R(e)}var qe="surfaceId",Qe="typeFunction",et="clickToCenter",tt="activeTracking",g="surfaceId",M="className",b="data",ot="mode",B="options",rt="renderOptions",J="modelOptions",nt="viewOptions",w="url",it="interactive",st="pivot",Se="dataSourceFilter",at="csvData",pt="jsonData",lt="useModel",go="id",ct="selector",dt="dataGenerator",ut="typeGenerator",mt="groupIdentifier",ht="allowDropOnEdge",ft="allowDropOnCanvas",Ot="allowDropOnGroup",Pt="allowDropOnNode",Et="ignoreDropOnNode",Ct="onVertexAdded",_t="selectAfterAdd",Tt="clickToAddOnly",St="allowClickToAdd",gt="dragSize",At="canvasDropFilter",Y="Shape",X="ShapePalette",Nt=120,yt=90,Z="EdgeTypePickerComponent",Rt="ColorPickerComponent",xt="vjs-vue-node",It="vjs-vue-group",q="MiniviewComponent",Q="SurfaceComponent",Dt="SurfaceProvider",vt="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",Mt="Decorator";var U=require("vue"),c=require("@visuallyjs/browser-ui"),bt=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(qt)}vertexHasUpdated(t){this.eventManager.fire(Qt,t)}},qt="vertices:rendered",Qt="vertex:updated",wt=new Map;function ge(e){return wt.has(e)||wt.set(e,new bt),wt.get(e)}function Ao(e,t){ge(e).vertexHasRendered(t)}function No(e,t){ge(e).vertexHasUpdated(t)}function yo(e,t){ge(e).vertexWillRender(t)}function Ro(e,t,o){ge(e).eventManager.bind(t,o)}var Xt={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)?It:xt;e.el.firstElementChild&&(0,c.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Ao(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),No(this.ui.id,this.obj)}},eo={mixins:[Xt],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)}}},to={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:[Xt]},Vt=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Zt=(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 T=O?l.component:{render(S){return S.data.label||""}};if(T){let S=document.createElement(c.ELEMENT_DIV);(0,c.updateClasses)(S,D),T.mixins==null&&(T.mixins=[]);let v=I?to:eo;T.mixins.find(Ce=>Ce===v)||T.mixins.push(v),yo(a.id,f);let Ee={data:o,model:(0,U.markRaw)(n),ui:(0,U.markRaw)(a),obj:f,el:S,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],mo=typeof Ze=="function"?Ze(f,n):Ze;Ee[Ce]=mo}e.push({component:(0,U.markRaw)(T),el:S,o:f.getFullId(),props:Ee})}};function Lt(e,t,o,n,i,a){let l={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(P,O,I,D)=>{},render:(P,O,I,D,T,S,v,Pe)=>Zt(n,P,O,I,D,T,S,v,Pe),cleanupVertex:Vt,cleanupPort:Vt,rerender:(P,O,I,D,T,S,v,Pe,Ee)=>{Vt(v.id,Ee),Zt(n,P,O,I,D,T,S,v,Pe)}},f=(0,c.extend)(i||{},{view:a||{},id:t});return(0,c.renderSurface)(e,o,l,f)}var V=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,V.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 V.Surface?this.setSurface(t.$ui):t.$ui instanceof V.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,V.log)(`WARN: could not flush all queue entries ${i}`)}})}};var x=require("vue"),h=require("@visuallyjs/browser-ui"),Bt={setup(e){return{service:(0,x.inject)(s),surfaceId:e.surfaceId||qe}},name:Q,props:{[b]:{type:Object},[rt]:{type:Object},[J]:{type:Object},[nt]:{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=Lt(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"),xo="Clear dataset?",Ut="vjs-selected-mode",oo="can-undo",ro="can-redo",Io="data-undo",Do="data-redo",no="data-mode",vo="data-reset",Mo="data-clear",bo="data-zoom-in",wo="data-zoom-out",io="vjs-controls-has-selection",Gt={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:xo},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(io):this.$refs.root.setAttribute(io,"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 ${Ut}`,[no]: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",[no]: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",[Io]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push((0,p.h)("i",{class:"vjs-redo",[Do]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push((0,p.h)("i",{class:"vjs-zoom-to-fit",[vo]:"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",[bo]:"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",[wo]:"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",[Mo]:"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",[oo]:!1,[ro]:!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]"),Ut),e.addClass(e.$getSelector(this.$refs.root,"[data-mode='"+o+"']"),Ut)}),e.model.bind(r.EVENT_UNDOREDO_UPDATE,o=>{this.$refs.root.setAttribute(oo,o.undoCount>0?r.TRUE:r.FALSE),this.$refs.root.setAttribute(ro,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"),Ft={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"),Ne=require("@visuallyjs/browser-ui"),jt={setup(e){return{service:(0,Ae.inject)(s)}},name:q,props:{[g]:{type:String},[M]:{type:String,default:""},[tt]:{type:Boolean,default:!0},[et]:{type:Boolean,default:!0},[Qe]:{type:Function}},mounted:function(){this.service.getSurface(e=>{e.addPlugin({type:Ne.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.PROP_ACTIVE_TRACKING,clickToCenter:this.PROP_CLICK_TO_CENTER,typeFunction:this.PROP_TYPE_FUNCTION}})})},render:function(e){return(0,Ae.h)(Ne.ELEMENT_DIV,{ref:"root",class:e.className})}};var ye=require("vue"),Re=require("@visuallyjs/browser-ui"),kt={setup(e){return{service:(0,ye.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,ye.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"),so={[M]:{type:String},[b]:{type:Object},[w]:{type:String},[lt]:{type:Boolean,default:!1}},ao={setup(){return{service:(0,Oe.inject)(s)}},render:function(){return(0,Oe.h)(d.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function N(e,t,o=!0){let n=K(W({},so),{[B]:{type:Object}}),i={};return o&&(n[Se]={type:Function},i[Se]=function(a){this.chart.setDataSourceFilter(a)}),K(W({},ao),{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=N(ie,d.ColumnChart),Ie=N(se,d.BarChart),De=N(ae,d.CategoryValueChart,!1),ve=N(ce,d.PieChart),Me=N(pe,d.LineChart),be=N(le,d.AreaChart),we=N(de,d.ScatterChart),Ve=N(ue,d.BubbleChart),Le=N(me,d.GaugeChart,!1),Be=K(W({},ao),{name:he,props:K(W({},so),{[at]:{type:String},[pt]:{type:Object},[it]:{type:Boolean},[st]:{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"),Ht={setup(e){return{service:(0,Ue.inject)(s)}},name:ee,props:{[g]:{type:String},[ct]:{type:String},[dt]:{type:Function},[ut]:{type:Function},[mt]:{type:Function},[ht]:{type:Boolean,default:!1},[ft]:{type:Boolean,default:!0},[Ot]:{type:Boolean,default:!0},[Pt]:{type:Boolean,default:!1},[Et]:{type:Boolean,default:!1},[gt]:Object,[Ct]:Function,[At]:Function,[M]:String,[ot]:String,[_t]:{type:Boolean,default:!1},[St]:{type:Boolean,default:!1},[Tt]:{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 po=require("vue"),Ge={setup(){(0,po.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:Y,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||Nt},getHeight:function(){return this.data.height||yt},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:X,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 y=require("vue"),F=require("@visuallyjs/browser-ui"),j=Symbol.for("VueInspectorGetter"),lo=Symbol.for("VueInspectorSetter");function co(){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,y.provide)(lo,i),(0,y.provide)(j,(0,y.readonly)(n)),i}var ze={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=co();return{service:(0,y.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,y.h)(F.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var We=require("vue"),k=require("@visuallyjs/browser-ui"),Ke={name:Z,props:{propertyName:String},setup(){return{inspectorProvider:(0,We.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,We.h)(k.ELEMENT_DIV,{ref:"container"})}};var L=require("vue"),u=require("@visuallyjs/browser-ui"),$t={render(){let e=this.swatches.map(t=>(0,L.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,L.h)(u.ELEMENT_DIV,{class:`${u.CLASS_COLOR_PICKER}`},[(0,L.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,L.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,L.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 uo=require("vue"),Ye={setup(){(0,uo.provide)(s,new A("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Xe=require("vue"),$=require("@visuallyjs/browser-ui"),zt={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,Xe.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,Xe.h)($.ELEMENT_DIV,{ref:"container"})}};var Vo={install:function(e,t){e.component(Dt,Ge),e.component(vt,Ye),e.component(Q,Bt),e.component(re,kt),e.component(q,jt),e.component(te,Gt),e.component(oe,Ft),e.component(ee,Ht),e.component(ne,zt),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,Le),e.component(ue,Ve),e.component(de,we),e.component(Y,je),e.component(X,$e),e.component(Z,Ke),e.component(Rt,$t),e.component(fe,ze),e.component(Mt,Je),e.provide(s,new A("root"))}};var z=require("vue"),Wt=require("@visuallyjs/browser-ui");function Lo(e){let t=(0,z.ref)(e.getZoom()),o=n=>{t.value=n.zoom};return(0,z.onMounted)(()=>{e.bind(Wt.EVENT_ZOOM,o),t.value=e.getZoom()}),(0,z.onUnmounted)(()=>{e.unbind(Wt.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 Zt=Object.defineProperty,qt=Object.defineProperties;var Qt=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var eo=Object.prototype.hasOwnProperty,to=Object.prototype.propertyIsEnumerable;var we=(e,t,o)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,N=(e,t)=>{for(var o in t||(t={}))eo.call(t,o)&&we(e,o,t[o]);if(be)for(var o of be(t))to.call(t,o)&&we(e,o,t[o]);return e},y=(e,t)=>qt(e,Qt(t));import{log as oo,BrowserUIModel as ro}from"@visuallyjs/browser-ui";var T=class extends ro{render(t,o){return oo("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function In(e){return e=e||{},new T(e)}var Ve="surfaceId",Le="typeFunction",Be="clickToCenter",Ue="activeTracking",f="surfaceId",S="className",g="data",Ge="mode",R="options",Fe="renderOptions",b="modelOptions",je="viewOptions",A="url",ke="interactive",He="pivot",se="dataSourceFilter",$e="csvData",ze="jsonData",We="useModel",ti="id",Ke="selector",Je="dataGenerator",Ye="typeGenerator",Xe="groupIdentifier",Ze="allowDropOnEdge",qe="allowDropOnCanvas",Qe="allowDropOnGroup",et="allowDropOnNode",tt="ignoreDropOnNode",ot="onVertexAdded",rt="selectAfterAdd",nt="clickToAddOnly",it="allowClickToAdd",st="dragSize",at="canvasDropFilter",w="Shape",V="ShapePalette",pt=120,lt=90,L="EdgeTypePickerComponent",ct="ColorPickerComponent",dt="vjs-vue-node",ut="vjs-vue-group",B="MiniviewComponent",U="SurfaceComponent",mt="SurfaceProvider",ht="DiagramProvider",G="PaletteComponent",F="ControlsComponent",j="ExportControlsComponent",k="DiagramComponent",H="DiagramPaletteComponent",$="ColumnChartComponent",z="BarChartComponent",W="XYChartComponent",K="LineChartComponent",J="AreaChartComponent",Y="PieChartComponent",X="ScatterChartComponent",Z="BubbleChartComponent",q="GaugeChartComponent",Q="SankeyChartComponent",ee="InspectorComponent",ft="Decorator";import{markRaw as x}from"vue";import{addClass as no,BrowserUI as io,CLASS_DEFAULT_GROUP as so,CLASS_DEFAULT_NODE as ao,ELEMENT_DIV as po,extend as lo,isGroup as Ot,OptimisticEventGenerator as co,renderSurface as uo,updateClasses as mo,Vertex as ho}from"@visuallyjs/browser-ui";var ae=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new co}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(fo)}vertexHasUpdated(t){this.eventManager.fire(Oo,t)}},fo="vertices:rendered",Oo="vertex:updated",pe=new Map;function te(e){return pe.has(e)||pe.set(e,new ae),pe.get(e)}function Po(e,t){te(e).vertexHasRendered(t)}function Eo(e,t){te(e).vertexHasUpdated(t)}function Co(e,t){te(e).vertexWillRender(t)}function Oi(e,t,o){te(e).eventManager.bind(t,o)}var Pt={props:{data:Object,model:T,obj:ho,ui:io,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=Ot(e.obj)?ut:dt;e.el.firstElementChild&&no(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Po(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Eo(this.ui.id,this.obj)}},_o={mixins:[Pt],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)}}},To={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:[Pt]},le=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Et=(e,t,o,r,s,i,a,l,d)=>{let c=a.component!=null,E=Ot(l),C=[];c||C.push(E?so:ao);let u=c?a.component:{render(m){return m.data.label||""}};if(u){let m=document.createElement(po);mo(m,C),u.mixins==null&&(u.mixins=[]);let _=E?To:_o;u.mixins.find(M=>M===_)||u.mixins.push(_),Co(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],Xt=typeof ie=="function"?ie(l,r):ie;v[M]=Xt}e.push({component:x(u),el:m,o:l.getFullId(),props:v})}};function Ct(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)=>Et(r,d,c,E,C,u,m,_,D),cleanupVertex:le,cleanupPort:le,rerender:(d,c,E,C,u,m,_,D,v)=>{le(_.id,v),Et(r,d,c,E,C,u,m,_,D)}},l=lo(s||{},{view:i||{},id:t});return uo(e,o,a,l)}import{log as _t,Paper as So,Surface as go}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){_t(`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 go?this.setSurface(t.$ui):t.$ui instanceof So&&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){_t(`WARN: could not flush all queue entries ${s}`)}})}};import{h as ce,inject as Ao,Teleport as No}from"vue";import{ELEMENT_DIV as yo,EVENT_GROUP_REMOVED as Ro,EVENT_GROUP_UPDATED as xo,EVENT_NODE_REMOVED as Io,EVENT_NODE_UPDATED as Do,EVENT_RENDER_END as vo,clone as Tt}from"@visuallyjs/browser-ui";var St={setup(e){return{service:Ao(n),surfaceId:e.surfaceId||Ve}},name:U,props:{[g]:{type:Object},[Fe]:{type:Object},[b]:{type:Object},[je]:{type:Object},[A]:{type:String},[f]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=new T(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=Ct(t,this.surfaceId,o,this.vertices,Tt(this.renderOptions||{}),Tt(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(Do,i=>{r(i.vertex.getFullId(),i)}),this.model.bind(xo,i=>{r(i.vertex.getFullId(),i)}),this.model.bind(Io,i=>{s(i.node.id)}),this.model.bind(Ro,i=>{s(i.group.id)}),this.surface.bind(vo,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return ce(yo,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>ce(No,{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 Mo}from"vue";import{LassoPlugin as bo,SURFACE_MODE_SELECT as gt,SURFACE_MODE_PAN as At,PAN_PATH as wo,PAN_VIEW_BOX as Vo,LASSO_PATH as Lo,LASSO_VIEW_BOX as Bo,ZOOM_TO_FIT_PATH as Uo,ZOOM_TO_FIT_VIEW_BOX as Go,EVENT_UNDOREDO_UPDATE as Fo,TRUE as Nt,FALSE as yt,EVENT_SURFACE_MODE_CHANGED as jo,ELEMENT_DIV as Rt,ATTRIBUTE_CONTROLS_ORIENTATION as ko,ZOOM_IN_OUT_VIEW_BOX as xt,ZOOM_IN_PATH as Ho,ZOOM_OUT_PATH as $o,RESET_SELECTION_PATH as zo,RESET_SELECTION_VIEW_BOX as Wo,CLEAR_PATH as Ko,CLEAR_VIEW_BOX as Jo,ATTRIBUTE_RESET_SELECTION as Yo,CLASS_CONTROLS_RESET_SELECTION as Xo,EVENT_SELECT as Zo,EVENT_DESELECT as qo,EVENT_SELECTION_CLEARED as Qo,supportsPathEditing as er}from"@visuallyjs/browser-ui";var tr="Clear dataset?",de="vjs-selected-mode",It="can-undo",Dt="can-redo",or="data-undo",rr="data-redo",vt="data-mode",nr="data-reset",ir="data-clear",sr="data-zoom-in",ar="data-zoom-out",Mt="vjs-controls-has-selection",bt={setup(e){return{service:Mo(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:tr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){this.service.getSurface(e=>e.setMode(At))},selectMode:function(){this.service.getSurface(e=>e.setMode(gt))},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(),er(e)&&e.stopEditingPath()})},updateSelectionState:function(){this.service.getSurface(e=>{e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(Mt):this.$refs.root.setAttribute(Mt,"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}`,[vt]:At,onClick:()=>this.panMode(),title:"Pan mode"},[p("svg",{viewBox:Vo,stroke:"currentColor",fill:"none"},[p("path",{d:wo})])])),e.push(p("i",{class:"vjs-select-mode",[vt]:gt,onClick:()=>this.selectMode(),title:"Select mode"},[p("svg",{viewBox:Bo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Lo})])]))),this.undoRedo&&(e.push(p("i",{class:"vjs-undo",[or]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push(p("i",{class:"vjs-redo",[rr]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push(p("i",{class:"vjs-zoom-to-fit",[nr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[p("svg",{viewBox:Go,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Uo})])])),this.zoomButtons&&(e.push(p("i",{class:"vjs-zoom-in",[sr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[p("svg",{viewBox:xt,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Ho})])])),e.push(p("i",{class:"vjs-zoom-out",[ar]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[p("svg",{viewBox:xt,stroke:"currentColor",fill:"currentColor"},[p("path",{d:$o})])]))),e.push(p("i",{class:Xo,[Yo]:"true",onClick:()=>{this.resetSelection()}},[p("svg",{viewBox:Wo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:zo})])])),this.clear&&e.push(p("i",{class:"vjs-clear-dataset",[ir]:"true",onClick:()=>{this.doClear()}},[p("svg",{viewBox:Jo,stroke:"currentColor",fill:"currentColor"},[p("path",{d:Ko})])])),p(Rt,{class:`vjs-controls ${this.className}`,ref:"root",[It]:!1,[Dt]:!1,[ko]:this.orientation},e)}else return p(Rt,{ref:"root"})},mounted(){this.service.getSurface(e=>{let t=e.getPlugin(bo.type);this.showPan=t!=null,e.bind(jo,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(Fo,o=>{this.$refs.root.setAttribute(It,o.undoCount>0?Nt:yt),this.$refs.root.setAttribute(Dt,o.redoCount>0?Nt:yt)}),e.model.bind(Zo,()=>this.updateSelectionState()),e.model.bind(qo,()=>this.updateSelectionState()),e.model.bind(Qo,()=>this.updateSelectionState()),this.ready=!0})}};import{h as P,inject as pr}from"vue";import{CLASS_CONTROLS as lr,CLASS_EXPORT_CONTROLS as cr,ELEMENT_DIV as dr,ImageExportUI as wt,SvgExportUI as ur,TYPE_JPG as mr,TYPE_PNG as hr,TYPE_SVG as fr}from"@visuallyjs/browser-ui";var Vt={name:j,setup(e){return{service:pr(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 ur(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 wt(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new wt(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":fr,onClick:()=>this.exportSVG()},"SVG")])),o&&s.push(P("i",{},[P("a",{href:"#","data-type":hr,onClick:()=>this.exportPNG()},"PNG")])),r&&s.push(P("i",{},[P("a",{href:"#","data-type":mr,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift(P("span",{},[this.label])),P(dr,{class:`${lr} ${cr}`},s)}};import{h as Or,inject as Pr}from"vue";import{ELEMENT_DIV as Er,MiniviewPlugin as Cr}from"@visuallyjs/browser-ui";var Lt={setup(e){return{service:Pr(n)}},name:B,props:{[f]:{type:String},[S]:{type:String,default:""},[Ue]:{type:Boolean,default:!0},[Be]:{type:Boolean,default:!0},[Le]:{type:Function}},mounted:function(){this.service.getSurface(e=>{e.addPlugin({type:Cr.type,options:{container:this.$el,activeTracking:this.PROP_ACTIVE_TRACKING,clickToCenter:this.PROP_CLICK_TO_CENTER,typeFunction:this.PROP_TYPE_FUNCTION}})})},render:function(e){return Or(Er,{ref:"root",class:e.className})}};import{h as _r,inject as Tr}from"vue";import{createDiagram as Sr,ELEMENT_DIV as gr}from"@visuallyjs/browser-ui";var Bt={setup(e){return{service:Tr(n)}},name:k,props:{[g]:{type:Object},[A]:{type:String},[b]:{type:Object},[R]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=Sr(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 _r(gr,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Ut,inject as Ar}from"vue";import{ColumnChart as Nr,BarChart as yr,CategoryValueChart as Rr,ELEMENT_DIV as Gt,LineChart as xr,AreaChart as Ir,PieChart as Dr,ScatterChart as vr,BubbleChart as Mr,GaugeChart as br,SankeyChart as wr}from"@visuallyjs/browser-ui";var Ft={[S]:{type:String},[g]:{type:Object},[A]:{type:String},[We]:{type:Boolean,default:!1}},jt={setup(){return{service:Ar(n)}},render:function(){return Ut(Gt,{class:`${this.className}`,ref:"root"})}};function h(e,t,o=!0){let r=y(N({},Ft),{[R]:{type:Object}}),s={};return o&&(r[se]={type:Function},s[se]=function(i){this.chart.setDataSourceFilter(i)}),y(N({},jt),{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($,Nr),me=h(z,yr),he=h(W,Rr,!1),fe=h(Y,Dr),Oe=h(K,xr),Pe=h(J,Ir),Ee=h(X,vr),Ce=h(Z,Mr),_e=h(q,br,!1),Te=y(N({},jt),{name:Q,props:y(N({},Ft),{[$e]:{type:String},[ze]:{type:Object},[ke]:{type:Boolean},[He]:{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 wr(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 Ut(Gt,{class:`${this.className}`,ref:"root"})}});import{h as Vr,inject as Lr}from"vue";import{defaultDataGenerator as Br,ELEMENT_DIV as Ur,Palette as Gr}from"@visuallyjs/browser-ui";var kt={setup(e){return{service:Lr(n)}},name:G,props:{[f]:{type:String},[Ke]:{type:String},[Je]:{type:Function},[Ye]:{type:Function},[Xe]:{type:Function},[Ze]:{type:Boolean,default:!1},[qe]:{type:Boolean,default:!0},[Qe]:{type:Boolean,default:!0},[et]:{type:Boolean,default:!1},[tt]:{type:Boolean,default:!1},[st]:Object,[ot]:Function,[at]:Function,[S]:String,[Ge]:String,[rt]:{type:Boolean,default:!1},[it]:{type:Boolean,default:!1},[nt]:{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):Br(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 Gr(t,o)})},render:function(){return Vr(Ur,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as Fr}from"vue";var Se={setup(){Fr(n,new O("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as jr,inject as kr}from"vue";import{CLASS_SHAPE as Hr,convertToMultilineText as Ht,DEFAULT_LABEL_FILL_RATIO as ge,ELEMENT_SVG as $r}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:kr(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&&Ht(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&&Ht(r,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ge))}})},render:function(){return jr($r,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:Hr})},methods:{getWidth:function(){return this.data.width||pt},getHeight:function(){return this.data.height||lt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as zr,inject as Wr}from"vue";import{ELEMENT_DIV as Kr,ShapePalette as Jr}from"@visuallyjs/browser-ui";var Ne={name:V,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:Wr(n)}},mounted(){this.service.getSurface(e=>{new Jr(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 zr(Kr,{ref:"container"})}};import{provide as $t,readonly as Yr,inject as Xr,h as Zr}from"vue";import{ELEMENT_DIV as qr,Inspector as Qr,log as en}from"@visuallyjs/browser-ui";var I=Symbol.for("VueInspectorGetter"),tn=Symbol.for("VueInspectorSetter");function on(){let e=[],t=null;function o(i){try{i(t)}catch(a){en("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 $t(tn,s),$t(I,Yr(r)),s}var ye={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=on();return{service:Xr(n),inspectorProvider:t}},mounted(){this.service.getSurface(e=>{let t=new Qr({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 Zr(qr,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as rn,inject as nn}from"vue";import{EdgeTypePicker as sn,ELEMENT_DIV as an,log as pn}from"@visuallyjs/browser-ui";var Re={name:L,props:{propertyName:String},setup(){return{inspectorProvider:nn(I)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new sn(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))})}):pn("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return rn(an,{ref:"container"})}};import{h as oe,inject as ln}from"vue";import{CLASS_COLOR_PICKER as zt,CLASS_COLOR_PICKER_SWATCH as Wt,CLASS_COLOR_PICKER_SWATCHES as Kt,EVENT_CONTEXT_UPDATE as cn,ELEMENT_DIV as xe,INSPECTOR_CONTEXT_RECENT_COLORS as re}from"@visuallyjs/browser-ui";var Jt={render(){let e=this.swatches.map(t=>oe(xe,{title:t,class:Wt,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return oe(xe,{class:`${zt}`},[oe("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),oe(xe,{class:Kt},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:zt,CLASS_COLOR_PICKER_SWATCHES:Kt,CLASS_COLOR_PICKER_SWATCH:Wt,colorInput:null,swatches:[]}),mounted(){let e=ln(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(cn,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 dn,nextTick as un,Teleport as mn}from"vue";import{ELEMENT_DIV as Ie,uuid as hn}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:dn(n)}},mounted(){this.service.getSurface(e=>{this.surface=e,this.mounted=!0;let t=this.position||{x:0,y:0};un().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(mn,{to:this.surface.vertexLayer,key:hn()},ne(Ie,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as fn}from"vue";var ve={setup(){fn(n,new O("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as On,inject as Pn}from"vue";import{DiagramPalette as En,ELEMENT_DIV as Cn,log as _n}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:Pn(n)}},mounted(){if(this.service==null&&this.diagram==null)_n("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{new En(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 On(Cn,{ref:"container"})}};var wp={install:function(e,t){e.component(mt,Se),e.component(ht,ve),e.component(U,St),e.component(k,Bt),e.component(B,Lt),e.component(F,bt),e.component(j,Vt),e.component(G,kt),e.component(H,Me),e.component(z,me),e.component($,ue),e.component(W,he),e.component(K,Oe),e.component(J,Pe),e.component(Y,fe),e.component(Q,Te),e.component(q,_e),e.component(Z,Ce),e.component(X,Ee),e.component(w,Ae),e.component(V,Ne),e.component(L,Re),e.component(ct,Jt),e.component(ee,ye),e.component(ft,De),e.provide(n,new O("root"))}};import{ref as Tn,onMounted as Sn,onUnmounted as gn}from"vue";import{EVENT_ZOOM as Yt}from"@visuallyjs/browser-ui";function Fp(e){let t=Tn(e.getZoom()),o=r=>{t.value=r.zoom};return Sn(()=>{e.bind(Yt,o),t.value=e.getZoom()}),gn(()=>{e.unbind(Yt,o)}),t}export{Pe as AreaChartComponent,me as BarChartComponent,To as BaseGroupComponent,_o as BaseNodeComponent,T as BrowserUIVueModel,Ce as BubbleChartComponent,ut as CLASS_VUE_GROUP,dt as CLASS_VUE_NODE,J as COMPONENT_AREA_CHART,z 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,ht 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,Y as COMPONENT_PIE_CHART,Q as COMPONENT_SANKEY_CHART,X as COMPONENT_SCATTER_CHART,U as COMPONENT_SURFACE,mt as COMPONENT_SURFACE_PROVIDER,W as COMPONENT_XY_CHART,Jt as ColorPickerComponent,ue as ColumnChartComponent,bt as ControlsComponent,lt as DEFAULT_SHAPE_HEIGHT,pt as DEFAULT_SHAPE_WIDTH,Ve as DEFAULT_VUE_SURFACE_ID,De as DecoratorComponent,Bt as DiagramComponent,ve as DiagramProvider,Oo as EVENT_VERTEX_UPDATED,fo as EVENT_VERTICES_RENDERED,Re as EdgeTypePickerComponent,Vt as ExportControlsComponent,_e as GaugeChartComponent,ye as InspectorComponent,I as InspectorGetterSymbol,tn as InspectorSetterSymbol,Oe as LineChartComponent,Lt as MiniviewComponent,Ue as PROP_ACTIVE_TRACKING,it as PROP_ALLOW_CLICK_TO_ADD,qe as PROP_ALLOW_DROP_ON_CANVAS,Ze as PROP_ALLOW_DROP_ON_EDGE,Qe as PROP_ALLOW_DROP_ON_GROUP,et as PROP_ALLOW_DROP_ON_NODE,at as PROP_CANVAS_DROP_FILTER,S as PROP_CLASS_NAME,nt as PROP_CLICK_TO_ADD_ONLY,Be as PROP_CLICK_TO_CENTER,$e as PROP_CSV_DATA,g as PROP_DATA,Je as PROP_DATA_GENERATOR,se as PROP_DATA_SOURCE_FILTER,st as PROP_DRAG_SIZE,Xe as PROP_GROUP_IDENTIFIER,ti as PROP_ID,tt as PROP_IGNORE_DROP_ON_NODE,ke as PROP_INTERACTIVE,ze as PROP_JSON_DATA,Ge as PROP_MODE,b as PROP_MODEL_OPTIONS,ot as PROP_ON_VERTEX_ADDED,R as PROP_OPTIONS,He as PROP_PIVOT,Fe as PROP_RENDER_OPTIONS,Ke as PROP_SELECTOR,rt as PROP_SELECT_AFTER_ADD,f as PROP_SURFACE_ID,Le as PROP_TYPE_FUNCTION,Ye as PROP_TYPE_GENERATOR,A as PROP_URL,We as PROP_USE_MODEL,je as PROP_VIEW_OPTIONS,kt as PaletteComponent,fe as PieChartComponent,Te as SankeyChartComponent,Ee as ScatterChartComponent,Ae as ShapeComponent,Ne as ShapePaletteComponent,St as SurfaceComponent,Se as SurfaceProvider,ct as TAG_COLOR_PICKER,ft as TAG_DECORATOR,L as TAG_EDGE_TYPE_PICKER,w as TAG_SHAPE,V as TAG_SHAPE_PALETTE,wp as VisuallyJsPlugin,O as VisuallyJsService,n as VisuallyJsServiceKey,he as XYChartComponent,Ct as addSurface,Oi as bindToDevLifecycle,on as doProvideInspector,In as newInstance,Fp 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
  }