@visuallyjs/browser-ui-angular 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/esm2022/index.mjs +3 -0
- package/esm2022/lib/charts/area.chart.component.mjs +8 -36
- package/esm2022/lib/charts/bar.chart.component.mjs +8 -36
- package/esm2022/lib/charts/bubble.chart.component.mjs +8 -36
- package/esm2022/lib/charts/column.chart.component.mjs +8 -36
- package/esm2022/lib/charts/line.chart.component.mjs +8 -36
- package/esm2022/lib/charts/pie.chart.component.mjs +8 -36
- package/esm2022/lib/charts/sankey.chart.component.mjs +12 -8
- package/esm2022/lib/charts/scatter.chart.component.mjs +8 -36
- package/esm2022/lib/charts/series.based.chart.component.mjs +54 -0
- package/esm2022/lib/charts/xy.chart.component.mjs +10 -22
- package/esm2022/lib/color.tag.component.mjs +33 -27
- package/esm2022/lib/controls-component.mjs +48 -44
- package/esm2022/lib/diagram-palette-component.mjs +37 -32
- package/esm2022/lib/edge.type.picker.component.mjs +23 -18
- package/esm2022/lib/export-controls-component.mjs +7 -9
- package/esm2022/lib/hooks/use-visuallyjs-update.mjs +21 -0
- package/esm2022/lib/hooks/use-zoom.mjs +24 -0
- package/esm2022/lib/inspector.component.mjs +29 -27
- package/esm2022/lib/miniview-component.mjs +33 -25
- package/esm2022/lib/palette.component.mjs +42 -37
- package/esm2022/lib/shape.component.mjs +20 -18
- package/esm2022/lib/shape.palette.component.mjs +25 -21
- package/esm2022/lib/surface-component.mjs +7 -5
- package/esm2022/lib/vjs-service.mjs +35 -1
- package/fesm2022/visuallyjs-browser-ui-angular.mjs +466 -503
- package/fesm2022/visuallyjs-browser-ui-angular.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/lib/charts/area.chart.component.d.ts +10 -15
- package/lib/charts/bar.chart.component.d.ts +9 -15
- package/lib/charts/bubble.chart.component.d.ts +12 -15
- package/lib/charts/column.chart.component.d.ts +12 -15
- package/lib/charts/line.chart.component.d.ts +16 -17
- package/lib/charts/pie.chart.component.d.ts +9 -15
- package/lib/charts/sankey.chart.component.d.ts +5 -0
- package/lib/charts/scatter.chart.component.d.ts +9 -15
- package/lib/charts/series.based.chart.component.d.ts +44 -0
- package/lib/charts/xy.chart.component.d.ts +13 -11
- package/lib/color.tag.component.d.ts +5 -5
- package/lib/controls-component.d.ts +6 -4
- package/lib/diagram-palette-component.d.ts +8 -2
- package/lib/edge.type.picker.component.d.ts +5 -5
- package/lib/export-controls-component.d.ts +6 -6
- package/lib/hooks/use-visuallyjs-update.d.ts +21 -0
- package/lib/hooks/use-zoom.d.ts +6 -0
- package/lib/inspector.component.d.ts +6 -7
- package/lib/miniview-component.d.ts +17 -9
- package/lib/palette.component.d.ts +5 -6
- package/lib/shape.component.d.ts +5 -5
- package/lib/shape.palette.component.d.ts +5 -3
- package/lib/surface-component.d.ts +5 -1
- package/lib/vjs-service.d.ts +41 -0
- package/package.json +2 -2
- package/visuallyjs-browser-ui-angular.tgz +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ElementRef, Component, Input, ChangeDetectorRef,
|
|
2
|
+
import { signal, Injectable, inject, ElementRef, effect, Component, Input, ChangeDetectorRef, computed, Directive, EventEmitter, ViewContainerRef, NgZone, reflectComponentType, Output, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { log, Surface, Paper, MiniviewPlugin, EVENT_ZOOM, EVENT_PORT_UPDATED, BrowserUIModel, OVERLAY_TYPE_CUSTOM, ELEMENT_DIV, isGroup, extend, renderSurface, EVENT_NODE_UPDATED, EVENT_PORT_ADDED, EVENT_GROUP_UPDATED, EVENT_DATA_LOAD_END, EVENT_EDGE_UPDATED, EVENT_INTERNAL_CONNECTION, ShapeLibraryDefaults, ShapePalette,
|
|
5
|
+
import { log, Surface, Paper, MiniviewPlugin, EVENT_ZOOM, EVENT_PORT_UPDATED, BrowserUIModel, OVERLAY_TYPE_CUSTOM, ELEMENT_DIV, isGroup, extend, renderSurface, EVENT_NODE_UPDATED, EVENT_PORT_ADDED, EVENT_GROUP_UPDATED, EVENT_DATA_LOAD_END, EVENT_EDGE_UPDATED, EVENT_INTERNAL_CONNECTION, ShapeLibraryDefaults, ShapePalette, convertToMultilineText, DEFAULT_LABEL_FILL_RATIO, LassoPlugin, EVENT_SURFACE_MODE_CHANGED, EVENT_UNDOREDO_UPDATE, TRUE, FALSE, EVENT_SELECT, EVENT_DESELECT, EVENT_SELECTION_CLEARED, SURFACE_MODE_PAN, SURFACE_MODE_SELECT, supportsPathEditing, PAN_VIEW_BOX, PAN_PATH, LASSO_VIEW_BOX, LASSO_PATH, ZOOM_TO_FIT_VIEW_BOX, ZOOM_TO_FIT_PATH, ZOOM_IN_OUT_VIEW_BOX, ZOOM_IN_PATH, ZOOM_OUT_PATH, CLASS_CONTROLS_RESET_SELECTION, RESET_SELECTION_VIEW_BOX, RESET_SELECTION_PATH, CLEAR_VIEW_BOX, CLEAR_PATH, INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS, EdgeTypePicker, Palette, SvgExportUI, ImageExportUI, CLASS_CONTROLS, CLASS_EXPORT_CONTROLS, INSPECTOR_CONTEXT_RECENT_COLORS, EVENT_CONTEXT_UPDATE, CLASS_COLOR_PICKER, CLASS_COLOR_PICKER_SWATCHES, CLASS_COLOR_PICKER_SWATCH, createDiagram, ColumnChart, BarChart, DiagramPalette, CategoryValueChart, LineChart, AreaChart, PieChart, ScatterChart, BubbleChart, SankeyChart, Edge, Node, Group, Port, Inspector, EVENT_DATA_UPDATED, EVENT_GRAPH_CLEARED } from '@visuallyjs/browser-ui';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class VisuallyJsService {
|
|
9
9
|
constructor() {
|
|
10
|
+
this.model = signal(null);
|
|
11
|
+
this.surface = signal(null);
|
|
12
|
+
this.paper = signal(null);
|
|
13
|
+
this.diagram = signal(null);
|
|
14
|
+
this.inspector = signal(null);
|
|
15
|
+
this.ui = signal(null);
|
|
10
16
|
this.inspectorListeners = [];
|
|
11
17
|
this.surfaceListeners = [];
|
|
12
18
|
this.paperListeners = [];
|
|
@@ -14,7 +20,10 @@ class VisuallyJsService {
|
|
|
14
20
|
this.diagramListeners = [];
|
|
15
21
|
this.uiListeners = [];
|
|
16
22
|
}
|
|
23
|
+
|
|
17
24
|
$setInspector(i) {
|
|
25
|
+
this.inspector.set(i);
|
|
26
|
+
// deprecated from here
|
|
18
27
|
this.$inspector = i;
|
|
19
28
|
this.$notifyInspector();
|
|
20
29
|
}
|
|
@@ -30,11 +39,16 @@ class VisuallyJsService {
|
|
|
30
39
|
this.inspectorListeners.length = 0;
|
|
31
40
|
}
|
|
32
41
|
$setSurface(s) {
|
|
42
|
+
this.model.set(s.model);
|
|
43
|
+
this.surface.set(s);
|
|
44
|
+
this.ui.set(s);
|
|
45
|
+
// deprecated from here
|
|
33
46
|
// @ts-ignore
|
|
34
47
|
this.$setModel(s.model);
|
|
35
48
|
this.$surface = s;
|
|
36
49
|
this.$notifySurface();
|
|
37
50
|
}
|
|
51
|
+
|
|
38
52
|
$notifySurface() {
|
|
39
53
|
this.surfaceListeners.forEach(sl => {
|
|
40
54
|
try {
|
|
@@ -66,11 +80,16 @@ class VisuallyJsService {
|
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
$setPaper(p) {
|
|
83
|
+
this.model.set(p.model);
|
|
84
|
+
this.paper.set(p);
|
|
85
|
+
this.ui.set(p);
|
|
86
|
+
// deprecated below
|
|
69
87
|
// @ts-ignore
|
|
70
88
|
this.$setModel(p.model);
|
|
71
89
|
this.$paper = p;
|
|
72
90
|
this.$notifyPaper();
|
|
73
91
|
}
|
|
92
|
+
|
|
74
93
|
$notifyPaper() {
|
|
75
94
|
this.paperListeners.forEach(sl => {
|
|
76
95
|
try {
|
|
@@ -92,7 +111,17 @@ class VisuallyJsService {
|
|
|
92
111
|
this.paperListeners.push(cb);
|
|
93
112
|
}
|
|
94
113
|
}
|
|
114
|
+
|
|
95
115
|
$setDiagram(d) {
|
|
116
|
+
this.model.set(d.model);
|
|
117
|
+
this.diagram.set(d);
|
|
118
|
+
if (d.$ui instanceof Surface) {
|
|
119
|
+
this.surface.set(d.$ui);
|
|
120
|
+
}
|
|
121
|
+
if (d.$ui instanceof Paper) {
|
|
122
|
+
this.paper.set(d.$ui);
|
|
123
|
+
}
|
|
124
|
+
// deprecated below
|
|
96
125
|
this.$diagram = d;
|
|
97
126
|
if (d.$ui instanceof Surface) {
|
|
98
127
|
this.$setSurface(d.$ui);
|
|
@@ -102,6 +131,7 @@ class VisuallyJsService {
|
|
|
102
131
|
}
|
|
103
132
|
this.$notifyDiagram();
|
|
104
133
|
}
|
|
134
|
+
|
|
105
135
|
$notifyDiagram() {
|
|
106
136
|
this.diagramListeners.forEach(sl => {
|
|
107
137
|
try {
|
|
@@ -133,9 +163,12 @@ class VisuallyJsService {
|
|
|
133
163
|
}
|
|
134
164
|
|
|
135
165
|
$setModel(m) {
|
|
166
|
+
this.model.set(m);
|
|
167
|
+
// deprecated below
|
|
136
168
|
this.$model = m;
|
|
137
169
|
this.$notifyModel();
|
|
138
170
|
}
|
|
171
|
+
|
|
139
172
|
$notifyModel() {
|
|
140
173
|
this.modelListeners.forEach(sl => {
|
|
141
174
|
try {
|
|
@@ -147,6 +180,7 @@ class VisuallyJsService {
|
|
|
147
180
|
});
|
|
148
181
|
this.modelListeners.length = 0;
|
|
149
182
|
}
|
|
183
|
+
|
|
150
184
|
$notifyUI(ui) {
|
|
151
185
|
this.uiListeners.forEach(sl => {
|
|
152
186
|
try {
|
|
@@ -186,31 +220,35 @@ class MiniviewComponent {
|
|
|
186
220
|
this.activeTracking = true;
|
|
187
221
|
|
|
188
222
|
this.clickToCenter = true;
|
|
223
|
+
|
|
224
|
+
this.showLasso = true;
|
|
225
|
+
|
|
226
|
+
this.trackSelection = true;
|
|
189
227
|
this.$el = inject(ElementRef);
|
|
190
228
|
this.$vjs = inject(VisuallyJsService);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
229
|
+
this.$ui = this.$vjs.ui;
|
|
230
|
+
this.initialized = false;
|
|
231
|
+
effect(() => {
|
|
232
|
+
if (!this.initialized) {
|
|
233
|
+
const ui = this.$ui();
|
|
234
|
+
if (ui != null) {
|
|
235
|
+
this.initialized = true;
|
|
236
|
+
this.ngZone.runOutsideAngular(() => {
|
|
237
|
+
this.$miniview = ui.addPlugin({
|
|
238
|
+
type: MiniviewPlugin.type,
|
|
239
|
+
options: {
|
|
240
|
+
container: this.$el.nativeElement.childNodes[0],
|
|
241
|
+
elementFilter: this.elementFilter,
|
|
242
|
+
typeFunction: this.typeFunction,
|
|
243
|
+
activeTracking: this.activeTracking,
|
|
244
|
+
clickToCenter: this.clickToCenter,
|
|
245
|
+
showLasso: this.showLasso,
|
|
246
|
+
trackSelection: this.trackSelection
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
214
252
|
});
|
|
215
253
|
}
|
|
216
254
|
|
|
@@ -220,7 +258,7 @@ class MiniviewComponent {
|
|
|
220
258
|
}
|
|
221
259
|
}
|
|
222
260
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MiniviewComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
223
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MiniviewComponent, selector: "vjs-miniview", inputs: { elementFilter: "elementFilter", typeFunction: "typeFunction", activeTracking: "activeTracking", clickToCenter: "clickToCenter" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
261
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MiniviewComponent, selector: "vjs-miniview", inputs: { elementFilter: "elementFilter", typeFunction: "typeFunction", activeTracking: "activeTracking", clickToCenter: "clickToCenter", showLasso: "showLasso", trackSelection: "trackSelection" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
224
262
|
}
|
|
225
263
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MiniviewComponent, decorators: [{
|
|
226
264
|
type: Component,
|
|
@@ -236,6 +274,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
236
274
|
type: Input
|
|
237
275
|
}], clickToCenter: [{
|
|
238
276
|
type: Input
|
|
277
|
+
}], showLasso: [{
|
|
278
|
+
type: Input
|
|
279
|
+
}], trackSelection: [{
|
|
280
|
+
type: Input
|
|
239
281
|
}] } });
|
|
240
282
|
|
|
241
283
|
|
|
@@ -537,6 +579,7 @@ class SurfaceComponent {
|
|
|
537
579
|
this.$ngZone = inject(NgZone);
|
|
538
580
|
this.$vjs = inject(VisuallyJsService);
|
|
539
581
|
}
|
|
582
|
+
// $vjsSignals = inject(VisuallyJsSignalService)
|
|
540
583
|
|
|
541
584
|
getNativeElement(component) {
|
|
542
585
|
return component.location.nativeElement.childNodes[0];
|
|
@@ -746,11 +789,9 @@ class SurfaceComponent {
|
|
|
746
789
|
const renderParams = extend(this.renderOptions || {}, {
|
|
747
790
|
view: view,
|
|
748
791
|
});
|
|
749
|
-
let model = new BrowserUIAngularModel(this.modelOptions);
|
|
792
|
+
let model = this.inputModel || new BrowserUIAngularModel(this.modelOptions);
|
|
750
793
|
this.model = model;
|
|
751
794
|
this.surface = renderSurface(model, self.$el.nativeElement, templateRenderer, renderParams);
|
|
752
|
-
//this.$service.addSurface(this.surfaceId, this.surface);
|
|
753
|
-
// new
|
|
754
795
|
this.$vjs.$setSurface(this.surface);
|
|
755
796
|
// ----------------
|
|
756
797
|
this.nodeUpdateFn = this.nodeOrGroupUpdated.bind(this);
|
|
@@ -783,7 +824,7 @@ class SurfaceComponent {
|
|
|
783
824
|
this.surface.unbind(EVENT_INTERNAL_CONNECTION, this.edgeAddFn);
|
|
784
825
|
}
|
|
785
826
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
786
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SurfaceComponent, selector: "vjs-surface", inputs: { viewOptions: "viewOptions", renderOptions: "renderOptions", modelOptions: "modelOptions", data: "data", url: "url" }, outputs: { vertexEvent: "vertexEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
827
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SurfaceComponent, selector: "vjs-surface", inputs: { inputModel: ["model", "inputModel"], viewOptions: "viewOptions", renderOptions: "renderOptions", modelOptions: "modelOptions", data: "data", url: "url" }, outputs: { vertexEvent: "vertexEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
787
828
|
}
|
|
788
829
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SurfaceComponent, decorators: [{
|
|
789
830
|
type: Component,
|
|
@@ -791,7 +832,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
791
832
|
selector: "vjs-surface",
|
|
792
833
|
template: `<ng-content></ng-content>`
|
|
793
834
|
}]
|
|
794
|
-
}], propDecorators: {
|
|
835
|
+
}], propDecorators: { inputModel: [{
|
|
836
|
+
type: Input,
|
|
837
|
+
args: [{ alias: "model" }]
|
|
838
|
+
}], viewOptions: [{
|
|
795
839
|
type: Input
|
|
796
840
|
}], renderOptions: [{
|
|
797
841
|
type: Input
|
|
@@ -826,25 +870,29 @@ class ShapePaletteComponent {
|
|
|
826
870
|
this.dataGenerator = undefined;
|
|
827
871
|
this.$el = inject(ElementRef);
|
|
828
872
|
this.$vjs = inject(VisuallyJsService);
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
873
|
+
this.ui = this.$vjs.ui;
|
|
874
|
+
this.initialized = false;
|
|
875
|
+
effect(() => {
|
|
876
|
+
const ui = this.ui();
|
|
877
|
+
if (ui != null && !this.initialized) {
|
|
878
|
+
this.initialized = true;
|
|
879
|
+
// tslint:disable-next-line:no-unused-expression
|
|
880
|
+
new ShapePalette(ui, {
|
|
881
|
+
container: this.$el.nativeElement,
|
|
882
|
+
initialSet: this.initialSet,
|
|
883
|
+
dragSize: this.dragSize,
|
|
884
|
+
iconSize: this.iconSize,
|
|
885
|
+
fill: this.fill,
|
|
886
|
+
outline: this.outline,
|
|
887
|
+
shapeLibrary: ui.getShapeLibrary(),
|
|
888
|
+
showAllMessage: this.showAllMessage,
|
|
889
|
+
selectAfterDrop: this.selectAfterDrop,
|
|
890
|
+
paletteStrokeWidth: this.paletteStrokeWidth,
|
|
891
|
+
dataGenerator: this.dataGenerator,
|
|
892
|
+
onVertexAdded: this.onVertexAdded,
|
|
893
|
+
preparedShapes: this.preparedShapes
|
|
894
|
+
});
|
|
895
|
+
}
|
|
848
896
|
});
|
|
849
897
|
}
|
|
850
898
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ShapePaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -856,7 +904,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
856
904
|
template: `<div></div>`,
|
|
857
905
|
selector: `vjs-shape-palette`
|
|
858
906
|
}]
|
|
859
|
-
}], propDecorators: { initialSet: [{
|
|
907
|
+
}], ctorParameters: function () { return []; }, propDecorators: { initialSet: [{
|
|
860
908
|
type: Input
|
|
861
909
|
}], dragSize: [{
|
|
862
910
|
type: Input
|
|
@@ -882,18 +930,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
882
930
|
|
|
883
931
|
|
|
884
932
|
class ShapeComponent {
|
|
885
|
-
constructor() {
|
|
886
|
-
|
|
887
|
-
this.showLabels = false;
|
|
888
|
-
|
|
889
|
-
this.labelProperty = "label";
|
|
890
|
-
|
|
891
|
-
this.multilineLabels = true;
|
|
892
|
-
|
|
893
|
-
this.labelFillRatio = DEFAULT_LABEL_FILL_RATIO;
|
|
894
|
-
this.$el = inject(ElementRef);
|
|
895
|
-
this.$vjs = inject(VisuallyJsService);
|
|
896
|
-
}
|
|
897
933
|
_render() {
|
|
898
934
|
if (this.shapeLibrary != null) {
|
|
899
935
|
const svg = this.$el.nativeElement.childNodes[0];
|
|
@@ -908,10 +944,24 @@ class ShapeComponent {
|
|
|
908
944
|
}
|
|
909
945
|
}
|
|
910
946
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
947
|
+
constructor() {
|
|
948
|
+
|
|
949
|
+
this.showLabels = false;
|
|
950
|
+
|
|
951
|
+
this.labelProperty = "label";
|
|
952
|
+
|
|
953
|
+
this.multilineLabels = true;
|
|
954
|
+
|
|
955
|
+
this.labelFillRatio = DEFAULT_LABEL_FILL_RATIO;
|
|
956
|
+
this.$el = inject(ElementRef);
|
|
957
|
+
this.$vjs = inject(VisuallyJsService);
|
|
958
|
+
this.ui = this.$vjs.ui;
|
|
959
|
+
effect(() => {
|
|
960
|
+
const ui = this.ui();
|
|
961
|
+
if (ui != null && this.shapeLibrary == null) {
|
|
962
|
+
this.shapeLibrary = ui.getShapeLibrary();
|
|
963
|
+
this._render();
|
|
964
|
+
}
|
|
915
965
|
});
|
|
916
966
|
}
|
|
917
967
|
ngOnChanges(changes) {
|
|
@@ -940,7 +990,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
940
990
|
></svg:svg>`,
|
|
941
991
|
selector: `vjs-shape`,
|
|
942
992
|
}]
|
|
943
|
-
}], propDecorators: { obj: [{
|
|
993
|
+
}], ctorParameters: function () { return []; }, propDecorators: { obj: [{
|
|
944
994
|
type: Input
|
|
945
995
|
}], width: [{
|
|
946
996
|
type: Input
|
|
@@ -968,6 +1018,15 @@ const CLASS_SELECTED_MODE = "vjs-selected-mode";
|
|
|
968
1018
|
const ATTRIBUTE_HAS_SELECTION = "vjs-controls-has-selection";
|
|
969
1019
|
|
|
970
1020
|
class ControlsComponent {
|
|
1021
|
+
updateSelectionState() {
|
|
1022
|
+
const controls = this.getNativeElement(this.$el);
|
|
1023
|
+
if (this.ui().model.getSelection().isEmpty()) {
|
|
1024
|
+
controls.removeAttribute(ATTRIBUTE_HAS_SELECTION);
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
controls.setAttribute(ATTRIBUTE_HAS_SELECTION, "true");
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
971
1030
|
constructor() {
|
|
972
1031
|
|
|
973
1032
|
this.undoRedo = true;
|
|
@@ -983,43 +1042,37 @@ class ControlsComponent {
|
|
|
983
1042
|
this.buttons = [];
|
|
984
1043
|
|
|
985
1044
|
this.orientation = "row";
|
|
1045
|
+
this.initialized = false;
|
|
986
1046
|
this.showPanButton = true;
|
|
987
1047
|
this.showLassoButton = true;
|
|
988
1048
|
this.$vjs = inject(VisuallyJsService);
|
|
989
1049
|
this.$el = inject(ElementRef);
|
|
990
1050
|
this.$cdr = inject(ChangeDetectorRef);
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const controls = this.getNativeElement(this.$el);
|
|
994
|
-
if (this.ui.model.getSelection().isEmpty()) {
|
|
995
|
-
controls.removeAttribute(ATTRIBUTE_HAS_SELECTION);
|
|
996
|
-
}
|
|
997
|
-
else {
|
|
998
|
-
controls.setAttribute(ATTRIBUTE_HAS_SELECTION, "true");
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
ngOnInit() {
|
|
1051
|
+
this.ui = this.$vjs.ui;
|
|
1052
|
+
this.model = computed(() => this.ui()?.model);
|
|
1002
1053
|
this.modeButtons = this.buttons.filter((b) => b.mode != null);
|
|
1003
1054
|
this.otherButtons = this.buttons.filter((b) => b.mode == null);
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
this.
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1055
|
+
effect(() => {
|
|
1056
|
+
const ui = this.ui();
|
|
1057
|
+
if (!this.initialized && ui) {
|
|
1058
|
+
this.showLassoButton = ui.getPlugin(LassoPlugin.type) != null;
|
|
1059
|
+
this.showPanButton = this.showLassoButton === true;
|
|
1060
|
+
this.ui.bind(EVENT_SURFACE_MODE_CHANGED, (mode) => {
|
|
1061
|
+
const controls = this.getNativeElement(this.$el);
|
|
1062
|
+
const modeButtons = ui.$getSelector(controls, "[data-mode]");
|
|
1063
|
+
ui.removeClass(modeButtons, CLASS_SELECTED_MODE);
|
|
1064
|
+
ui.addClass(ui.$getSelector(controls, `[data-mode='${mode}']`), CLASS_SELECTED_MODE);
|
|
1065
|
+
});
|
|
1066
|
+
ui.model.bind(EVENT_UNDOREDO_UPDATE, (state) => {
|
|
1067
|
+
const controls = this.getNativeElement(this.$el);
|
|
1068
|
+
controls.setAttribute(ATTRIBUTE_CAN_UNDO, state.undoCount > 0 ? TRUE : FALSE);
|
|
1069
|
+
controls.setAttribute(ATTRIBUTE_CAN_REDO, state.redoCount > 0 ? TRUE : FALSE);
|
|
1070
|
+
});
|
|
1071
|
+
ui.model.bind(EVENT_SELECT, () => this.updateSelectionState());
|
|
1072
|
+
ui.model.bind(EVENT_DESELECT, () => this.updateSelectionState());
|
|
1073
|
+
ui.model.bind(EVENT_SELECTION_CLEARED, () => this.updateSelectionState());
|
|
1074
|
+
this.$cdr.detectChanges();
|
|
1075
|
+
}
|
|
1023
1076
|
});
|
|
1024
1077
|
}
|
|
1025
1078
|
getNativeElement(component) {
|
|
@@ -1028,35 +1081,36 @@ class ControlsComponent {
|
|
|
1028
1081
|
component.location.nativeElement).childNodes[0];
|
|
1029
1082
|
}
|
|
1030
1083
|
panMode() {
|
|
1031
|
-
this.ui.setMode(SURFACE_MODE_PAN);
|
|
1084
|
+
this.ui().setMode(SURFACE_MODE_PAN);
|
|
1032
1085
|
}
|
|
1033
1086
|
selectMode() {
|
|
1034
|
-
this.ui.setMode(SURFACE_MODE_SELECT);
|
|
1087
|
+
this.ui().setMode(SURFACE_MODE_SELECT);
|
|
1035
1088
|
}
|
|
1036
1089
|
zoomToFit() {
|
|
1037
|
-
this.
|
|
1038
|
-
this.ui.zoomToFit();
|
|
1090
|
+
this.model().clearSelection();
|
|
1091
|
+
this.ui().zoomToFit();
|
|
1039
1092
|
}
|
|
1040
1093
|
zoomIn() {
|
|
1041
|
-
this.ui.zoomIn();
|
|
1094
|
+
this.ui().zoomIn();
|
|
1042
1095
|
}
|
|
1043
1096
|
zoomOut() {
|
|
1044
|
-
this.ui.zoomOut();
|
|
1097
|
+
this.ui().zoomOut();
|
|
1045
1098
|
}
|
|
1046
1099
|
resetSelection() {
|
|
1047
|
-
this.ui
|
|
1048
|
-
|
|
1049
|
-
|
|
1100
|
+
const ui = this.ui();
|
|
1101
|
+
this.model().clearSelection();
|
|
1102
|
+
if (supportsPathEditing(ui)) {
|
|
1103
|
+
ui.stopEditingPath();
|
|
1050
1104
|
}
|
|
1051
1105
|
}
|
|
1052
1106
|
undo() {
|
|
1053
|
-
this.
|
|
1107
|
+
this.model()?.undo();
|
|
1054
1108
|
}
|
|
1055
1109
|
redo() {
|
|
1056
|
-
this.
|
|
1110
|
+
this.model()?.redo();
|
|
1057
1111
|
}
|
|
1058
1112
|
doClear() {
|
|
1059
|
-
const t = this.
|
|
1113
|
+
const t = this.model();
|
|
1060
1114
|
if ((t.getNodeCount() === 0 && t.getGroupCount() === 0) ||
|
|
1061
1115
|
confirm(this.clearMessage)) {
|
|
1062
1116
|
t.clear();
|
|
@@ -1106,7 +1160,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1106
1160
|
<i *ngFor="let button of otherButtons" class="{{ button.class }}" title="{{ button.title }}"></i>
|
|
1107
1161
|
</div>`,
|
|
1108
1162
|
}]
|
|
1109
|
-
}], propDecorators: { undoRedo: [{
|
|
1163
|
+
}], ctorParameters: function () { return []; }, propDecorators: { undoRedo: [{
|
|
1110
1164
|
type: Input
|
|
1111
1165
|
}], zoomToExtents: [{
|
|
1112
1166
|
type: Input
|
|
@@ -1124,28 +1178,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1124
1178
|
|
|
1125
1179
|
|
|
1126
1180
|
class EdgeTypePickerComponent {
|
|
1181
|
+
resolveMappings() {
|
|
1182
|
+
const mappings = this.edgeMappings || this._inspector().getFromContext(INSPECTOR_CONTEXT_EDGE_PROPERTY_MAPPINGS);
|
|
1183
|
+
return mappings || this._inspector().$ui.$getEdgePropertyMappings();
|
|
1184
|
+
}
|
|
1127
1185
|
constructor(el) {
|
|
1128
1186
|
this.el = el;
|
|
1129
1187
|
|
|
1130
1188
|
this.changeEvent = new EventEmitter();
|
|
1131
1189
|
this.$vjs = inject(VisuallyJsService);
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1190
|
+
this._inspector = this.$vjs.inspector;
|
|
1191
|
+
this.initialised = false;
|
|
1192
|
+
effect(() => {
|
|
1193
|
+
if (!this.initialised) {
|
|
1194
|
+
const inspector = this._inspector();
|
|
1195
|
+
if (inspector != null) {
|
|
1196
|
+
this.initialised = true;
|
|
1197
|
+
inspector.onChange(() => {
|
|
1198
|
+
this.edgeTypePicker.select(this.propertyName, inspector.getValue(this.propertyName));
|
|
1199
|
+
});
|
|
1200
|
+
const current = inspector.getValue(this.propertyName) || '';
|
|
1201
|
+
this.edgeTypePicker = new EdgeTypePicker(inspector.$ui, this.el.nativeElement, this.resolveMappings(), current, (p, v) => {
|
|
1202
|
+
inspector.setValue(this.propertyName, v);
|
|
1203
|
+
this.changeEvent.emit(v);
|
|
1204
|
+
});
|
|
1205
|
+
this.edgeTypePicker.render(this.propertyName, inspector._currentCommonData);
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1149
1208
|
});
|
|
1150
1209
|
}
|
|
1151
1210
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EdgeTypePickerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1170,42 +1229,47 @@ class PaletteComponent {
|
|
|
1170
1229
|
constructor() {
|
|
1171
1230
|
this.$vjs = inject(VisuallyJsService);
|
|
1172
1231
|
this.$el = inject(ElementRef);
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1232
|
+
this.$surface = this.$vjs.surface;
|
|
1233
|
+
this.initialized = false;
|
|
1234
|
+
effect(() => {
|
|
1235
|
+
if (!this.initialized) {
|
|
1236
|
+
const surface = this.$surface();
|
|
1237
|
+
if (surface != null) {
|
|
1238
|
+
this.initialized = true;
|
|
1239
|
+
let self = this;
|
|
1240
|
+
let params = {
|
|
1241
|
+
source: self.$el.nativeElement,
|
|
1242
|
+
selector: self.selector,
|
|
1243
|
+
allowDropOnEdge: this.allowDropOnEdge,
|
|
1244
|
+
allowDropOnCanvas: this.allowDropOnCanvas,
|
|
1245
|
+
allowDropOnGroup: this.allowDropOnGroup,
|
|
1246
|
+
allowDropOnNode: this.allowDropOnNode,
|
|
1247
|
+
mode: this.mode,
|
|
1248
|
+
selectAfterAdd: this.selectAfterAdd,
|
|
1249
|
+
allowClickToAdd: this.allowClickToAdd,
|
|
1250
|
+
clickToAddOnly: this.clickToAddOnly
|
|
1251
|
+
};
|
|
1252
|
+
if (this.dataGenerator != null) {
|
|
1253
|
+
params.dataGenerator = this.dataGenerator;
|
|
1254
|
+
}
|
|
1255
|
+
if (this.typeGenerator != null) {
|
|
1256
|
+
params.typeGenerator = this.typeGenerator;
|
|
1257
|
+
}
|
|
1258
|
+
if (this.groupIdentifier != null) {
|
|
1259
|
+
params.groupIdentifier = this.groupIdentifier;
|
|
1260
|
+
}
|
|
1261
|
+
if (this.onVertexAdded != null) {
|
|
1262
|
+
params.onVertexAdded = this.onVertexAdded;
|
|
1263
|
+
}
|
|
1264
|
+
if (this.dragSize != null) {
|
|
1265
|
+
params.dragSize = this.dragSize;
|
|
1266
|
+
}
|
|
1267
|
+
if (this.canvasDropFilter != null) {
|
|
1268
|
+
params.canvasDropFilter = this.canvasDropFilter;
|
|
1269
|
+
}
|
|
1270
|
+
this.palette = new Palette(surface, params);
|
|
1271
|
+
}
|
|
1207
1272
|
}
|
|
1208
|
-
this.palette = new Palette(surface, params);
|
|
1209
1273
|
});
|
|
1210
1274
|
}
|
|
1211
1275
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -1216,7 +1280,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1216
1280
|
args: [{
|
|
1217
1281
|
selector: "[vjs-palette]",
|
|
1218
1282
|
}]
|
|
1219
|
-
}], propDecorators: { selector: [{
|
|
1283
|
+
}], ctorParameters: function () { return []; }, propDecorators: { selector: [{
|
|
1220
1284
|
type: Input
|
|
1221
1285
|
}], dataGenerator: [{
|
|
1222
1286
|
type: Input
|
|
@@ -1264,20 +1328,18 @@ class ExportControlsComponent {
|
|
|
1264
1328
|
// new
|
|
1265
1329
|
this.$vjs = inject(VisuallyJsService);
|
|
1266
1330
|
this.$el = inject(ElementRef);
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
this
|
|
1270
|
-
this.ui = b;
|
|
1271
|
-
});
|
|
1331
|
+
|
|
1332
|
+
this.ui = this.$vjs.ui;
|
|
1333
|
+
this.model = computed(() => this.ui()?.model);
|
|
1272
1334
|
}
|
|
1273
1335
|
exportSVG() {
|
|
1274
|
-
new SvgExportUI(this.ui).export(this.svgOptions);
|
|
1336
|
+
new SvgExportUI(this.ui()).export(this.svgOptions);
|
|
1275
1337
|
}
|
|
1276
1338
|
exportPNG() {
|
|
1277
|
-
new ImageExportUI(this.ui).export(this.imageOptions);
|
|
1339
|
+
new ImageExportUI(this.ui()).export(this.imageOptions);
|
|
1278
1340
|
}
|
|
1279
1341
|
exportJPG() {
|
|
1280
|
-
new ImageExportUI(this.ui).export(Object.assign(this.imageOptions || {}, {
|
|
1342
|
+
new ImageExportUI(this.ui()).export(Object.assign(this.imageOptions || {}, {
|
|
1281
1343
|
type: "image/jpeg",
|
|
1282
1344
|
}));
|
|
1283
1345
|
}
|
|
@@ -1330,9 +1392,39 @@ class ColorPickerComponent {
|
|
|
1330
1392
|
this.$vjs = inject(VisuallyJsService);
|
|
1331
1393
|
this.$el = inject(ElementRef);
|
|
1332
1394
|
this.$cdr = inject(ChangeDetectorRef);
|
|
1395
|
+
this.initialized = false;
|
|
1396
|
+
effect(() => {
|
|
1397
|
+
const i = this.$vjs.inspector();
|
|
1398
|
+
if (!this.initialized) {
|
|
1399
|
+
this.initialized = true;
|
|
1400
|
+
this.swatches.set(i.ensureContext(INSPECTOR_CONTEXT_RECENT_COLORS, () => []));
|
|
1401
|
+
i.bind(EVENT_CONTEXT_UPDATE, (p) => {
|
|
1402
|
+
if (p.key === INSPECTOR_CONTEXT_RECENT_COLORS) {
|
|
1403
|
+
this.swatches.set(p.value);
|
|
1404
|
+
this.$cdr.detectChanges();
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1407
|
+
const colorInput = this.$el.nativeElement.querySelector("[type='color']");
|
|
1408
|
+
colorInput.onchange = () => {
|
|
1409
|
+
const color = colorInput.value;
|
|
1410
|
+
this.pushColor(color);
|
|
1411
|
+
i.setValue(this.propertyName, color, true);
|
|
1412
|
+
};
|
|
1413
|
+
setTimeout(() => {
|
|
1414
|
+
// if there is a color, maybe push to context
|
|
1415
|
+
const v = i.getValue(this.propertyName);
|
|
1416
|
+
if (v != null) {
|
|
1417
|
+
this.pushColor(v);
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1333
1422
|
}
|
|
1334
1423
|
$getInspector(cb) {
|
|
1335
|
-
this.$vjs.
|
|
1424
|
+
const i = this.$vjs.inspector();
|
|
1425
|
+
if (i != null) {
|
|
1426
|
+
cb(i);
|
|
1427
|
+
}
|
|
1336
1428
|
}
|
|
1337
1429
|
selectColor(color) {
|
|
1338
1430
|
this.$getInspector(inspector => {
|
|
@@ -1355,30 +1447,6 @@ class ColorPickerComponent {
|
|
|
1355
1447
|
}
|
|
1356
1448
|
});
|
|
1357
1449
|
}
|
|
1358
|
-
ngAfterViewInit() {
|
|
1359
|
-
this.$getInspector(inspector => {
|
|
1360
|
-
this.swatches.set(inspector.ensureContext(INSPECTOR_CONTEXT_RECENT_COLORS, () => []));
|
|
1361
|
-
inspector.bind(EVENT_CONTEXT_UPDATE, (p) => {
|
|
1362
|
-
if (p.key === INSPECTOR_CONTEXT_RECENT_COLORS) {
|
|
1363
|
-
this.swatches.set(p.value);
|
|
1364
|
-
this.$cdr.detectChanges();
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
const colorInput = this.$el.nativeElement.querySelector("[type='color']");
|
|
1368
|
-
colorInput.onchange = () => {
|
|
1369
|
-
const color = colorInput.value;
|
|
1370
|
-
this.pushColor(color);
|
|
1371
|
-
inspector.setValue(this.propertyName, color, true);
|
|
1372
|
-
};
|
|
1373
|
-
setTimeout(() => {
|
|
1374
|
-
// if there is a color, maybe push to context
|
|
1375
|
-
const v = inspector.getValue(this.propertyName);
|
|
1376
|
-
if (v != null) {
|
|
1377
|
-
this.pushColor(v);
|
|
1378
|
-
}
|
|
1379
|
-
});
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
1450
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1383
1451
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorPickerComponent, selector: "vjs-color", inputs: { propertyName: "propertyName", maxColors: "maxColors" }, outputs: { changeEvent: "changeEvent" }, ngImport: i0, template: "<div class=\"vjs-color-picker\">\n <input type=\"color\" [attr.vjs-att]=\"propertyName\"/>\n <div class=\"vjs-color-picker-swatches\">\n <div *ngFor=\"let swatch of swatches()\" class=\"vjs-color-picker-swatch\" attr.data-color=\"{{swatch}}\" style=\"background-color:{{swatch}}\" (click)=\"selectColor(swatch)\"></div>\n </div>\n </div>", isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
1384
1452
|
}
|
|
@@ -1393,7 +1461,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1393
1461
|
</div>
|
|
1394
1462
|
</div>`
|
|
1395
1463
|
}]
|
|
1396
|
-
}], propDecorators: { propertyName: [{
|
|
1464
|
+
}], ctorParameters: function () { return []; }, propDecorators: { propertyName: [{
|
|
1397
1465
|
type: Input
|
|
1398
1466
|
}], maxColors: [{
|
|
1399
1467
|
type: Input
|
|
@@ -1450,17 +1518,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1450
1518
|
type: Input
|
|
1451
1519
|
}] } });
|
|
1452
1520
|
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
this.$el = inject(ElementRef);
|
|
1456
|
-
this.$ngZone = inject(NgZone);
|
|
1457
|
-
this.$vjs = inject(VisuallyJsService);
|
|
1458
|
-
}
|
|
1521
|
+
|
|
1522
|
+
class SeriesBasedChartComponent {
|
|
1459
1523
|
_init(dataSource, data, url) {
|
|
1460
1524
|
this.$ngZone.runOutsideAngular(() => {
|
|
1461
1525
|
const o = Object.assign({}, this.options);
|
|
1462
1526
|
Object.assign(o, { dataSource });
|
|
1463
|
-
this.chart =
|
|
1527
|
+
this.chart = this.createChart(this.$el.nativeElement, o);
|
|
1464
1528
|
if (data) {
|
|
1465
1529
|
this.chart.load({ data });
|
|
1466
1530
|
}
|
|
@@ -1469,22 +1533,50 @@ class ColumnChartComponent {
|
|
|
1469
1533
|
}
|
|
1470
1534
|
});
|
|
1471
1535
|
}
|
|
1536
|
+
constructor() {
|
|
1537
|
+
this.$el = inject(ElementRef);
|
|
1538
|
+
this.$ngZone = inject(NgZone);
|
|
1539
|
+
this.$vjs = inject(VisuallyJsService);
|
|
1540
|
+
effect(() => {
|
|
1541
|
+
if (this.useModel && this.chart == null) {
|
|
1542
|
+
const m = this.$vjs.model();
|
|
1543
|
+
if (m != null) {
|
|
1544
|
+
this._init(m, null, null);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1472
1549
|
|
|
1473
1550
|
ngAfterViewInit() {
|
|
1474
|
-
if (this.useModel) {
|
|
1475
|
-
this.$vjs.getModel((p) => {
|
|
1476
|
-
this._init(p, null, null);
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
else {
|
|
1551
|
+
if (!this.useModel) {
|
|
1480
1552
|
this._init(null, this.data, this.url);
|
|
1481
1553
|
}
|
|
1482
1554
|
}
|
|
1483
1555
|
ngOnDestroy() {
|
|
1484
1556
|
this.chart?.destroy();
|
|
1485
1557
|
}
|
|
1486
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
1487
|
-
static { this.ɵ
|
|
1558
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SeriesBasedChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1559
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SeriesBasedChartComponent }); }
|
|
1560
|
+
}
|
|
1561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SeriesBasedChartComponent, decorators: [{
|
|
1562
|
+
type: Injectable
|
|
1563
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
1564
|
+
type: Input
|
|
1565
|
+
}], url: [{
|
|
1566
|
+
type: Input
|
|
1567
|
+
}], options: [{
|
|
1568
|
+
type: Input
|
|
1569
|
+
}], useModel: [{
|
|
1570
|
+
type: Input
|
|
1571
|
+
}] } });
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
class ColumnChartComponent extends SeriesBasedChartComponent {
|
|
1575
|
+
createChart(el, options) {
|
|
1576
|
+
return new ColumnChart(el, options);
|
|
1577
|
+
}
|
|
1578
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1579
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColumnChartComponent, selector: "vjs-column-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1488
1580
|
}
|
|
1489
1581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChartComponent, decorators: [{
|
|
1490
1582
|
type: Component,
|
|
@@ -1502,41 +1594,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1502
1594
|
type: Input
|
|
1503
1595
|
}] } });
|
|
1504
1596
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
this.$ngZone = inject(NgZone);
|
|
1510
|
-
}
|
|
1511
|
-
_init(dataSource, data, url) {
|
|
1512
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1513
|
-
const o = Object.assign({}, this.options);
|
|
1514
|
-
Object.assign(o, { dataSource });
|
|
1515
|
-
this.chart = new BarChart(this.$el.nativeElement, o);
|
|
1516
|
-
if (data) {
|
|
1517
|
-
this.chart.load({ data });
|
|
1518
|
-
}
|
|
1519
|
-
else if (url) {
|
|
1520
|
-
this.chart.load({ url });
|
|
1521
|
-
}
|
|
1522
|
-
});
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
ngAfterViewInit() {
|
|
1526
|
-
if (this.useModel) {
|
|
1527
|
-
this.$vjs.getModel((p) => {
|
|
1528
|
-
this._init(p, null, null);
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
else {
|
|
1532
|
-
this._init(null, this.data, this.url);
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
ngOnDestroy() {
|
|
1536
|
-
this.chart?.destroy();
|
|
1597
|
+
|
|
1598
|
+
class BarChartComponent extends SeriesBasedChartComponent {
|
|
1599
|
+
createChart(el, options) {
|
|
1600
|
+
return new BarChart(el, options);
|
|
1537
1601
|
}
|
|
1538
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BarChartComponent, deps:
|
|
1539
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BarChartComponent, selector: "vjs-bar-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1602
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BarChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1603
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BarChartComponent, selector: "vjs-bar-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1540
1604
|
}
|
|
1541
1605
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BarChartComponent, decorators: [{
|
|
1542
1606
|
type: Component,
|
|
@@ -1554,44 +1618,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1554
1618
|
type: Input
|
|
1555
1619
|
}] } });
|
|
1556
1620
|
|
|
1621
|
+
|
|
1557
1622
|
class DiagramPaletteComponent {
|
|
1623
|
+
$init(diagram) {
|
|
1624
|
+
if (!this.initialized) {
|
|
1625
|
+
|
|
1626
|
+
new DiagramPalette(this.$el.nativeElement, diagram, {
|
|
1627
|
+
fill: this.fill,
|
|
1628
|
+
outline: this.outline,
|
|
1629
|
+
dragSize: this.dragSize,
|
|
1630
|
+
inspector: this.inspector,
|
|
1631
|
+
iconSize: this.iconSize,
|
|
1632
|
+
showLabels: this.showLabels,
|
|
1633
|
+
paletteStrokeWidth: this.paletteStrokeWidth,
|
|
1634
|
+
showAllMessage: this.showAllMessage,
|
|
1635
|
+
onCellAdded: this.onCellAdded,
|
|
1636
|
+
mode: this.mode,
|
|
1637
|
+
allowClickToAdd: this.allowClickToAdd,
|
|
1638
|
+
autoExitDrawMode: this.autoExitDrawMode,
|
|
1639
|
+
selectAfterAdd: this.selectAfterAdd,
|
|
1640
|
+
onVertexAdded: this.onVertexAdded,
|
|
1641
|
+
preparedShapes: this.preparedShapes
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1558
1645
|
constructor() {
|
|
1559
1646
|
this.$el = inject(ElementRef);
|
|
1560
1647
|
this.$vjs = inject(VisuallyJsService);
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
dragSize: this.dragSize,
|
|
1568
|
-
inspector: this.inspector,
|
|
1569
|
-
iconSize: this.iconSize,
|
|
1570
|
-
showLabels: this.showLabels,
|
|
1571
|
-
paletteStrokeWidth: this.paletteStrokeWidth,
|
|
1572
|
-
showAllMessage: this.showAllMessage,
|
|
1573
|
-
onCellAdded: this.onCellAdded,
|
|
1574
|
-
mode: this.mode,
|
|
1575
|
-
allowClickToAdd: this.allowClickToAdd,
|
|
1576
|
-
autoExitDrawMode: this.autoExitDrawMode,
|
|
1577
|
-
selectAfterAdd: this.selectAfterAdd,
|
|
1578
|
-
onVertexAdded: this.onVertexAdded,
|
|
1579
|
-
preparedShapes: this.preparedShapes
|
|
1648
|
+
this.initialized = false;
|
|
1649
|
+
effect(() => {
|
|
1650
|
+
const d = this.$vjs.diagram();
|
|
1651
|
+
if (d != null) {
|
|
1652
|
+
this.$init(d);
|
|
1653
|
+
}
|
|
1580
1654
|
});
|
|
1581
1655
|
}
|
|
1582
1656
|
ngAfterViewInit() {
|
|
1583
|
-
if (this.
|
|
1584
|
-
this.$init();
|
|
1585
|
-
}
|
|
1586
|
-
else {
|
|
1587
|
-
this.$vjs.getDiagram((d) => {
|
|
1588
|
-
this.diagram = d;
|
|
1589
|
-
this.$init();
|
|
1590
|
-
});
|
|
1657
|
+
if (this.inputDiagram != null) {
|
|
1658
|
+
this.$init(this.inputDiagram);
|
|
1591
1659
|
}
|
|
1592
1660
|
}
|
|
1593
1661
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1594
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagramPaletteComponent, selector: "vjs-diagram-palette", inputs: { fill: "fill", outline: "outline", dragSize: "dragSize", inspector: "inspector", iconSize: "iconSize", showLabels: "showLabels", paletteStrokeWidth: "paletteStrokeWidth", showAllMessage: "showAllMessage", onCellAdded: "onCellAdded", mode: "mode", allowClickToAdd: "allowClickToAdd", autoExitDrawMode: "autoExitDrawMode", selectAfterAdd: "selectAfterAdd",
|
|
1662
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagramPaletteComponent, selector: "vjs-diagram-palette", inputs: { fill: "fill", outline: "outline", dragSize: "dragSize", inspector: "inspector", iconSize: "iconSize", showLabels: "showLabels", paletteStrokeWidth: "paletteStrokeWidth", showAllMessage: "showAllMessage", onCellAdded: "onCellAdded", mode: "mode", allowClickToAdd: "allowClickToAdd", autoExitDrawMode: "autoExitDrawMode", selectAfterAdd: "selectAfterAdd", inputDiagram: ["diagram", "inputDiagram"], onVertexAdded: "onVertexAdded", preparedShapes: "preparedShapes" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1595
1663
|
}
|
|
1596
1664
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramPaletteComponent, decorators: [{
|
|
1597
1665
|
type: Component,
|
|
@@ -1599,7 +1667,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1599
1667
|
selector: "vjs-diagram-palette",
|
|
1600
1668
|
template: `<div></div>`,
|
|
1601
1669
|
}]
|
|
1602
|
-
}], propDecorators: { fill: [{
|
|
1670
|
+
}], ctorParameters: function () { return []; }, propDecorators: { fill: [{
|
|
1603
1671
|
type: Input
|
|
1604
1672
|
}], outline: [{
|
|
1605
1673
|
type: Input
|
|
@@ -1625,36 +1693,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1625
1693
|
type: Input
|
|
1626
1694
|
}], selectAfterAdd: [{
|
|
1627
1695
|
type: Input
|
|
1628
|
-
}],
|
|
1629
|
-
type: Input
|
|
1696
|
+
}], inputDiagram: [{
|
|
1697
|
+
type: Input,
|
|
1698
|
+
args: [{ alias: "diagram" }]
|
|
1630
1699
|
}], onVertexAdded: [{
|
|
1631
1700
|
type: Input
|
|
1632
1701
|
}], preparedShapes: [{
|
|
1633
1702
|
type: Input
|
|
1634
1703
|
}] } });
|
|
1635
1704
|
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
|
-
ngAfterViewInit() {
|
|
1643
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1644
|
-
this.chart = new CategoryValueChart(this.$el.nativeElement, this.options);
|
|
1645
|
-
if (this.data) {
|
|
1646
|
-
this.chart.load({ data: this.data });
|
|
1647
|
-
}
|
|
1648
|
-
else if (this.url) {
|
|
1649
|
-
this.chart.load({ url: this.url });
|
|
1650
|
-
}
|
|
1651
|
-
});
|
|
1652
|
-
}
|
|
1653
|
-
ngOnDestroy() {
|
|
1654
|
-
this.chart?.destroy();
|
|
1705
|
+
|
|
1706
|
+
class XYChartComponent extends SeriesBasedChartComponent {
|
|
1707
|
+
createChart(el, options) {
|
|
1708
|
+
return new CategoryValueChart(el, options);
|
|
1655
1709
|
}
|
|
1656
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: XYChartComponent, deps:
|
|
1657
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: XYChartComponent, selector: "vjs-xy-chart", inputs: { data: "data", url: "url", options: "options" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1710
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: XYChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1711
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: XYChartComponent, selector: "vjs-xy-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1658
1712
|
}
|
|
1659
1713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: XYChartComponent, decorators: [{
|
|
1660
1714
|
type: Component,
|
|
@@ -1668,43 +1722,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1668
1722
|
type: Input
|
|
1669
1723
|
}], options: [{
|
|
1670
1724
|
type: Input
|
|
1725
|
+
}], useModel: [{
|
|
1726
|
+
type: Input
|
|
1671
1727
|
}] } });
|
|
1672
1728
|
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
this.$vjs = inject(VisuallyJsService);
|
|
1678
|
-
}
|
|
1679
|
-
_init(dataSource, data, url) {
|
|
1680
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1681
|
-
const o = Object.assign({}, this.options);
|
|
1682
|
-
Object.assign(o, { dataSource });
|
|
1683
|
-
this.chart = new LineChart(this.$el.nativeElement, o);
|
|
1684
|
-
if (data) {
|
|
1685
|
-
this.chart.load({ data });
|
|
1686
|
-
}
|
|
1687
|
-
else if (url) {
|
|
1688
|
-
this.chart.load({ url });
|
|
1689
|
-
}
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
ngAfterViewInit() {
|
|
1694
|
-
if (this.useModel) {
|
|
1695
|
-
this.$vjs.getModel((p) => {
|
|
1696
|
-
this._init(p, null, null);
|
|
1697
|
-
});
|
|
1698
|
-
}
|
|
1699
|
-
else {
|
|
1700
|
-
this._init(null, this.data, this.url);
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
ngOnDestroy() {
|
|
1704
|
-
this.chart?.destroy();
|
|
1729
|
+
|
|
1730
|
+
class LineChartComponent extends SeriesBasedChartComponent {
|
|
1731
|
+
createChart(el, options) {
|
|
1732
|
+
return new LineChart(el, options);
|
|
1705
1733
|
}
|
|
1706
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LineChartComponent, deps:
|
|
1707
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LineChartComponent, selector: "vjs-line-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1734
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LineChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1735
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LineChartComponent, selector: "vjs-line-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1708
1736
|
}
|
|
1709
1737
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
1710
1738
|
type: Component,
|
|
@@ -1722,41 +1750,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1722
1750
|
type: Input
|
|
1723
1751
|
}] } });
|
|
1724
1752
|
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
this.$ngZone = inject(NgZone);
|
|
1730
|
-
}
|
|
1731
|
-
_init(dataSource, data, url) {
|
|
1732
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1733
|
-
const o = Object.assign({}, this.options);
|
|
1734
|
-
Object.assign(o, { dataSource });
|
|
1735
|
-
this.chart = new AreaChart(this.$el.nativeElement, o);
|
|
1736
|
-
if (data) {
|
|
1737
|
-
this.chart.load({ data });
|
|
1738
|
-
}
|
|
1739
|
-
else if (url) {
|
|
1740
|
-
this.chart.load({ url });
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
ngAfterViewInit() {
|
|
1746
|
-
if (this.useModel) {
|
|
1747
|
-
this.$vjs.getModel((p) => {
|
|
1748
|
-
this._init(p, null, null);
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
|
-
else {
|
|
1752
|
-
this._init(null, this.data, this.url);
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
ngOnDestroy() {
|
|
1756
|
-
this.chart?.destroy();
|
|
1753
|
+
|
|
1754
|
+
class AreaChartComponent extends SeriesBasedChartComponent {
|
|
1755
|
+
createChart(el, options) {
|
|
1756
|
+
return new AreaChart(el, options);
|
|
1757
1757
|
}
|
|
1758
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AreaChartComponent, deps:
|
|
1759
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AreaChartComponent, selector: "vjs-area-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1758
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AreaChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1759
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AreaChartComponent, selector: "vjs-area-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1760
1760
|
}
|
|
1761
1761
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AreaChartComponent, decorators: [{
|
|
1762
1762
|
type: Component,
|
|
@@ -1774,41 +1774,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1774
1774
|
type: Input
|
|
1775
1775
|
}] } });
|
|
1776
1776
|
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
this.$vjs = inject(VisuallyJsService);
|
|
1782
|
-
}
|
|
1783
|
-
_init(dataSource, data, url) {
|
|
1784
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1785
|
-
const o = Object.assign({}, this.options);
|
|
1786
|
-
Object.assign(o, { dataSource });
|
|
1787
|
-
this.chart = new PieChart(this.$el.nativeElement, o);
|
|
1788
|
-
if (data) {
|
|
1789
|
-
this.chart.load({ data });
|
|
1790
|
-
}
|
|
1791
|
-
else if (url) {
|
|
1792
|
-
this.chart.load({ url });
|
|
1793
|
-
}
|
|
1794
|
-
});
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
ngAfterViewInit() {
|
|
1798
|
-
if (this.useModel) {
|
|
1799
|
-
this.$vjs.getModel((p) => {
|
|
1800
|
-
this._init(p, null, null);
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
else {
|
|
1804
|
-
this._init(null, this.data, this.url);
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
ngOnDestroy() {
|
|
1808
|
-
this.chart?.destroy();
|
|
1777
|
+
|
|
1778
|
+
class PieChartComponent extends SeriesBasedChartComponent {
|
|
1779
|
+
createChart(el, options) {
|
|
1780
|
+
return new PieChart(el, options);
|
|
1809
1781
|
}
|
|
1810
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PieChartComponent, deps:
|
|
1811
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PieChartComponent, selector: "vjs-pie-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1782
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PieChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1783
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PieChartComponent, selector: "vjs-pie-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1812
1784
|
}
|
|
1813
1785
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PieChartComponent, decorators: [{
|
|
1814
1786
|
type: Component,
|
|
@@ -1826,41 +1798,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1826
1798
|
type: Input
|
|
1827
1799
|
}] } });
|
|
1828
1800
|
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
this.$vjs = inject(VisuallyJsService);
|
|
1834
|
-
}
|
|
1835
|
-
_init(dataSource, data, url) {
|
|
1836
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1837
|
-
const o = Object.assign({}, this.options);
|
|
1838
|
-
Object.assign(o, { dataSource });
|
|
1839
|
-
this.chart = new ScatterChart(this.$el.nativeElement, o);
|
|
1840
|
-
if (data) {
|
|
1841
|
-
this.chart.load({ data });
|
|
1842
|
-
}
|
|
1843
|
-
else if (url) {
|
|
1844
|
-
this.chart.load({ url });
|
|
1845
|
-
}
|
|
1846
|
-
});
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
ngAfterViewInit() {
|
|
1850
|
-
if (this.useModel) {
|
|
1851
|
-
this.$vjs.getModel((p) => {
|
|
1852
|
-
this._init(p, null, null);
|
|
1853
|
-
});
|
|
1854
|
-
}
|
|
1855
|
-
else {
|
|
1856
|
-
this._init(null, this.data, this.url);
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
ngOnDestroy() {
|
|
1860
|
-
this.chart?.destroy();
|
|
1801
|
+
|
|
1802
|
+
class ScatterChartComponent extends SeriesBasedChartComponent {
|
|
1803
|
+
createChart(el, options) {
|
|
1804
|
+
return new ScatterChart(el, options);
|
|
1861
1805
|
}
|
|
1862
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScatterChartComponent, deps:
|
|
1863
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ScatterChartComponent, selector: "vjs-scatter-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1806
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScatterChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1807
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ScatterChartComponent, selector: "vjs-scatter-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1864
1808
|
}
|
|
1865
1809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ScatterChartComponent, decorators: [{
|
|
1866
1810
|
type: Component,
|
|
@@ -1878,41 +1822,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1878
1822
|
type: Input
|
|
1879
1823
|
}] } });
|
|
1880
1824
|
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
this.$vjs = inject(VisuallyJsService);
|
|
1886
|
-
}
|
|
1887
|
-
_init(dataSource, data, url) {
|
|
1888
|
-
this.$ngZone.runOutsideAngular(() => {
|
|
1889
|
-
const o = Object.assign({}, this.options);
|
|
1890
|
-
Object.assign(o, { dataSource });
|
|
1891
|
-
this.chart = new BubbleChart(this.$el.nativeElement, o);
|
|
1892
|
-
if (data) {
|
|
1893
|
-
this.chart.load({ data });
|
|
1894
|
-
}
|
|
1895
|
-
else if (url) {
|
|
1896
|
-
this.chart.load({ url });
|
|
1897
|
-
}
|
|
1898
|
-
});
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
ngAfterViewInit() {
|
|
1902
|
-
if (this.useModel) {
|
|
1903
|
-
this.$vjs.getModel((p) => {
|
|
1904
|
-
this._init(p, null, null);
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
else {
|
|
1908
|
-
this._init(null, this.data, this.url);
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
ngOnDestroy() {
|
|
1912
|
-
this.chart?.destroy();
|
|
1825
|
+
|
|
1826
|
+
class BubbleChartComponent extends SeriesBasedChartComponent {
|
|
1827
|
+
createChart(el, options) {
|
|
1828
|
+
return new BubbleChart(el, options);
|
|
1913
1829
|
}
|
|
1914
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BubbleChartComponent, deps:
|
|
1915
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BubbleChartComponent, selector: "vjs-bubble-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1830
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BubbleChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1831
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BubbleChartComponent, selector: "vjs-bubble-chart", inputs: { data: "data", url: "url", options: "options", useModel: "useModel" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true }); }
|
|
1916
1832
|
}
|
|
1917
1833
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BubbleChartComponent, decorators: [{
|
|
1918
1834
|
type: Component,
|
|
@@ -1930,11 +1846,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1930
1846
|
type: Input
|
|
1931
1847
|
}] } });
|
|
1932
1848
|
|
|
1849
|
+
|
|
1933
1850
|
class SankeyChartComponent {
|
|
1934
1851
|
constructor() {
|
|
1935
1852
|
this.$el = inject(ElementRef);
|
|
1936
1853
|
this.$ngZone = inject(NgZone);
|
|
1937
1854
|
this.$vjs = inject(VisuallyJsService);
|
|
1855
|
+
effect(() => {
|
|
1856
|
+
if (this.useModel && this.chart == null) {
|
|
1857
|
+
const m = this.$vjs.model();
|
|
1858
|
+
if (m != null) {
|
|
1859
|
+
this._init(m, null, null, null);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1938
1863
|
}
|
|
1939
1864
|
|
|
1940
1865
|
_init(dataSource, csvData, jsonData, url) {
|
|
@@ -1957,12 +1882,7 @@ class SankeyChartComponent {
|
|
|
1957
1882
|
}
|
|
1958
1883
|
|
|
1959
1884
|
ngAfterViewInit() {
|
|
1960
|
-
if (this.useModel) {
|
|
1961
|
-
this.$vjs.getModel((p) => {
|
|
1962
|
-
this._init(p, null, null, null);
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
else {
|
|
1885
|
+
if (!this.useModel) {
|
|
1966
1886
|
this._init(null, this.csvData, this.jsonData, this.url);
|
|
1967
1887
|
}
|
|
1968
1888
|
}
|
|
@@ -1985,7 +1905,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1985
1905
|
selector: "vjs-sankey-chart",
|
|
1986
1906
|
template: `<div></div>`
|
|
1987
1907
|
}]
|
|
1988
|
-
}], propDecorators: { csvData: [{
|
|
1908
|
+
}], ctorParameters: function () { return []; }, propDecorators: { csvData: [{
|
|
1989
1909
|
type: Input
|
|
1990
1910
|
}], jsonData: [{
|
|
1991
1911
|
type: Input
|
|
@@ -2181,32 +2101,34 @@ class InspectorComponent {
|
|
|
2181
2101
|
this.changeDetector = inject(ChangeDetectorRef);
|
|
2182
2102
|
|
|
2183
2103
|
this.el = inject(ElementRef);
|
|
2184
|
-
// new
|
|
2185
2104
|
this.$vjs = inject(VisuallyJsService);
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
this.
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2105
|
+
this.ui = this.$vjs.ui;
|
|
2106
|
+
this.model = computed(() => this.ui()?.model);
|
|
2107
|
+
this.initialized = false;
|
|
2108
|
+
effect(() => {
|
|
2109
|
+
const ui = this.ui();
|
|
2110
|
+
if (!this.initialized && ui != null) {
|
|
2111
|
+
this.initialized = true;
|
|
2112
|
+
this.inspector = new Inspector({
|
|
2113
|
+
context: this.context,
|
|
2114
|
+
container: this.el.nativeElement,
|
|
2115
|
+
cssClass: this.cssClass,
|
|
2116
|
+
showCloseButton: this.showCloseButton,
|
|
2117
|
+
ui,
|
|
2118
|
+
renderEmptyContainer: () => {
|
|
2119
|
+
this.reset();
|
|
2120
|
+
this.changeDetector.detectChanges();
|
|
2121
|
+
},
|
|
2122
|
+
refresh: (obj, cb) => {
|
|
2123
|
+
this.currentObj = obj;
|
|
2124
|
+
this.refresh(obj);
|
|
2125
|
+
setTimeout(cb, 0);
|
|
2126
|
+
this.changeDetector.detectChanges();
|
|
2127
|
+
},
|
|
2128
|
+
afterUpdate: () => this.afterUpdate(ui),
|
|
2129
|
+
});
|
|
2130
|
+
this.$vjs.$setInspector(this.inspector);
|
|
2131
|
+
}
|
|
2210
2132
|
});
|
|
2211
2133
|
}
|
|
2212
2134
|
|
|
@@ -2226,7 +2148,7 @@ class InspectorComponent {
|
|
|
2226
2148
|
}
|
|
2227
2149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InspectorComponent, decorators: [{
|
|
2228
2150
|
type: Directive
|
|
2229
|
-
}], propDecorators: { cssClass: [{
|
|
2151
|
+
}], ctorParameters: function () { return []; }, propDecorators: { cssClass: [{
|
|
2230
2152
|
type: Input
|
|
2231
2153
|
}], showCloseButton: [{
|
|
2232
2154
|
type: Input
|
|
@@ -2235,8 +2157,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2235
2157
|
}] } });
|
|
2236
2158
|
|
|
2237
2159
|
|
|
2160
|
+
function useZoom() {
|
|
2161
|
+
const $vjs = inject(VisuallyJsService);
|
|
2162
|
+
const surface = $vjs.surface;
|
|
2163
|
+
const zoom = signal(1);
|
|
2164
|
+
effect(() => {
|
|
2165
|
+
const s = surface();
|
|
2166
|
+
if (s != null) {
|
|
2167
|
+
const zoomListener = (p) => {
|
|
2168
|
+
zoom.set(p.zoom);
|
|
2169
|
+
};
|
|
2170
|
+
s.bind(EVENT_ZOOM, zoomListener);
|
|
2171
|
+
zoom.set(s.getZoom());
|
|
2172
|
+
return () => {
|
|
2173
|
+
s.unbind(EVENT_ZOOM, zoomListener);
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
return;
|
|
2177
|
+
});
|
|
2178
|
+
return zoom;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
function useVisuallyJsUpdate(callback) {
|
|
2183
|
+
const $vjs = inject(VisuallyJsService);
|
|
2184
|
+
effect(() => {
|
|
2185
|
+
const m = $vjs.model();
|
|
2186
|
+
if (m != null) {
|
|
2187
|
+
const fn = () => callback(m);
|
|
2188
|
+
m.bind(EVENT_DATA_UPDATED, fn);
|
|
2189
|
+
m.bind(EVENT_GRAPH_CLEARED, fn);
|
|
2190
|
+
fn();
|
|
2191
|
+
return (() => {
|
|
2192
|
+
m.unbind(EVENT_DATA_UPDATED, fn);
|
|
2193
|
+
m.unbind(EVENT_GRAPH_CLEARED, fn);
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
return;
|
|
2197
|
+
});
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
|
|
2238
2201
|
|
|
2239
2202
|
|
|
2240
2203
|
|
|
2241
|
-
export { AngularComponentOverlayType, AreaChartComponent, BarChartComponent, BaseAngularOverlayComponent, BaseGroupComponent, BaseNodeComponent, BasePortComponent, BaseVertexComponent, BrowserUIAngularModel, BubbleChartComponent, ColorPickerComponent, ColumnChartComponent, ControlsComponent, DecoratorComponent, DefaultGroupComponent, DefaultNodeComponent, DiagramComponent, DiagramPaletteComponent, EdgeTypePickerComponent, ExportControlsComponent, InspectorComponent, LineChartComponent, MiniviewComponent, PaletteComponent, PieChartComponent, SankeyChartComponent, ScatterChartComponent, ShapeComponent, ShapePaletteComponent, SurfaceComponent, VisuallyJsModule, VisuallyJsService, XYChartComponent };
|
|
2204
|
+
export { AngularComponentOverlayType, AreaChartComponent, BarChartComponent, BaseAngularOverlayComponent, BaseGroupComponent, BaseNodeComponent, BasePortComponent, BaseVertexComponent, BrowserUIAngularModel, BubbleChartComponent, ColorPickerComponent, ColumnChartComponent, ControlsComponent, DecoratorComponent, DefaultGroupComponent, DefaultNodeComponent, DiagramComponent, DiagramPaletteComponent, EdgeTypePickerComponent, ExportControlsComponent, InspectorComponent, LineChartComponent, MiniviewComponent, PaletteComponent, PieChartComponent, SankeyChartComponent, ScatterChartComponent, SeriesBasedChartComponent, ShapeComponent, ShapePaletteComponent, SurfaceComponent, VisuallyJsModule, VisuallyJsService, XYChartComponent, useVisuallyJsUpdate, useZoom };
|
|
2242
2205
|
//# sourceMappingURL=visuallyjs-browser-ui-angular.mjs.map
|