@visuallyjs/browser-ui-angular 1.0.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/README.md +0 -0
- package/css/visuallyjs-angular.css +39 -0
- package/esm2022/index.mjs +34 -0
- package/esm2022/lib/base.group.component.mjs +43 -0
- package/esm2022/lib/base.node.component.mjs +41 -0
- package/esm2022/lib/base.port.component.mjs +71 -0
- package/esm2022/lib/base.vertex.component.mjs +75 -0
- package/esm2022/lib/browser-ui-angular.module.mjs +133 -0
- package/esm2022/lib/charts/area.chart.component.mjs +55 -0
- package/esm2022/lib/charts/bar.chart.component.mjs +55 -0
- package/esm2022/lib/charts/bubble.chart.component.mjs +55 -0
- package/esm2022/lib/charts/column.chart.component.mjs +55 -0
- package/esm2022/lib/charts/line.chart.component.mjs +55 -0
- package/esm2022/lib/charts/pie.chart.component.mjs +55 -0
- package/esm2022/lib/charts/sankey.chart.component.mjs +74 -0
- package/esm2022/lib/charts/scatter.chart.component.mjs +55 -0
- package/esm2022/lib/charts/xy.chart.component.mjs +39 -0
- package/esm2022/lib/color.tag.component.mjs +86 -0
- package/esm2022/lib/common.mjs +2 -0
- package/esm2022/lib/controls-component.mjs +164 -0
- package/esm2022/lib/decorator-component.mjs +52 -0
- package/esm2022/lib/default-group-component.mjs +18 -0
- package/esm2022/lib/default-node-component.mjs +18 -0
- package/esm2022/lib/diagram-component.mjs +53 -0
- package/esm2022/lib/diagram-palette-component.mjs +82 -0
- package/esm2022/lib/edge.type.picker.component.mjs +46 -0
- package/esm2022/lib/export-controls-component.mjs +75 -0
- package/esm2022/lib/inspector.component.mjs +77 -0
- package/esm2022/lib/miniview-component.mjs +63 -0
- package/esm2022/lib/model.mjs +8 -0
- package/esm2022/lib/overlay-component.mjs +18 -0
- package/esm2022/lib/palette.component.mjs +86 -0
- package/esm2022/lib/shape.component.mjs +85 -0
- package/esm2022/lib/shape.palette.component.mjs +78 -0
- package/esm2022/lib/surface-component.mjs +286 -0
- package/esm2022/lib/vjs-service.mjs +176 -0
- package/esm2022/visuallyjs-browser-ui-angular.mjs +2 -0
- package/fesm2022/visuallyjs-browser-ui-angular.mjs +2235 -0
- package/fesm2022/visuallyjs-browser-ui-angular.mjs.map +1 -0
- package/index.d.ts +40 -0
- package/lib/base.group.component.d.ts +60 -0
- package/lib/base.node.component.d.ts +55 -0
- package/lib/base.port.component.d.ts +74 -0
- package/lib/base.vertex.component.d.ts +111 -0
- package/lib/browser-ui-angular.module.d.ts +35 -0
- package/lib/charts/area.chart.component.d.ts +43 -0
- package/lib/charts/bar.chart.component.d.ts +40 -0
- package/lib/charts/bubble.chart.component.d.ts +40 -0
- package/lib/charts/column.chart.component.d.ts +40 -0
- package/lib/charts/line.chart.component.d.ts +39 -0
- package/lib/charts/pie.chart.component.d.ts +40 -0
- package/lib/charts/sankey.chart.component.d.ts +59 -0
- package/lib/charts/scatter.chart.component.d.ts +40 -0
- package/lib/charts/xy.chart.component.d.ts +32 -0
- package/lib/color.tag.component.d.ts +35 -0
- package/lib/common.d.ts +68 -0
- package/lib/controls-component.d.ts +71 -0
- package/lib/decorator-component.d.ts +25 -0
- package/lib/default-group-component.d.ts +11 -0
- package/lib/default-node-component.d.ts +11 -0
- package/lib/diagram-component.d.ts +52 -0
- package/lib/diagram-palette-component.d.ts +92 -0
- package/lib/edge.type.picker.component.d.ts +35 -0
- package/lib/export-controls-component.d.ts +59 -0
- package/lib/inspector.component.d.ts +96 -0
- package/lib/miniview-component.d.ts +45 -0
- package/lib/model.d.ts +8 -0
- package/lib/overlay-component.d.ts +59 -0
- package/lib/palette.component.d.ts +94 -0
- package/lib/shape.component.d.ts +70 -0
- package/lib/shape.palette.component.d.ts +73 -0
- package/lib/surface-component.d.ts +149 -0
- package/lib/vjs-service.d.ts +71 -0
- package/package.json +29 -0
- package/visuallyjs-browser-ui-angular.tgz +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from "@angular/core";
|
|
2
|
+
import { DataGeneratorFunction, GroupIdentifierFunction, OnVertexAddedCallback, Palette, Size, TypeGeneratorFunction, CanvasDropFilter, PaletteMode } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* @group Components
|
|
7
|
+
*/
|
|
8
|
+
export declare class PaletteComponent<T> implements AfterViewInit {
|
|
9
|
+
$vjs: VisuallyJsService;
|
|
10
|
+
$el: ElementRef<any>;
|
|
11
|
+
/**
|
|
12
|
+
* CSS3 selector identifying the child elements of the the element on which this directive was declared that act as drag sources. Optional; if omitted Visually JS will use `[data-vjs-type]`.
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
selector?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Function to use to generate an initial payload when the user starts to drag something from this component, or taps on an item in tap/draw mode. Optional, and if omitted Visually JS will use a default data generator that extracts data values from any `data-vjs-***` attributes on the element being dragged.
|
|
18
|
+
* @input
|
|
19
|
+
*/
|
|
20
|
+
dataGenerator?: DataGeneratorFunction<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Optional function to use to determine the type of object that a user has just started dragging or tapped on
|
|
23
|
+
* @input
|
|
24
|
+
*/
|
|
25
|
+
typeGenerator?: TypeGeneratorFunction<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional function to use to determine if the object that is being dragged represents a group. If this function is present, and returns true, then the drag object is considered to be a group. In all other cases the drag object is considered to be a node.
|
|
28
|
+
* @input
|
|
29
|
+
*/
|
|
30
|
+
groupIdentifier?: GroupIdentifierFunction<T>;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
palette: Palette<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Defaults to true. Allows items to be dropped onto edges in the canvas.
|
|
37
|
+
* @input
|
|
38
|
+
*/
|
|
39
|
+
allowDropOnEdge?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Defaults to true. Allows items to be dropped onto groups in the canvas.
|
|
42
|
+
* @input
|
|
43
|
+
*/
|
|
44
|
+
allowDropOnGroup?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Defaults to true. Allows items to be dropped onto whitespace.
|
|
47
|
+
* @input
|
|
48
|
+
*/
|
|
49
|
+
allowDropOnCanvas?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Defaults to false. Allows items to be dropped onto nodes in the canvas. If this is true and an element is dropped onto a node, the result is the same as if the element has been dropped onto whitespace.
|
|
52
|
+
* @input
|
|
53
|
+
*/
|
|
54
|
+
allowDropOnNode?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Optional callback for when a new vertex has been added via this component.
|
|
57
|
+
* @input
|
|
58
|
+
*/
|
|
59
|
+
onVertexAdded?: OnVertexAddedCallback;
|
|
60
|
+
/**
|
|
61
|
+
* Optional size to use for dragged elements.
|
|
62
|
+
* @input
|
|
63
|
+
*/
|
|
64
|
+
dragSize?: Size;
|
|
65
|
+
/**
|
|
66
|
+
* Optional filter to test if objects may be dropped on the canvas. This method is invoked at the start of a drag and is passed the candidate drag object's data.
|
|
67
|
+
* @input
|
|
68
|
+
*/
|
|
69
|
+
canvasDropFilter?: CanvasDropFilter<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Mode to use - drag or tap. Defaults to drag.
|
|
72
|
+
* @input
|
|
73
|
+
*/
|
|
74
|
+
mode?: PaletteMode;
|
|
75
|
+
/**
|
|
76
|
+
* Defaults to false. When true, a newly added vertex is set as the model's current selection.
|
|
77
|
+
* @input
|
|
78
|
+
*/
|
|
79
|
+
selectAfterAdd?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* When in draw mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drag to draw approach also still works)
|
|
82
|
+
*/
|
|
83
|
+
allowClickToAdd?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* This flag relates to "draw" mode, and defaults to false. When true, the palette only supports click to draw new vertices, not drag. This flag is forced to true if the associated UI does not have `useModelForSizes` set, since there is no point in allowing a user to drag a vertex to some size if its not going to be honoured. When you set this flag and associated UI does have `useModelForSizes` set, the palette will use default sizes for new nodes/groups.
|
|
86
|
+
*/
|
|
87
|
+
clickToAddOnly?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
ngAfterViewInit(): void;
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaletteComponent<any>, never>;
|
|
93
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PaletteComponent<any>, "[vjs-palette]", never, { "selector": { "alias": "selector"; "required": false; }; "dataGenerator": { "alias": "dataGenerator"; "required": false; }; "typeGenerator": { "alias": "typeGenerator"; "required": false; }; "groupIdentifier": { "alias": "groupIdentifier"; "required": false; }; "allowDropOnEdge": { "alias": "allowDropOnEdge"; "required": false; }; "allowDropOnGroup": { "alias": "allowDropOnGroup"; "required": false; }; "allowDropOnCanvas": { "alias": "allowDropOnCanvas"; "required": false; }; "allowDropOnNode": { "alias": "allowDropOnNode"; "required": false; }; "onVertexAdded": { "alias": "onVertexAdded"; "required": false; }; "dragSize": { "alias": "dragSize"; "required": false; }; "canvasDropFilter": { "alias": "canvasDropFilter"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "selectAfterAdd": { "alias": "selectAfterAdd"; "required": false; }; "allowClickToAdd": { "alias": "allowClickToAdd"; "required": false; }; "clickToAddOnly": { "alias": "clickToAddOnly"; "required": false; }; }, {}, never, never, false, never>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnChanges, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { ObjectData, FontSpec } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Provides a means to render an SVG shape into a component.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class ShapeComponent implements AfterViewInit, OnChanges {
|
|
10
|
+
/**
|
|
11
|
+
* The data for the vertex to render. Required.
|
|
12
|
+
* @input
|
|
13
|
+
*/
|
|
14
|
+
obj: ObjectData;
|
|
15
|
+
/**
|
|
16
|
+
* Current width for the shape. Although it may seem counterintuitive, this is required - you'll need to set it to `[width]="obj.width"`.
|
|
17
|
+
* Angular's change detection will not pick up changes to this otherwise.
|
|
18
|
+
* @input
|
|
19
|
+
*/
|
|
20
|
+
width: number;
|
|
21
|
+
/**
|
|
22
|
+
* Current height. See notes for `width`.
|
|
23
|
+
* @input
|
|
24
|
+
*/
|
|
25
|
+
height: number;
|
|
26
|
+
/**
|
|
27
|
+
* Whether or not to show labels.
|
|
28
|
+
* @input
|
|
29
|
+
*/
|
|
30
|
+
showLabels?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Defaults to `label`. The name of the property inside each vertex that contains its label.
|
|
33
|
+
* @input
|
|
34
|
+
*/
|
|
35
|
+
labelProperty?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The stroke width to use for labels. Optional. Defaults to Visually JS's default.
|
|
38
|
+
* @input
|
|
39
|
+
*/
|
|
40
|
+
labelStrokeWidth?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optional label to use. It is better to use this than to rely on the component extracting the
|
|
43
|
+
* label from the object data, as there are some scenarios where the change detection is not invoked
|
|
44
|
+
* when relying on the `labelProperty` approach.
|
|
45
|
+
* @input
|
|
46
|
+
*/
|
|
47
|
+
label?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Defaults to true. Set to false if you do not want multi line labels.
|
|
50
|
+
* @input
|
|
51
|
+
*/
|
|
52
|
+
multilineLabels?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* For multiline labels, the proportion of the width of the shape that the longest line can take up.
|
|
55
|
+
* @input
|
|
56
|
+
*/
|
|
57
|
+
labelFillRatio: number;
|
|
58
|
+
/**
|
|
59
|
+
* Optional font size/style to use for this shape.
|
|
60
|
+
*/
|
|
61
|
+
font?: FontSpec;
|
|
62
|
+
private shapeLibrary;
|
|
63
|
+
$el: ElementRef<any>;
|
|
64
|
+
$vjs: VisuallyJsService;
|
|
65
|
+
private _render;
|
|
66
|
+
ngAfterViewInit(): void;
|
|
67
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShapeComponent, never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ShapeComponent, "vjs-shape", never, { "obj": { "alias": "obj"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "showLabels": { "alias": "showLabels"; "required": false; }; "labelProperty": { "alias": "labelProperty"; "required": false; }; "labelStrokeWidth": { "alias": "labelStrokeWidth"; "required": false; }; "label": { "alias": "label"; "required": false; }; "multilineLabels": { "alias": "multilineLabels"; "required": false; }; "labelFillRatio": { "alias": "labelFillRatio"; "required": false; }; "font": { "alias": "font"; "required": false; }; }, {}, never, never, false, never>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from "@angular/core";
|
|
2
|
+
import { ObjectData, Size, DataGeneratorFunction, OnVertexAddedCallback, PreparedShape } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Provides a palette that renders a shape library, from which new vertices can be dragged onto a surface.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class ShapePaletteComponent implements AfterViewInit {
|
|
10
|
+
/**
|
|
11
|
+
* When the shape library contains multiple sets, use this to instruct the palette that you want it to initially load just
|
|
12
|
+
* displaying this set. Optional.
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
initialSet?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional size to use for dragged elements.
|
|
18
|
+
* @input
|
|
19
|
+
*/
|
|
20
|
+
dragSize: Size;
|
|
21
|
+
/**
|
|
22
|
+
* Optional size to use for icons.
|
|
23
|
+
* @input
|
|
24
|
+
*/
|
|
25
|
+
iconSize: Size;
|
|
26
|
+
/**
|
|
27
|
+
* Optional fill color to use for dragged elements. This should be in RGB or hex format, _not_ a color like 'white' or 'cyan' etc.
|
|
28
|
+
* @input
|
|
29
|
+
*/
|
|
30
|
+
fill?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional color to use for outline of dragged elements. Should be in RGB or hex format.
|
|
33
|
+
* @input
|
|
34
|
+
*/
|
|
35
|
+
outline?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Message to use for the 'show all' option in the shape set drop down when there is more than one set of shapes.
|
|
38
|
+
* Defaults to `Show all`.
|
|
39
|
+
* @input
|
|
40
|
+
*/
|
|
41
|
+
showAllMessage?: string;
|
|
42
|
+
/**
|
|
43
|
+
* When true (which is the default), a newly dropped vertex will be set as the underlying model's selection.
|
|
44
|
+
* @input
|
|
45
|
+
*/
|
|
46
|
+
selectAfterDrop?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Stroke width to use in shapes in the palette. Defaults to 1.
|
|
49
|
+
* @input
|
|
50
|
+
*/
|
|
51
|
+
paletteStrokeWidth?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Callback to invoke when a vertex has been dropped on the canvas
|
|
54
|
+
* @input
|
|
55
|
+
*/
|
|
56
|
+
onVertexAdded?: OnVertexAddedCallback;
|
|
57
|
+
/**
|
|
58
|
+
* Optional function you can use to set some initial data for an element being dragged. Note that you cannot
|
|
59
|
+
* override the object's `type` with this function.
|
|
60
|
+
* @input
|
|
61
|
+
*/
|
|
62
|
+
dataGenerator?: DataGeneratorFunction<ObjectData>;
|
|
63
|
+
/**
|
|
64
|
+
* Optional set of prepared shapes to show in the palette. When this is provided, the palette will only render these shapes, and not the contents of the shape library.
|
|
65
|
+
* @input
|
|
66
|
+
*/
|
|
67
|
+
preparedShapes?: Array<PreparedShape>;
|
|
68
|
+
$el: ElementRef<any>;
|
|
69
|
+
$vjs: VisuallyJsService;
|
|
70
|
+
ngAfterViewInit(): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShapePaletteComponent, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ShapePaletteComponent, "vjs-shape-palette", never, { "initialSet": { "alias": "initialSet"; "required": false; }; "dragSize": { "alias": "dragSize"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; "showAllMessage": { "alias": "showAllMessage"; "required": false; }; "selectAfterDrop": { "alias": "selectAfterDrop"; "required": false; }; "paletteStrokeWidth": { "alias": "paletteStrokeWidth"; "required": false; }; "onVertexAdded": { "alias": "onVertexAdded"; "required": false; }; "dataGenerator": { "alias": "dataGenerator"; "required": false; }; "preparedShapes": { "alias": "preparedShapes"; "required": false; }; }, {}, never, never, false, never>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AfterViewInit, ComponentRef, ElementRef, EventEmitter, NgZone, OnDestroy, ViewContainerRef, ChangeDetectorRef, WritableSignal } from "@angular/core";
|
|
2
|
+
import { ObjectData, PortUpdatedParams, Vertex, VertexUpdatedParams, Surface, BrowserElement, VisuallyJsModel, ModelOptions, SurfaceSaveData, ExportOptions, SaveOptions, BrowserUIModel } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { AngularRenderOptions, AngularViewOptions } from "./common";
|
|
4
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
type VisuallyJsAngularDOMElement = BrowserElement & {
|
|
7
|
+
_visuallyJsNgComponent: any;
|
|
8
|
+
_ref: ComponentRef<any>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export interface VisuallyJsAngularComponent {
|
|
14
|
+
model: VisuallyJsModel;
|
|
15
|
+
surface: Surface;
|
|
16
|
+
data: ObjectData;
|
|
17
|
+
$data?: WritableSignal<ObjectData>;
|
|
18
|
+
changeDetectorRef?: ChangeDetectorRef;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export interface VisuallyJsAngularVertexComponent extends VisuallyJsAngularComponent {
|
|
24
|
+
modelObject: Vertex;
|
|
25
|
+
_el: VisuallyJsAngularDOMElement;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Provides a component that manages a surface.
|
|
29
|
+
* @group Components
|
|
30
|
+
*/
|
|
31
|
+
export declare class SurfaceComponent<RO extends AngularRenderOptions = AngularRenderOptions> implements AfterViewInit, OnDestroy {
|
|
32
|
+
/**
|
|
33
|
+
* Options for the view - mappings of components and behaviour to model object types.
|
|
34
|
+
* @input
|
|
35
|
+
*/
|
|
36
|
+
viewOptions?: AngularViewOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Options for the underlying surface widget.
|
|
39
|
+
* @input
|
|
40
|
+
*/
|
|
41
|
+
renderOptions?: AngularRenderOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Optional parameters for the underlying model instance. These will be used only if the model instance with the given ID has not yet been created somewhere else in the app.
|
|
44
|
+
* @input
|
|
45
|
+
*/
|
|
46
|
+
modelOptions?: ModelOptions;
|
|
47
|
+
/**
|
|
48
|
+
* Optional data to load after the view has been initialised.
|
|
49
|
+
* @input
|
|
50
|
+
*/
|
|
51
|
+
data?: Record<string, any>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional url from which to load data after the view has been initialised.
|
|
54
|
+
* @input
|
|
55
|
+
*/
|
|
56
|
+
url?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Output event emitter, for proxying events from vertex components.
|
|
59
|
+
* @output
|
|
60
|
+
*/
|
|
61
|
+
vertexEvent: EventEmitter<{
|
|
62
|
+
/**
|
|
63
|
+
* The vertex emitting the event
|
|
64
|
+
*/
|
|
65
|
+
vertex: Vertex;
|
|
66
|
+
/**
|
|
67
|
+
* Event name
|
|
68
|
+
*/
|
|
69
|
+
event: string;
|
|
70
|
+
/**
|
|
71
|
+
* Payload for the event
|
|
72
|
+
*/
|
|
73
|
+
payload: any;
|
|
74
|
+
/**
|
|
75
|
+
* The Angular component that fired the event
|
|
76
|
+
*/
|
|
77
|
+
component: ComponentRef<any>;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* The underlying model.
|
|
81
|
+
* @classMember
|
|
82
|
+
*/
|
|
83
|
+
model: BrowserUIModel;
|
|
84
|
+
/**
|
|
85
|
+
* The Surface from the UI core package that this component manages.
|
|
86
|
+
* @classMember
|
|
87
|
+
*/
|
|
88
|
+
surface: Surface;
|
|
89
|
+
nodeUpdateFn: (a: any, e?: any) => any;
|
|
90
|
+
groupUpdateFn: (a: any, e?: any) => any;
|
|
91
|
+
portAddedFn: (a: any, e?: any) => any;
|
|
92
|
+
portUpdateFn: (a: any, e?: any) => any;
|
|
93
|
+
dataLoadEndFn: () => any;
|
|
94
|
+
edgeUpdateFn: (a: any, e?: any) => any;
|
|
95
|
+
edgeAddFn: (a: any, e?: any) => any;
|
|
96
|
+
$el: ElementRef<any>;
|
|
97
|
+
$viewContainerRef: ViewContainerRef;
|
|
98
|
+
$ngZone: NgZone;
|
|
99
|
+
$vjs: VisuallyJsService;
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
getNativeElement(component: any): VisuallyJsAngularDOMElement;
|
|
104
|
+
private _getComponent;
|
|
105
|
+
private _getComponentThen;
|
|
106
|
+
/**
|
|
107
|
+
* on node/group update, store the new data in the view
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
nodeOrGroupUpdated(params: VertexUpdatedParams): void;
|
|
111
|
+
portUpdated(params: PortUpdatedParams): void;
|
|
112
|
+
/**
|
|
113
|
+
* When an edge updated event is received, check for angular overlays, and if they have a change detector, invoke it. Used with OnPush change detection.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
private edgeUpdated;
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
private _processAngularOverlays;
|
|
121
|
+
/**
|
|
122
|
+
* Save the dataset and the surface's current pan/zoom, as well as any inspector context, via POST to a URL.
|
|
123
|
+
* @param options Options for the save operation
|
|
124
|
+
* @classMember
|
|
125
|
+
*/
|
|
126
|
+
save(options: SaveOptions): void;
|
|
127
|
+
/**
|
|
128
|
+
* Export the dataset only
|
|
129
|
+
* @classMember
|
|
130
|
+
*/
|
|
131
|
+
exportData(options: ExportOptions): SurfaceSaveData;
|
|
132
|
+
/**
|
|
133
|
+
* On data load end, repaint everything on next tick.
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
dataLoadEnd(): void;
|
|
137
|
+
private $removeNgElement;
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
ngAfterViewInit(): void;
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
ngOnDestroy(): void;
|
|
146
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SurfaceComponent<any>, never>;
|
|
147
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SurfaceComponent<any>, "vjs-surface", never, { "viewOptions": { "alias": "viewOptions"; "required": false; }; "renderOptions": { "alias": "renderOptions"; "required": false; }; "modelOptions": { "alias": "modelOptions"; "required": false; }; "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; }, { "vertexEvent": "vertexEvent"; }, never, ["*"], false, never>;
|
|
148
|
+
}
|
|
149
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BrowserUI, Diagram, Inspector, Paper, Surface, BrowserUIModel } from "@visuallyjs/browser-ui";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Provides the BrowserUIModel and the current UI - whether a Surface or Paper. Also provisions the current Diagram, if applicable. This service is provided in root by default but if you have multiple models in your app you can configure it as a provider in multiple components
|
|
5
|
+
* @group Services
|
|
6
|
+
*/
|
|
7
|
+
export declare class VisuallyJsService {
|
|
8
|
+
private $model;
|
|
9
|
+
private $surface;
|
|
10
|
+
private $paper;
|
|
11
|
+
private $diagram;
|
|
12
|
+
private $inspector;
|
|
13
|
+
private inspectorListeners;
|
|
14
|
+
private surfaceListeners;
|
|
15
|
+
private paperListeners;
|
|
16
|
+
private modelListeners;
|
|
17
|
+
private diagramListeners;
|
|
18
|
+
private uiListeners;
|
|
19
|
+
$setInspector(i: Inspector): void;
|
|
20
|
+
private $notifyInspector;
|
|
21
|
+
$setSurface(s: Surface): void;
|
|
22
|
+
private $notifySurface;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the surface and executes the provided callback function with the surface as its argument. If the surface is not available, the callback is stored and will be invoked once the surface is ready.
|
|
25
|
+
*
|
|
26
|
+
* @param cb - A callback function that takes a `Surface` object as its parameter.
|
|
27
|
+
*/
|
|
28
|
+
getSurface(cb: (s: Surface) => any): void;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the inspector instance. If the inspector is already available, the provided callback function is invoked with the inspector as an argument. If the inspector is not yet ready, the callback is stored in a queue to be executed once the inspector becomes available.
|
|
31
|
+
*
|
|
32
|
+
* @param cb - A callback function that receives the inspector instance as an argument when it becomes available.
|
|
33
|
+
*/
|
|
34
|
+
getInspector(cb: (s: Inspector) => any): void;
|
|
35
|
+
$setPaper(p: Paper): void;
|
|
36
|
+
private $notifyPaper;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves the paper object and executes the provided callback function with the paper as an argument. If the paper is not yet available, the callback is stored for execution once the paper becomes available.
|
|
39
|
+
*
|
|
40
|
+
* @param cb - A callback function that is called with the retrieved paper object as an argument.
|
|
41
|
+
*/
|
|
42
|
+
getPaper(cb: (p: Paper) => any): void;
|
|
43
|
+
$setDiagram(d: Diagram): void;
|
|
44
|
+
private $notifyDiagram;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the current diagram. If the diagram is not available, the callback will be stored and executed when the diagram becomes available.
|
|
47
|
+
*
|
|
48
|
+
* @param cb - A callback function that takes a `Diagram` object as its parameter.
|
|
49
|
+
*/
|
|
50
|
+
getDiagram(cb: (p: Diagram) => any): void;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the model and executes the provided callback function with it. If the model is already available, the callback is executed immediately. Otherwise, the callback is stored to be executed when the model becomes available.
|
|
53
|
+
*
|
|
54
|
+
* @param cb - The callback function to execute with the model.
|
|
55
|
+
*/
|
|
56
|
+
getModel(cb: (p: BrowserUIModel) => any): void;
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
$setModel(m: BrowserUIModel): void;
|
|
61
|
+
private $notifyModel;
|
|
62
|
+
private $notifyUI;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves the UI element and provides it to the callback function once available. If the UI element already exists, it is immediately passed to the callback. Otherwise, the callback is stored to be executed when the UI becomes available.
|
|
65
|
+
*
|
|
66
|
+
* @param cb - A callback function that receives the UI element `b` of type `BrowserUI` as its argument.
|
|
67
|
+
*/
|
|
68
|
+
getUI(cb: (b: BrowserUI) => any): void;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyJsService, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<VisuallyJsService>;
|
|
71
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visuallyjs/browser-ui-angular",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "*",
|
|
6
|
+
"@angular/core": "*"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.0.0",
|
|
10
|
+
"@visuallyjs/browser-ui": "1.0.0"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./css/visuallyjs-angular.css": {
|
|
14
|
+
"default": "./css/visuallyjs-angular.css"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./index.d.ts",
|
|
21
|
+
"esm2022": "./esm2022/visuallyjs-browser-ui-angular.mjs",
|
|
22
|
+
"esm": "./esm2022/visuallyjs-browser-ui-angular.mjs",
|
|
23
|
+
"default": "./fesm2022/visuallyjs-browser-ui-angular.mjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"module": "fesm2022/visuallyjs-browser-ui-angular.mjs",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"sideEffects": false
|
|
29
|
+
}
|
|
Binary file
|