@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,71 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnInit } from "@angular/core";
|
|
2
|
+
import { ControlsComponentButtons, BrowserElement, BrowserUI } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* This component was written for the Visually JS demonstration applications. We've included it in the Toolkit's
|
|
7
|
+
* angular integration as it may provide a useful base on which to build your own. Out of the box this is "production ready",
|
|
8
|
+
* but it does assume that either you're including the `visuallyjs.css` stylesheet in your cascade,
|
|
9
|
+
* or you've pulled out the relevant styles from that stylesheet. Also note that the default prompt for users when they
|
|
10
|
+
* press the 'clear' button is in English, as are the button tooltips.
|
|
11
|
+
* @group Components
|
|
12
|
+
*/
|
|
13
|
+
export declare class ControlsComponent implements OnInit {
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not to show undo/redo buttons. Defaults to true.
|
|
16
|
+
* @input
|
|
17
|
+
*/
|
|
18
|
+
undoRedo?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether or not to show the zoom to extents button. Defaults to true.
|
|
21
|
+
* @input
|
|
22
|
+
*/
|
|
23
|
+
zoomToExtents?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether or not to show the zoom in/zoom out buttons. Defaults to false.
|
|
26
|
+
* @input
|
|
27
|
+
*/
|
|
28
|
+
zoomButtons?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether or not to show the clear model button. Defaults to true.
|
|
31
|
+
* @input
|
|
32
|
+
*/
|
|
33
|
+
clear?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Message to show when the user clicks the clear model button.
|
|
36
|
+
* @input
|
|
37
|
+
*/
|
|
38
|
+
clearMessage?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional extra buttons to display in the component.
|
|
41
|
+
* @input
|
|
42
|
+
*/
|
|
43
|
+
buttons?: ControlsComponentButtons;
|
|
44
|
+
/**
|
|
45
|
+
* Orientation of the component - `"row"` or `"column"`
|
|
46
|
+
* @input
|
|
47
|
+
*/
|
|
48
|
+
orientation?: string;
|
|
49
|
+
modeButtons: ControlsComponentButtons;
|
|
50
|
+
otherButtons: ControlsComponentButtons;
|
|
51
|
+
ui: BrowserUI;
|
|
52
|
+
showPanButton: boolean;
|
|
53
|
+
showLassoButton: boolean;
|
|
54
|
+
$vjs: VisuallyJsService;
|
|
55
|
+
$el: ElementRef<any>;
|
|
56
|
+
$cdr: ChangeDetectorRef;
|
|
57
|
+
updateSelectionState(): void;
|
|
58
|
+
ngOnInit(): void;
|
|
59
|
+
getNativeElement(component: any): BrowserElement;
|
|
60
|
+
panMode(): void;
|
|
61
|
+
selectMode(): void;
|
|
62
|
+
zoomToFit(): void;
|
|
63
|
+
zoomIn(): void;
|
|
64
|
+
zoomOut(): void;
|
|
65
|
+
resetSelection(): void;
|
|
66
|
+
undo(): void;
|
|
67
|
+
redo(): void;
|
|
68
|
+
doClear(): void;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ControlsComponent, never>;
|
|
70
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ControlsComponent, "vjs-controls", never, { "undoRedo": { "alias": "undoRedo"; "required": false; }; "zoomToExtents": { "alias": "zoomToExtents"; "required": false; }; "zoomButtons": { "alias": "zoomButtons"; "required": false; }; "clear": { "alias": "clear"; "required": false; }; "clearMessage": { "alias": "clearMessage"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; }, {}, never, never, false, never>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AfterViewInit, OnDestroy } from "@angular/core";
|
|
2
|
+
import { PointXY, FixedElementConstraints } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DecoratorComponent implements AfterViewInit, OnDestroy {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to float the element over the UI (floating) or place it on the canvas (fixed). Floating is the default.
|
|
8
|
+
*/
|
|
9
|
+
placement: 'fixed' | 'floating';
|
|
10
|
+
/**
|
|
11
|
+
* Position relative to viewport (floating) or canvas (fixed).
|
|
12
|
+
*/
|
|
13
|
+
position: PointXY;
|
|
14
|
+
/**
|
|
15
|
+
* Optional constraints when using fixed placement.
|
|
16
|
+
*/
|
|
17
|
+
constraints?: FixedElementConstraints;
|
|
18
|
+
private el;
|
|
19
|
+
private surface;
|
|
20
|
+
service: VisuallyJsService;
|
|
21
|
+
ngAfterViewInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DecoratorComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DecoratorComponent, "vjs-decorator", never, { "placement": { "alias": "placement"; "required": false; }; "position": { "alias": "position"; "required": false; }; "constraints": { "alias": "constraints"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseGroupComponent } from "./base.group.component";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* This component will be used as the default component when rendering groups, if you do not provide a specific `component` mapping for a given group type in your view. It will attempt to write the group's `label` property into the template, or will use an empty string if that is not defined.
|
|
5
|
+
* @group Components
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultGroupComponent extends BaseGroupComponent {
|
|
8
|
+
readonly label: import("@angular/core").Signal<any>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultGroupComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DefaultGroupComponent, "ng-component", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseNodeComponent } from "./base.node.component";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* This component will be used as the default component when rendering nodes, if you do not provide a specific `component` mapping for a given node type in your view. It will attempt to write the group's `label` property into the template, or will use an empty string if that is not defined.
|
|
5
|
+
* @group Components
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultNodeComponent extends BaseNodeComponent {
|
|
8
|
+
readonly label: import("@angular/core").Signal<any>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultNodeComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DefaultNodeComponent, "ng-component", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, NgZone, OnDestroy } from "@angular/core";
|
|
2
|
+
import { Diagram, DiagramOptions, DiagramSaveData, DiagramSaveOptions, ModelOptions, SaveOptions } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Renders an SVG diagram.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class DiagramComponent implements AfterViewInit, OnDestroy {
|
|
10
|
+
/**
|
|
11
|
+
* Options for the Diagram
|
|
12
|
+
* @input
|
|
13
|
+
*/
|
|
14
|
+
options?: DiagramOptions;
|
|
15
|
+
/**
|
|
16
|
+
* Optional data to load after creation
|
|
17
|
+
* @input
|
|
18
|
+
*/
|
|
19
|
+
data?: any;
|
|
20
|
+
/**
|
|
21
|
+
* Optional URL from which to load data after creation
|
|
22
|
+
* @input
|
|
23
|
+
*/
|
|
24
|
+
url?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Options for the underlying model
|
|
27
|
+
* @input
|
|
28
|
+
*/
|
|
29
|
+
modelOptions?: ModelOptions;
|
|
30
|
+
/**
|
|
31
|
+
* The underlying Diagram.
|
|
32
|
+
* @classMember
|
|
33
|
+
*/
|
|
34
|
+
diagram: Diagram;
|
|
35
|
+
$ngZone: NgZone;
|
|
36
|
+
$el: ElementRef<any>;
|
|
37
|
+
$vjs: VisuallyJsService;
|
|
38
|
+
ngAfterViewInit(): void;
|
|
39
|
+
ngOnDestroy(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Saves the diagram data and state to an object.
|
|
42
|
+
* @param options Options for save
|
|
43
|
+
*/
|
|
44
|
+
save(options?: DiagramSaveOptions): DiagramSaveData;
|
|
45
|
+
/**
|
|
46
|
+
* Saves the diagram data and state via POST to a nominated URL. Internally this calls `save` and then posts the result to the url you specify.
|
|
47
|
+
* @param options Options for save.
|
|
48
|
+
*/
|
|
49
|
+
saveToUrl(options: SaveOptions): void;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DiagramComponent, never>;
|
|
51
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DiagramComponent, "vjs-diagram", never, { "options": { "alias": "options"; "required": false; }; "data": { "alias": "data"; "required": false; }; "url": { "alias": "url"; "required": false; }; "modelOptions": { "alias": "modelOptions"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Diagram, DiagramCell, Size, PaletteMode, OnVertexAddedCallback, PreparedShape } from "@visuallyjs/browser-ui";
|
|
2
|
+
import { AfterViewInit, ElementRef } from "@angular/core";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DiagramPaletteComponent implements AfterViewInit {
|
|
6
|
+
/**
|
|
7
|
+
* Optional fill color to use for dragged elements. This should be in RGB format, _not_ a color like 'white' or 'cyan' etc.
|
|
8
|
+
* @input
|
|
9
|
+
*/
|
|
10
|
+
fill?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional color to use for outline of dragged elements. Should be in RGB format.
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
outline?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional size to use for dragged elements.
|
|
18
|
+
* @input
|
|
19
|
+
*/
|
|
20
|
+
dragSize?: Size;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates that when one or more vertices are selected, clicking on an entry in the palette will change the type of the selected vertices to that type. Defaults to true.
|
|
23
|
+
* @input
|
|
24
|
+
*/
|
|
25
|
+
inspector?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Optional size to use for icons. Defaults to 150x100 pixels. If you provide this but not `dragSize` this size will also be used for an icon that is being dragged.
|
|
28
|
+
* @input
|
|
29
|
+
*/
|
|
30
|
+
iconSize?: Size;
|
|
31
|
+
/**
|
|
32
|
+
* Optionally show each shape icon's label underneath it
|
|
33
|
+
* @input
|
|
34
|
+
*/
|
|
35
|
+
showLabels?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Stroke width to use for shapes in palette. Defaults to 1.
|
|
38
|
+
* @input
|
|
39
|
+
*/
|
|
40
|
+
paletteStrokeWidth?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Message to use for the 'show all' option in the shape set drop down when there is more than one set of shapes. Defaults to `Show all`.
|
|
43
|
+
* @input
|
|
44
|
+
*/
|
|
45
|
+
showAllMessage?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Callback to invoke when a new diagram cell has been added.
|
|
48
|
+
* @input
|
|
49
|
+
*/
|
|
50
|
+
onCellAdded?: (dc: DiagramCell) => any;
|
|
51
|
+
/**
|
|
52
|
+
* Mode to operate in - 'drag' or 'tap'. Defaults to 'drag' (PALETTE_MODE_DRAG).
|
|
53
|
+
* @input
|
|
54
|
+
*/
|
|
55
|
+
mode?: PaletteMode;
|
|
56
|
+
/**
|
|
57
|
+
* When in tap mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)
|
|
58
|
+
* @input
|
|
59
|
+
*/
|
|
60
|
+
allowClickToAdd?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Defaults to true: when in 'tap' mode and a new group/node has been drawn on the canvas, the UI is set back to pan mode.
|
|
63
|
+
* @input
|
|
64
|
+
*/
|
|
65
|
+
autoExitDrawMode?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* When true (which is the default), a newly dropped shape will be set as the underlying model's selection.
|
|
68
|
+
* @input
|
|
69
|
+
*/
|
|
70
|
+
selectAfterAdd?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Optional diagram to attach to. It is not generally necessary to supply this as it will be retrieved from the context.
|
|
73
|
+
* @input
|
|
74
|
+
*/
|
|
75
|
+
diagram?: Diagram;
|
|
76
|
+
/**
|
|
77
|
+
* Optional callback that will be invoked after a new vertex has been dropped and added to the dataset.
|
|
78
|
+
* @input
|
|
79
|
+
*/
|
|
80
|
+
onVertexAdded?: OnVertexAddedCallback;
|
|
81
|
+
/**
|
|
82
|
+
* 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.
|
|
83
|
+
* @input
|
|
84
|
+
*/
|
|
85
|
+
preparedShapes?: Array<PreparedShape>;
|
|
86
|
+
$el: ElementRef<any>;
|
|
87
|
+
$vjs: VisuallyJsService;
|
|
88
|
+
private $init;
|
|
89
|
+
ngAfterViewInit(): void;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DiagramPaletteComponent, never>;
|
|
91
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DiagramPaletteComponent, "vjs-diagram-palette", never, { "fill": { "alias": "fill"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; "dragSize": { "alias": "dragSize"; "required": false; }; "inspector": { "alias": "inspector"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "showLabels": { "alias": "showLabels"; "required": false; }; "paletteStrokeWidth": { "alias": "paletteStrokeWidth"; "required": false; }; "showAllMessage": { "alias": "showAllMessage"; "required": false; }; "onCellAdded": { "alias": "onCellAdded"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "allowClickToAdd": { "alias": "allowClickToAdd"; "required": false; }; "autoExitDrawMode": { "alias": "autoExitDrawMode"; "required": false; }; "selectAfterAdd": { "alias": "selectAfterAdd"; "required": false; }; "diagram": { "alias": "diagram"; "required": false; }; "onVertexAdded": { "alias": "onVertexAdded"; "required": false; }; "preparedShapes": { "alias": "preparedShapes"; "required": false; }; }, {}, never, never, false, never>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter } from "@angular/core";
|
|
2
|
+
import { EdgePropertyMappings, Inspector } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* A helper component that wraps an EdgeTypePicker, for use in an {@link InspectorComponent}
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class EdgeTypePickerComponent implements AfterViewInit {
|
|
10
|
+
private el;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the property that maps the edge type. Required.
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
propertyName: string;
|
|
16
|
+
/**
|
|
17
|
+
* Set of edge property mappings to render and allow the user to select from.
|
|
18
|
+
* Optional. By default the component will retrieve these from the surface
|
|
19
|
+
* @input
|
|
20
|
+
*/
|
|
21
|
+
edgeMappings?: EdgePropertyMappings;
|
|
22
|
+
/**
|
|
23
|
+
* Fires an event when the user selects a new style via mouse click.
|
|
24
|
+
* @output
|
|
25
|
+
*/
|
|
26
|
+
changeEvent: EventEmitter<string>;
|
|
27
|
+
private edgeTypePicker;
|
|
28
|
+
$vjs: VisuallyJsService;
|
|
29
|
+
inspector: Inspector;
|
|
30
|
+
constructor(el: ElementRef);
|
|
31
|
+
private resolveMappings;
|
|
32
|
+
ngAfterViewInit(): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EdgeTypePickerComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EdgeTypePickerComponent, "vjs-edge-type", never, { "propertyName": { "alias": "propertyName"; "required": false; }; "edgeMappings": { "alias": "edgeMappings"; "required": false; }; }, { "changeEvent": "changeEvent"; }, never, never, false, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ElementRef, OnInit } from "@angular/core";
|
|
2
|
+
import { BrowserUI, ImageExportUIOptions, PointXY, SvgExportUIOptions } 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 ExportControlsComponent implements OnInit {
|
|
9
|
+
/**
|
|
10
|
+
* Whether or not to show a label in front of the buttons. Defaults to true.
|
|
11
|
+
* @input
|
|
12
|
+
*/
|
|
13
|
+
showLabel?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* What to show in the label, if visible. Defaults to "Export:".
|
|
16
|
+
* @input
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional margins to apply to both SVG and image exports. Will not override any margins specified in svgOptions or imageOptions.
|
|
21
|
+
* @input
|
|
22
|
+
*/
|
|
23
|
+
margins?: PointXY;
|
|
24
|
+
/**
|
|
25
|
+
* Options for SVG exports.
|
|
26
|
+
* @input
|
|
27
|
+
*/
|
|
28
|
+
svgOptions?: SvgExportUIOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Options for image exports.
|
|
31
|
+
* @input
|
|
32
|
+
*/
|
|
33
|
+
imageOptions?: ImageExportUIOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Defaults to true - whether or not to show an SVG export button.
|
|
36
|
+
* @input
|
|
37
|
+
*/
|
|
38
|
+
allowSvgExport?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Defaults to true - whether or not to show a PNG export button.
|
|
41
|
+
* @input
|
|
42
|
+
*/
|
|
43
|
+
allowPngExport?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Defaults to true - whether or not to show a JPG export button.
|
|
46
|
+
* @input
|
|
47
|
+
*/
|
|
48
|
+
allowJpgExport?: boolean;
|
|
49
|
+
/** @internal */
|
|
50
|
+
ui: BrowserUI;
|
|
51
|
+
$vjs: VisuallyJsService;
|
|
52
|
+
$el: ElementRef<any>;
|
|
53
|
+
ngOnInit(): void;
|
|
54
|
+
exportSVG(): void;
|
|
55
|
+
exportPNG(): void;
|
|
56
|
+
exportJPG(): void;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ExportControlsComponent, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ExportControlsComponent, "vjs-export-controls", never, { "showLabel": { "alias": "showLabel"; "required": false; }; "label": { "alias": "label"; "required": false; }; "margins": { "alias": "margins"; "required": false; }; "svgOptions": { "alias": "svgOptions"; "required": false; }; "imageOptions": { "alias": "imageOptions"; "required": false; }; "allowSvgExport": { "alias": "allowSvgExport"; "required": false; }; "allowPngExport": { "alias": "allowPngExport"; "required": false; }; "allowJpgExport": { "alias": "allowJpgExport"; "required": false; }; }, {}, never, never, false, never>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, AfterViewInit } from "@angular/core";
|
|
2
|
+
import { Inspector, Base, BrowserUI } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Base inspector component. You can extend this class and just use the `currentObj` and/or `currentType` members in your template for a simple setup, or your subclass can manage its own more complicated state. This class will invoke `reset()` when there is no selected object, and `refresh` when an object is selected.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class InspectorComponent<T extends Base = Base> implements AfterViewInit {
|
|
10
|
+
/**
|
|
11
|
+
* The object that is currently being inspected.
|
|
12
|
+
* @classMember
|
|
13
|
+
*/
|
|
14
|
+
currentObj: T;
|
|
15
|
+
/**
|
|
16
|
+
* By default, this is the `type` of the current object. You can override `refresh` to implement more sophisticated scenarios.
|
|
17
|
+
* @classMember
|
|
18
|
+
*/
|
|
19
|
+
currentType: string;
|
|
20
|
+
/**
|
|
21
|
+
* The `objectType` of the current object - `Group`, `Node`, `Edge` or `Port`
|
|
22
|
+
* @classMember
|
|
23
|
+
*/
|
|
24
|
+
currentObjectType: string;
|
|
25
|
+
/**
|
|
26
|
+
* Edge.objectType is exposed on the class for reference in the template.
|
|
27
|
+
* @classMember
|
|
28
|
+
*/
|
|
29
|
+
EDGE: string;
|
|
30
|
+
/**
|
|
31
|
+
* Node.objectType is exposed on the class for reference in the template.
|
|
32
|
+
* @classMember
|
|
33
|
+
*/
|
|
34
|
+
NODE: string;
|
|
35
|
+
/**
|
|
36
|
+
* Group.objectType is exposed on the class for reference in the template.
|
|
37
|
+
* @classMember
|
|
38
|
+
*/
|
|
39
|
+
GROUP: string;
|
|
40
|
+
/**
|
|
41
|
+
* Port.objectType is exposed on the class for reference in the template.
|
|
42
|
+
* @classMember
|
|
43
|
+
*/
|
|
44
|
+
PORT: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional css class(es) to set on the inspector - a space separated list.
|
|
47
|
+
* @input
|
|
48
|
+
*/
|
|
49
|
+
cssClass?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether or not to show a close button. Defaults to false.
|
|
52
|
+
* @input
|
|
53
|
+
*/
|
|
54
|
+
showCloseButton?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Optional context for shared data for inspector templates.
|
|
57
|
+
* @input
|
|
58
|
+
*/
|
|
59
|
+
context?: Record<string, any>;
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
inspector: Inspector;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
changeDetector: ChangeDetectorRef;
|
|
68
|
+
/**
|
|
69
|
+
* The DOM element representing this component.
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
el: ElementRef<any>;
|
|
73
|
+
ui: BrowserUI;
|
|
74
|
+
$vjs: VisuallyJsService;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
ngAfterViewInit(): void;
|
|
79
|
+
/**
|
|
80
|
+
* The base implementation of this method sets the current object type from `objectType`, and it also sets the current type to be the `type` of obj. You can override this method to implement more sophisticated scenarios.
|
|
81
|
+
* @param obj New object in inspector
|
|
82
|
+
*/
|
|
83
|
+
refresh(obj: Base): void;
|
|
84
|
+
/**
|
|
85
|
+
* The base implementation of this method sets the current type to be an empty string. You can override this
|
|
86
|
+
* method to implement more sophisticated scenarios.
|
|
87
|
+
*/
|
|
88
|
+
reset(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Invoked after an inspector update. You can override this method to update your UI if you need to.
|
|
91
|
+
* @param ui The UI that this inspector is attached to.
|
|
92
|
+
*/
|
|
93
|
+
afterUpdate(ui: BrowserUI): void;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorComponent<any>, never>;
|
|
95
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InspectorComponent<any>, never, never, { "cssClass": { "alias": "cssClass"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, {}, never, never, false, never>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, NgZone } from "@angular/core";
|
|
2
|
+
import { MiniviewPlugin, Group, Node } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* A component that provides a miniview.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare class MiniviewComponent implements AfterViewInit {
|
|
10
|
+
private ngZone;
|
|
11
|
+
/**
|
|
12
|
+
* Optional filter to determine whether or not include a given vertex in the miniview
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
elementFilter?: (obj: Node | Group) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Optional function to determine a `type` for each vertex, which is then written as an attribute onto the DOM element representing the vertex in the miniview.
|
|
18
|
+
* @input
|
|
19
|
+
*/
|
|
20
|
+
typeFunction?: (obj: Node | Group) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not to move miniview elements at the same time as their related surface element is being dragged. Defaults to true.
|
|
23
|
+
* @input
|
|
24
|
+
*/
|
|
25
|
+
activeTracking?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Defaults to true, meaning a click on a node/group in the miniview will cause that node/group to be centered in the related surface.
|
|
28
|
+
* @input
|
|
29
|
+
*/
|
|
30
|
+
clickToCenter?: boolean;
|
|
31
|
+
$el: ElementRef<any>;
|
|
32
|
+
$vjs: VisuallyJsService;
|
|
33
|
+
$miniview: MiniviewPlugin;
|
|
34
|
+
constructor(ngZone: NgZone);
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
ngAfterViewInit(): void;
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
redraw(): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MiniviewComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MiniviewComponent, "vjs-miniview", never, { "elementFilter": { "alias": "elementFilter"; "required": false; }; "typeFunction": { "alias": "typeFunction"; "required": false; }; "activeTracking": { "alias": "activeTracking"; "required": false; }; "clickToCenter": { "alias": "clickToCenter"; "required": false; }; }, {}, never, never, false, never>;
|
|
45
|
+
}
|
package/lib/model.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BrowserUIModel, Surface, SurfaceOptions } from "@visuallyjs/browser-ui";
|
|
2
|
+
/**
|
|
3
|
+
* Extension of the VisuallyJsModel for use in Angular. You'll rarely need to create one of these manually, but this is the class of the `model` exposed in several UI components.
|
|
4
|
+
* @group Classes
|
|
5
|
+
*/
|
|
6
|
+
export declare class BrowserUIAngularModel extends BrowserUIModel {
|
|
7
|
+
render(container: Element, options?: SurfaceOptions): Surface;
|
|
8
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Edge, ObjectData, Surface } from "@visuallyjs/browser-ui";
|
|
2
|
+
import { ChangeDetectorRef } from "@angular/core";
|
|
3
|
+
import { VisuallyJsModel } from "@visuallyjs/browser-ui";
|
|
4
|
+
import { VisuallyJsAngularComponent } from "./surface-component";
|
|
5
|
+
/**
|
|
6
|
+
* Defines the type for an overlay that is represented by an angular component. Use this value in your views instead of "Arrow", "Label" etc.
|
|
7
|
+
* @group Components
|
|
8
|
+
*/
|
|
9
|
+
export declare const AngularComponentOverlayType = "AngularComponent";
|
|
10
|
+
/**
|
|
11
|
+
* Definition of an angular component that will act as an overlay. This interface exists largely for convenience; the code will write the members of this interface onto any component it creates.
|
|
12
|
+
*/
|
|
13
|
+
export interface AngularOverlayComponent extends VisuallyJsAngularComponent {
|
|
14
|
+
/**
|
|
15
|
+
* The edge that this overlay is drawn on.
|
|
16
|
+
*/
|
|
17
|
+
edge: Edge;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A component that you can use as a base for your own overlay component if its convenient for you. This class offers an `updateEdge` and a `removeEdge` method, as helpers.
|
|
21
|
+
* @group Components
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class BaseAngularOverlayComponent implements AngularOverlayComponent {
|
|
24
|
+
/**
|
|
25
|
+
* The underlying model
|
|
26
|
+
* @classMember
|
|
27
|
+
*/
|
|
28
|
+
model: VisuallyJsModel;
|
|
29
|
+
/**
|
|
30
|
+
* The surface that this overlay is rendered by
|
|
31
|
+
* @classMember
|
|
32
|
+
*/
|
|
33
|
+
surface: Surface;
|
|
34
|
+
/**
|
|
35
|
+
* Backing data for the edge this overlay is attached to
|
|
36
|
+
* @classMember
|
|
37
|
+
*/
|
|
38
|
+
data: ObjectData;
|
|
39
|
+
/**
|
|
40
|
+
* Underlying Edge model object this overlay is attached to
|
|
41
|
+
* @classMember
|
|
42
|
+
*/
|
|
43
|
+
edge: Edge;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
changeDetectorRef: ChangeDetectorRef;
|
|
48
|
+
/**
|
|
49
|
+
* Update the underlying edge with the given data.
|
|
50
|
+
* @param updates Data to update the edge with
|
|
51
|
+
* @classMember
|
|
52
|
+
*/
|
|
53
|
+
updateEdge(updates: ObjectData): void;
|
|
54
|
+
/**
|
|
55
|
+
* Remove the underlying edge. This will unload the edge and its visual representation, including this overlay component.
|
|
56
|
+
* @classMember
|
|
57
|
+
*/
|
|
58
|
+
removeEdge(): void;
|
|
59
|
+
}
|