@visuallyjs/browser-ui-angular 1.2.0 → 1.2.1
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 +2 -0
- package/esm2022/lib/base.group.component.mjs +3 -3
- package/esm2022/lib/base.node.component.mjs +3 -3
- package/esm2022/lib/base.port.component.mjs +4 -4
- package/esm2022/lib/base.vertex.component.mjs +33 -12
- package/esm2022/lib/browser-ui-angular.module.mjs +18 -8
- package/esm2022/lib/charts/area.chart.component.mjs +3 -3
- package/esm2022/lib/charts/bar.chart.component.mjs +3 -3
- package/esm2022/lib/charts/bubble.chart.component.mjs +3 -3
- package/esm2022/lib/charts/column.chart.component.mjs +3 -3
- package/esm2022/lib/charts/line.chart.component.mjs +3 -3
- package/esm2022/lib/charts/pie.chart.component.mjs +3 -3
- package/esm2022/lib/charts/sankey.chart.component.mjs +4 -4
- package/esm2022/lib/charts/scatter.chart.component.mjs +3 -3
- package/esm2022/lib/charts/series.based.chart.component.mjs +4 -4
- package/esm2022/lib/charts/xy.chart.component.mjs +3 -3
- package/esm2022/lib/color.tag.component.mjs +6 -6
- package/esm2022/lib/controls-component.mjs +4 -4
- package/esm2022/lib/decorator-component.mjs +3 -3
- package/esm2022/lib/default-group-component.mjs +3 -3
- package/esm2022/lib/default-node-component.mjs +3 -3
- package/esm2022/lib/diagram-component.mjs +34 -12
- package/esm2022/lib/diagram-palette-component.mjs +4 -4
- package/esm2022/lib/edge.type.picker.component.mjs +5 -5
- package/esm2022/lib/export-controls-component.mjs +3 -3
- package/esm2022/lib/inspector.component.mjs +4 -4
- package/esm2022/lib/miniview-component.mjs +4 -4
- package/esm2022/lib/palette.component.mjs +4 -4
- package/esm2022/lib/paper-component.mjs +345 -0
- package/esm2022/lib/shape.component.mjs +4 -4
- package/esm2022/lib/shape.palette.component.mjs +4 -4
- package/esm2022/lib/surface-component.mjs +71 -14
- package/esm2022/lib/surface-popup-component.mjs +62 -0
- package/esm2022/lib/vjs-service.mjs +3 -3
- package/fesm2022/visuallyjs-browser-ui-angular.mjs +645 -142
- package/fesm2022/visuallyjs-browser-ui-angular.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/base.vertex.component.d.ts +29 -3
- package/lib/browser-ui-angular.module.d.ts +23 -21
- package/lib/diagram-component.d.ts +7 -5
- package/lib/overlay-component.d.ts +5 -5
- package/lib/paper-component.d.ts +156 -0
- package/lib/surface-component.d.ts +19 -11
- package/lib/surface-popup-component.d.ts +62 -0
- package/package.json +2 -2
- package/visuallyjs-browser-ui-angular.tgz +0 -0
package/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export * from './lib/default-group-component';
|
|
|
17
17
|
export * from './lib/common';
|
|
18
18
|
export * from './lib/miniview-component';
|
|
19
19
|
export * from './lib/surface-component';
|
|
20
|
+
export * from './lib/surface-popup-component';
|
|
21
|
+
export * from './lib/paper-component';
|
|
20
22
|
export * from './lib/overlay-component';
|
|
21
23
|
export * from './lib/palette.component';
|
|
22
24
|
export * from './lib/decorator-component';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectorRef, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
-
import { ObjectData, Node, Surface, BrowserElement, VisuallyJsModel, SurfaceVertexCloneOptions, Port } from "@visuallyjs/browser-ui";
|
|
2
|
+
import { ObjectData, Node, Surface, BrowserElement, VisuallyJsModel, SurfaceVertexCloneOptions, Port, Edge, Paper, BrowserUI } from "@visuallyjs/browser-ui";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Superclass for base node and base group components. You wont need to interact directly with this class; other component base classed in VisuallyJs extend from it.
|
|
@@ -19,10 +19,20 @@ export declare abstract class BaseVertexComponent<T extends Node> implements OnI
|
|
|
19
19
|
*/
|
|
20
20
|
model: VisuallyJsModel;
|
|
21
21
|
/**
|
|
22
|
-
* Underlying Surface. Visually sets this.
|
|
22
|
+
* Underlying Surface. Visually sets this, if the component is rendered by a SurfaceComponent.
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
25
|
surface: Surface;
|
|
26
|
+
/**
|
|
27
|
+
* Underlying Paper. Visually sets this, if the component is rendered by a PaperComponent.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
paper: Paper;
|
|
31
|
+
/**
|
|
32
|
+
* Underlying UI. Visually sets this, regardless of the component this was rendered by (ie Surface or Paper).
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
ui: BrowserUI;
|
|
26
36
|
/**
|
|
27
37
|
* Underlying model object. Visually sets this.
|
|
28
38
|
* @internal
|
|
@@ -46,6 +56,22 @@ export declare abstract class BaseVertexComponent<T extends Node> implements OnI
|
|
|
46
56
|
* @classMember
|
|
47
57
|
*/
|
|
48
58
|
zoom: import("@angular/core").WritableSignal<number>;
|
|
59
|
+
/**
|
|
60
|
+
* This signal provides all of the edges for which this vertex is the source. These are edges connected to the vertex, not to its ports.
|
|
61
|
+
*/
|
|
62
|
+
sourceEdges: import("@angular/core").WritableSignal<Edge[]>;
|
|
63
|
+
/**
|
|
64
|
+
* This signal provides all of the edges for which this vertex or one of its ports is the source.
|
|
65
|
+
*/
|
|
66
|
+
allSourceEdges: import("@angular/core").WritableSignal<Edge[]>;
|
|
67
|
+
/**
|
|
68
|
+
* This signal provides all of the edges for which this vertex is the target. These are edges connected to the vertex, not to its ports.
|
|
69
|
+
*/
|
|
70
|
+
targetEdges: import("@angular/core").WritableSignal<Edge[]>;
|
|
71
|
+
/**
|
|
72
|
+
* This signal provides all of the edges for which this vertex or one of its ports is the target.
|
|
73
|
+
*/
|
|
74
|
+
allTargetEdges: import("@angular/core").WritableSignal<Edge[]>;
|
|
49
75
|
/**
|
|
50
76
|
* @internal
|
|
51
77
|
* @private
|
|
@@ -56,6 +82,7 @@ export declare abstract class BaseVertexComponent<T extends Node> implements OnI
|
|
|
56
82
|
* @internal
|
|
57
83
|
*/
|
|
58
84
|
ngOnInit(): void;
|
|
85
|
+
$updateEdges(): void;
|
|
59
86
|
/**
|
|
60
87
|
* Gets the vertex that this component represents. Subclasses have getters that return more specific subclasses of Vertex.
|
|
61
88
|
* @classMember
|
|
@@ -119,7 +146,6 @@ export declare abstract class BaseVertexComponent<T extends Node> implements OnI
|
|
|
119
146
|
* Flash this vertex
|
|
120
147
|
* @param duration Optional; defaults to 1000ms. Duration of the animation in milliseconds.
|
|
121
148
|
* @param animName Optional; the name of the CSS animation to apply. Defaults to ANIM_SURFACE_ELEMENT_FLASH.
|
|
122
|
-
* @internal
|
|
123
149
|
*/
|
|
124
150
|
flashVertex(duration: number, animName?: string): void;
|
|
125
151
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseVertexComponent<any>, never>;
|
|
@@ -4,26 +4,28 @@ import * as i2 from "./default-group-component";
|
|
|
4
4
|
import * as i3 from "./base.port.component";
|
|
5
5
|
import * as i4 from "./miniview-component";
|
|
6
6
|
import * as i5 from "./surface-component";
|
|
7
|
-
import * as i6 from "./
|
|
8
|
-
import * as i7 from "./
|
|
9
|
-
import * as i8 from "./
|
|
10
|
-
import * as i9 from "./
|
|
11
|
-
import * as i10 from "./
|
|
12
|
-
import * as i11 from "./
|
|
13
|
-
import * as i12 from "./
|
|
14
|
-
import * as i13 from "./
|
|
15
|
-
import * as i14 from "./
|
|
16
|
-
import * as i15 from "./
|
|
17
|
-
import * as i16 from "./charts/
|
|
18
|
-
import * as i17 from "./charts/
|
|
19
|
-
import * as i18 from "./charts/
|
|
20
|
-
import * as i19 from "./charts/
|
|
21
|
-
import * as i20 from "./charts/
|
|
22
|
-
import * as i21 from "./charts/
|
|
23
|
-
import * as i22 from "./charts/
|
|
24
|
-
import * as i23 from "./charts/
|
|
25
|
-
import * as i24 from "./
|
|
26
|
-
import * as i25 from "
|
|
7
|
+
import * as i6 from "./paper-component";
|
|
8
|
+
import * as i7 from "./palette.component";
|
|
9
|
+
import * as i8 from "./shape.palette.component";
|
|
10
|
+
import * as i9 from "./diagram-palette-component";
|
|
11
|
+
import * as i10 from "./shape.component";
|
|
12
|
+
import * as i11 from "./controls-component";
|
|
13
|
+
import * as i12 from "./edge.type.picker.component";
|
|
14
|
+
import * as i13 from "./export-controls-component";
|
|
15
|
+
import * as i14 from "./color.tag.component";
|
|
16
|
+
import * as i15 from "./diagram-component";
|
|
17
|
+
import * as i16 from "./charts/column.chart.component";
|
|
18
|
+
import * as i17 from "./charts/bar.chart.component";
|
|
19
|
+
import * as i18 from "./charts/xy.chart.component";
|
|
20
|
+
import * as i19 from "./charts/line.chart.component";
|
|
21
|
+
import * as i20 from "./charts/area.chart.component";
|
|
22
|
+
import * as i21 from "./charts/pie.chart.component";
|
|
23
|
+
import * as i22 from "./charts/scatter.chart.component";
|
|
24
|
+
import * as i23 from "./charts/bubble.chart.component";
|
|
25
|
+
import * as i24 from "./charts/sankey.chart.component";
|
|
26
|
+
import * as i25 from "./decorator-component";
|
|
27
|
+
import * as i26 from "./surface-popup-component";
|
|
28
|
+
import * as i27 from "@angular/common";
|
|
27
29
|
/**
|
|
28
30
|
* VisuallyJs Angular module.
|
|
29
31
|
*
|
|
@@ -59,6 +61,6 @@ import * as i25 from "@angular/common";
|
|
|
59
61
|
*/
|
|
60
62
|
export declare class VisuallyJsModule {
|
|
61
63
|
static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyJsModule, never>;
|
|
62
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<VisuallyJsModule, [typeof i1.DefaultNodeComponent, typeof i2.DefaultGroupComponent, typeof i3.BasePortComponent, typeof i4.MiniviewComponent, typeof i5.SurfaceComponent, typeof i6.
|
|
64
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<VisuallyJsModule, [typeof i1.DefaultNodeComponent, typeof i2.DefaultGroupComponent, typeof i3.BasePortComponent, typeof i4.MiniviewComponent, typeof i5.SurfaceComponent, typeof i6.PaperComponent, typeof i7.PaletteComponent, typeof i8.ShapePaletteComponent, typeof i9.DiagramPaletteComponent, typeof i10.ShapeComponent, typeof i11.ControlsComponent, typeof i12.EdgeTypePickerComponent, typeof i7.PaletteComponent, typeof i13.ExportControlsComponent, typeof i14.ColorPickerComponent, typeof i15.DiagramComponent, typeof i16.ColumnChartComponent, typeof i17.BarChartComponent, typeof i18.XYChartComponent, typeof i19.LineChartComponent, typeof i20.AreaChartComponent, typeof i21.PieChartComponent, typeof i22.ScatterChartComponent, typeof i23.BubbleChartComponent, typeof i24.SankeyChartComponent, typeof i25.DecoratorComponent, typeof i26.SurfacePopupComponent], [typeof i27.CommonModule], [typeof i4.MiniviewComponent, typeof i5.SurfaceComponent, typeof i6.PaperComponent, typeof i7.PaletteComponent, typeof i9.DiagramPaletteComponent, typeof i10.ShapeComponent, typeof i8.ShapePaletteComponent, typeof i11.ControlsComponent, typeof i13.ExportControlsComponent, typeof i12.EdgeTypePickerComponent, typeof i14.ColorPickerComponent, typeof i15.DiagramComponent, typeof i16.ColumnChartComponent, typeof i17.BarChartComponent, typeof i18.XYChartComponent, typeof i19.LineChartComponent, typeof i20.AreaChartComponent, typeof i21.PieChartComponent, typeof i22.ScatterChartComponent, typeof i23.BubbleChartComponent, typeof i24.SankeyChartComponent, typeof i25.DecoratorComponent, typeof i26.SurfacePopupComponent]>;
|
|
63
65
|
static ɵinj: i0.ɵɵInjectorDeclaration<VisuallyJsModule>;
|
|
64
66
|
}
|
|
@@ -13,15 +13,15 @@ export declare class DiagramComponent implements AfterViewInit, OnDestroy {
|
|
|
13
13
|
*/
|
|
14
14
|
options?: DiagramOptions;
|
|
15
15
|
/**
|
|
16
|
-
* Optional data to load after
|
|
16
|
+
* Optional data to load after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
17
17
|
* @input
|
|
18
18
|
*/
|
|
19
|
-
data
|
|
19
|
+
data: import("@angular/core").InputSignal<Record<string, any>>;
|
|
20
20
|
/**
|
|
21
|
-
* Optional
|
|
21
|
+
* Optional url from which to load data after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
22
22
|
* @input
|
|
23
23
|
*/
|
|
24
|
-
url
|
|
24
|
+
url: import("@angular/core").InputSignal<string>;
|
|
25
25
|
/**
|
|
26
26
|
* Options for the underlying model
|
|
27
27
|
* @input
|
|
@@ -35,6 +35,8 @@ export declare class DiagramComponent implements AfterViewInit, OnDestroy {
|
|
|
35
35
|
$ngZone: NgZone;
|
|
36
36
|
$el: ElementRef<any>;
|
|
37
37
|
$vjs: VisuallyJsService;
|
|
38
|
+
private _dataEffect;
|
|
39
|
+
private _urlEffect;
|
|
38
40
|
ngAfterViewInit(): void;
|
|
39
41
|
ngOnDestroy(): void;
|
|
40
42
|
/**
|
|
@@ -48,5 +50,5 @@ export declare class DiagramComponent implements AfterViewInit, OnDestroy {
|
|
|
48
50
|
*/
|
|
49
51
|
saveToUrl(options: SaveOptions): void;
|
|
50
52
|
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>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DiagramComponent, "vjs-diagram", never, { "options": { "alias": "options"; "required": false; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; "modelOptions": { "alias": "modelOptions"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
52
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Edge, ObjectData
|
|
1
|
+
import { BrowserUI, Edge, ObjectData } from "@visuallyjs/browser-ui";
|
|
2
2
|
import { ChangeDetectorRef } from "@angular/core";
|
|
3
3
|
import { VisuallyJsModel } from "@visuallyjs/browser-ui";
|
|
4
4
|
import { VisuallyJsAngularComponent } from "./surface-component";
|
|
@@ -10,7 +10,7 @@ export declare const AngularComponentOverlayType = "AngularComponent";
|
|
|
10
10
|
/**
|
|
11
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
12
|
*/
|
|
13
|
-
export interface AngularOverlayComponent extends VisuallyJsAngularComponent {
|
|
13
|
+
export interface AngularOverlayComponent<T extends BrowserUI = BrowserUI> extends VisuallyJsAngularComponent<T> {
|
|
14
14
|
/**
|
|
15
15
|
* The edge that this overlay is drawn on.
|
|
16
16
|
*/
|
|
@@ -20,17 +20,17 @@ export interface AngularOverlayComponent extends VisuallyJsAngularComponent {
|
|
|
20
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
21
|
* @group Components
|
|
22
22
|
*/
|
|
23
|
-
export declare abstract class BaseAngularOverlayComponent implements AngularOverlayComponent {
|
|
23
|
+
export declare abstract class BaseAngularOverlayComponent<T extends BrowserUI = BrowserUI> implements AngularOverlayComponent<T> {
|
|
24
24
|
/**
|
|
25
25
|
* The underlying model
|
|
26
26
|
* @classMember
|
|
27
27
|
*/
|
|
28
28
|
model: VisuallyJsModel;
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
30
|
+
* The UI that this overlay is rendered by
|
|
31
31
|
* @classMember
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
ui: T;
|
|
34
34
|
/**
|
|
35
35
|
* Backing data for the edge this overlay is attached to
|
|
36
36
|
* @classMember
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { AfterViewInit, ComponentRef, ElementRef, EventEmitter, NgZone, OnDestroy, ViewContainerRef } from "@angular/core";
|
|
2
|
+
import { PortUpdatedParams, Vertex, VertexUpdatedParams, Paper, ModelOptions, SurfaceSaveData, ExportOptions, SaveOptions, BrowserUIModel } from "@visuallyjs/browser-ui";
|
|
3
|
+
import { AngularRenderOptions, AngularViewOptions } from "./common";
|
|
4
|
+
import { VisuallyJsService } from "./vjs-service";
|
|
5
|
+
import { VisuallyJsAngularDOMElement } from "./surface-component";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Provides a component that manages a Paper. You can configure three sets of options on this component:
|
|
9
|
+
*
|
|
10
|
+
* 1. renderOptions - these are options that control the behaviour of the Paper canvas
|
|
11
|
+
* 2. viewOptions - these are mappings of node/group types to behaviour and components, and edge types to behaviour
|
|
12
|
+
* 3. modelOptions - Options that govern how the underlying data model operates. If you don't provide these, the Paper component uses defaults (which is fine for the majority of applications)
|
|
13
|
+
*
|
|
14
|
+
* ```typescript
|
|
15
|
+
* @Component({
|
|
16
|
+
* selector:"app-my-canvas",
|
|
17
|
+
* template:`<vjs-Paper [renderOptions]="renderOptions"
|
|
18
|
+
* [viewOptions]="viewOptions"
|
|
19
|
+
* [modelOptions]="modelOptions"/>`
|
|
20
|
+
* })
|
|
21
|
+
* export class MyCanvas {
|
|
22
|
+
*
|
|
23
|
+
* renderOptions = { ... }
|
|
24
|
+
* viewOptions = { ... }
|
|
25
|
+
* modelOptions = { ... }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @group Components
|
|
30
|
+
*/
|
|
31
|
+
export declare class PaperComponent<RO extends AngularRenderOptions = AngularRenderOptions> implements AfterViewInit, OnDestroy {
|
|
32
|
+
/**
|
|
33
|
+
* Optional preconfigured model to use for this Paper. You don't normally need to provide this; the component will create a model from the options you pass in (or with blank options by default) otherwise.
|
|
34
|
+
*/
|
|
35
|
+
inputModel?: BrowserUIModel;
|
|
36
|
+
/**
|
|
37
|
+
* Options for the view - mappings of components and behaviour to model object types.
|
|
38
|
+
* @input
|
|
39
|
+
*/
|
|
40
|
+
viewOptions?: AngularViewOptions;
|
|
41
|
+
/**
|
|
42
|
+
* Options for the underlying Paper widget.
|
|
43
|
+
* @input
|
|
44
|
+
*/
|
|
45
|
+
renderOptions?: AngularRenderOptions;
|
|
46
|
+
/**
|
|
47
|
+
* 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.
|
|
48
|
+
* @input
|
|
49
|
+
*/
|
|
50
|
+
modelOptions?: ModelOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Optional data to load after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
53
|
+
* @input
|
|
54
|
+
*/
|
|
55
|
+
data: import("@angular/core").InputSignal<Record<string, any>>;
|
|
56
|
+
/**
|
|
57
|
+
* Optional url from which to load data after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
58
|
+
* @input
|
|
59
|
+
*/
|
|
60
|
+
url: import("@angular/core").InputSignal<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Output event emitter, for proxying events from vertex components.
|
|
63
|
+
* @output
|
|
64
|
+
*/
|
|
65
|
+
vertexEvent: EventEmitter<{
|
|
66
|
+
/**
|
|
67
|
+
* The vertex emitting the event
|
|
68
|
+
*/
|
|
69
|
+
vertex: Vertex;
|
|
70
|
+
/**
|
|
71
|
+
* Event name
|
|
72
|
+
*/
|
|
73
|
+
event: string;
|
|
74
|
+
/**
|
|
75
|
+
* Payload for the event
|
|
76
|
+
*/
|
|
77
|
+
payload: any;
|
|
78
|
+
/**
|
|
79
|
+
* The Angular component that fired the event
|
|
80
|
+
*/
|
|
81
|
+
component: ComponentRef<any>;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* The underlying model.
|
|
85
|
+
* @classMember
|
|
86
|
+
*/
|
|
87
|
+
model: BrowserUIModel;
|
|
88
|
+
/**
|
|
89
|
+
* The Paper from the UI core package that this component manages.
|
|
90
|
+
* @classMember
|
|
91
|
+
*/
|
|
92
|
+
paper: Paper;
|
|
93
|
+
nodeUpdateFn: (a: any, e?: any) => any;
|
|
94
|
+
groupUpdateFn: (a: any, e?: any) => any;
|
|
95
|
+
portAddedFn: (a: any, e?: any) => any;
|
|
96
|
+
portUpdateFn: (a: any, e?: any) => any;
|
|
97
|
+
dataLoadEndFn: () => any;
|
|
98
|
+
edgeUpdateFn: (a: any, e?: any) => any;
|
|
99
|
+
edgeAddFn: (a: any, e?: any) => any;
|
|
100
|
+
edgeRemoveFn: (a: any, e?: any) => any;
|
|
101
|
+
$el: ElementRef<any>;
|
|
102
|
+
$viewContainerRef: ViewContainerRef;
|
|
103
|
+
$ngZone: NgZone;
|
|
104
|
+
$vjs: VisuallyJsService;
|
|
105
|
+
private _dataEffect;
|
|
106
|
+
private _urlEffect;
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
getNativeElement(component: any): VisuallyJsAngularDOMElement;
|
|
111
|
+
private _getComponent;
|
|
112
|
+
private _getComponentThen;
|
|
113
|
+
/**
|
|
114
|
+
* on node/group update, store the new data in the view
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
nodeOrGroupUpdated(params: VertexUpdatedParams): void;
|
|
118
|
+
portUpdated(params: PortUpdatedParams): void;
|
|
119
|
+
/**
|
|
120
|
+
* 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.
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
123
|
+
private edgeUpdated;
|
|
124
|
+
private edgeAddedRemoved;
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
private _processAngularOverlays;
|
|
129
|
+
/**
|
|
130
|
+
* Save the dataset and the Paper's current pan/zoom, as well as any inspector context, via POST to a URL.
|
|
131
|
+
* @param options Options for the save operation
|
|
132
|
+
* @classMember
|
|
133
|
+
*/
|
|
134
|
+
save(options: SaveOptions): void;
|
|
135
|
+
/**
|
|
136
|
+
* Export the dataset only
|
|
137
|
+
* @classMember
|
|
138
|
+
*/
|
|
139
|
+
exportData(options: ExportOptions): SurfaceSaveData;
|
|
140
|
+
/**
|
|
141
|
+
* On data load end, repaint everything on next tick.
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
dataLoadEnd(): void;
|
|
145
|
+
private $removeNgElement;
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
ngAfterViewInit(): void;
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
ngOnDestroy(): void;
|
|
154
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaperComponent<any>, never>;
|
|
155
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaperComponent<any>, "vjs-paper", never, { "inputModel": { "alias": "model"; "required": false; }; "viewOptions": { "alias": "viewOptions"; "required": false; }; "renderOptions": { "alias": "renderOptions"; "required": false; }; "modelOptions": { "alias": "modelOptions"; "required": false; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; }, { "vertexEvent": "vertexEvent"; }, never, ["*"], false, never>;
|
|
156
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
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";
|
|
2
|
+
import { ObjectData, PortUpdatedParams, Vertex, VertexUpdatedParams, Surface, BrowserElement, VisuallyJsModel, ModelOptions, SurfaceSaveData, ExportOptions, SaveOptions, BrowserUIModel, BrowserUI, Paper } from "@visuallyjs/browser-ui";
|
|
3
3
|
import { AngularRenderOptions, AngularViewOptions } from "./common";
|
|
4
4
|
import { VisuallyJsService } from "./vjs-service";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type VisuallyJsAngularDOMElement = BrowserElement & {
|
|
7
10
|
_visuallyJsNgComponent: any;
|
|
8
11
|
_ref: ComponentRef<any>;
|
|
9
12
|
};
|
|
10
13
|
/**
|
|
11
14
|
* @internal
|
|
12
15
|
*/
|
|
13
|
-
export interface VisuallyJsAngularComponent {
|
|
16
|
+
export interface VisuallyJsAngularComponent<T extends BrowserUI> {
|
|
14
17
|
model: VisuallyJsModel;
|
|
15
|
-
|
|
18
|
+
ui: T;
|
|
16
19
|
data: ObjectData;
|
|
17
20
|
$data?: WritableSignal<ObjectData>;
|
|
18
21
|
changeDetectorRef?: ChangeDetectorRef;
|
|
@@ -20,9 +23,11 @@ export interface VisuallyJsAngularComponent {
|
|
|
20
23
|
/**
|
|
21
24
|
* @internal
|
|
22
25
|
*/
|
|
23
|
-
export interface VisuallyJsAngularVertexComponent extends VisuallyJsAngularComponent {
|
|
26
|
+
export interface VisuallyJsAngularVertexComponent<T extends BrowserUI> extends VisuallyJsAngularComponent<T> {
|
|
24
27
|
modelObject: Vertex;
|
|
25
28
|
_el: VisuallyJsAngularDOMElement;
|
|
29
|
+
surface?: Surface;
|
|
30
|
+
paper?: Paper;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* Provides a component that manages a Surface. You can configure three sets of options on this component:
|
|
@@ -69,15 +74,15 @@ export declare class SurfaceComponent<RO extends AngularRenderOptions = AngularR
|
|
|
69
74
|
*/
|
|
70
75
|
modelOptions?: ModelOptions;
|
|
71
76
|
/**
|
|
72
|
-
* Optional data to load after the view has been initialised.
|
|
77
|
+
* Optional data to load after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
73
78
|
* @input
|
|
74
79
|
*/
|
|
75
|
-
data
|
|
80
|
+
data: import("@angular/core").InputSignal<Record<string, any>>;
|
|
76
81
|
/**
|
|
77
|
-
* Optional url from which to load data after the view has been initialised.
|
|
82
|
+
* Optional url from which to load data after the view has been initialised. This input is a signal, and will reload the dataset if changed.
|
|
78
83
|
* @input
|
|
79
84
|
*/
|
|
80
|
-
url
|
|
85
|
+
url: import("@angular/core").InputSignal<string>;
|
|
81
86
|
/**
|
|
82
87
|
* Output event emitter, for proxying events from vertex components.
|
|
83
88
|
* @output
|
|
@@ -117,10 +122,13 @@ export declare class SurfaceComponent<RO extends AngularRenderOptions = AngularR
|
|
|
117
122
|
dataLoadEndFn: () => any;
|
|
118
123
|
edgeUpdateFn: (a: any, e?: any) => any;
|
|
119
124
|
edgeAddFn: (a: any, e?: any) => any;
|
|
125
|
+
edgeRemoveFn: (a: any, e?: any) => any;
|
|
120
126
|
$el: ElementRef<any>;
|
|
121
127
|
$viewContainerRef: ViewContainerRef;
|
|
122
128
|
$ngZone: NgZone;
|
|
123
129
|
$vjs: VisuallyJsService;
|
|
130
|
+
private _dataEffect;
|
|
131
|
+
private _urlEffect;
|
|
124
132
|
/**
|
|
125
133
|
* @internal
|
|
126
134
|
*/
|
|
@@ -138,6 +146,7 @@ export declare class SurfaceComponent<RO extends AngularRenderOptions = AngularR
|
|
|
138
146
|
* @internal
|
|
139
147
|
*/
|
|
140
148
|
private edgeUpdated;
|
|
149
|
+
private edgeAddedRemoved;
|
|
141
150
|
/**
|
|
142
151
|
* @internal
|
|
143
152
|
*/
|
|
@@ -168,6 +177,5 @@ export declare class SurfaceComponent<RO extends AngularRenderOptions = AngularR
|
|
|
168
177
|
*/
|
|
169
178
|
ngOnDestroy(): void;
|
|
170
179
|
static ɵfac: i0.ɵɵFactoryDeclaration<SurfaceComponent<any>, never>;
|
|
171
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SurfaceComponent<any>, "vjs-surface", never, { "inputModel": { "alias": "model"; "required": false; }; "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>;
|
|
180
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SurfaceComponent<any>, "vjs-surface", never, { "inputModel": { "alias": "model"; "required": false; }; "viewOptions": { "alias": "viewOptions"; "required": false; }; "renderOptions": { "alias": "renderOptions"; "required": false; }; "modelOptions": { "alias": "modelOptions"; "required": false; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; }, { "vertexEvent": "vertexEvent"; }, never, ["*"], false, never>;
|
|
172
181
|
}
|
|
173
|
-
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TemplateRef, ElementRef, AfterViewInit, OnDestroy } from "@angular/core";
|
|
2
|
+
import { Vertex, PopupHandler, PopupPosition } from "@visuallyjs/browser-ui";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Provides a means to wire up a popup that is shown when users tap on a vertex.
|
|
6
|
+
*
|
|
7
|
+
* Use it like this:
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <vjs-surface-popup selector=".my-launcher" anchor="bottom">
|
|
11
|
+
* <ng-template let-vertex="vertex" let-model="model" let-ui="ui" let-hide="hide">
|
|
12
|
+
* <div>Popup content for {{vertex.data.name}}</div>
|
|
13
|
+
* </ng-template>
|
|
14
|
+
* </vjs-surface-popup>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Your popup should expose inputs for
|
|
18
|
+
*
|
|
19
|
+
* - vertex The vertex the popup is attached to
|
|
20
|
+
* - model The underlying model
|
|
21
|
+
* - ui The UI that rendered this popup
|
|
22
|
+
* - hide A function you can invoke to close the popup, if you need to.
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* @group Components
|
|
26
|
+
*/
|
|
27
|
+
export declare class SurfacePopupComponent implements AfterViewInit, OnDestroy {
|
|
28
|
+
/**
|
|
29
|
+
* CSS3 selector identifying elements from which this popup is launched.
|
|
30
|
+
* @input
|
|
31
|
+
*/
|
|
32
|
+
selector: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional position to place this popup. Defaults to "bottom", and can also be overridden on a per-launcher basis via a DOM attribute.
|
|
35
|
+
* @input
|
|
36
|
+
*/
|
|
37
|
+
anchor?: PopupPosition;
|
|
38
|
+
/**
|
|
39
|
+
* Template containing popup content
|
|
40
|
+
*/
|
|
41
|
+
template: TemplateRef<any>;
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
container: ElementRef<HTMLDivElement>;
|
|
46
|
+
private cdr;
|
|
47
|
+
private vjs;
|
|
48
|
+
private initialized;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
popupHandler: PopupHandler;
|
|
53
|
+
readonly current: import("@angular/core").WritableSignal<Vertex>;
|
|
54
|
+
readonly model: import("@angular/core").WritableSignal<import("@visuallyjs/browser-ui").BrowserUIModel>;
|
|
55
|
+
readonly ui: import("@angular/core").WritableSignal<import("@visuallyjs/browser-ui").BrowserUI<any>>;
|
|
56
|
+
readonly display: import("@angular/core").Signal<"none" | "block">;
|
|
57
|
+
$hide(): void;
|
|
58
|
+
ngAfterViewInit(): void;
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SurfacePopupComponent, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SurfacePopupComponent, "vjs-surface-popup", never, { "selector": { "alias": "selector"; "required": true; }; "anchor": { "alias": "anchor"; "required": false; }; }, {}, ["template"], never, false, never>;
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visuallyjs/browser-ui-angular",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "*",
|
|
6
6
|
"@angular/core": "*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.0.0",
|
|
10
|
-
"@visuallyjs/browser-ui": "1.2.
|
|
10
|
+
"@visuallyjs/browser-ui": "1.2.1"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
"./css/visuallyjs-angular.css": {
|
|
Binary file
|