@visuallyjs/browser-ui 1.0.3 → 1.1.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/js/visuallyjs.browser-ui.cjs.js +57 -57
- package/js/visuallyjs.browser-ui.esm.js +57 -57
- package/package.json +1 -1
- package/types/browser-ui/browser-ui.d.ts +4 -7
- package/types/browser-ui/browser-util.d.ts +1 -0
- package/types/browser-ui/browser-visuallyjs-instance.d.ts +12 -6
- package/types/browser-ui/components/controls/css-classes.d.ts +24 -0
- package/types/browser-ui/components/inspector/color-picker-tag.d.ts +6 -0
- package/types/browser-ui/components/palette/palette.d.ts +1 -0
- package/types/browser-ui/connector-editors/editor-base.d.ts +0 -1
- package/types/browser-ui/connector-editors/util.d.ts +0 -2
- package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +0 -12
- package/types/browser-ui/constants.d.ts +4 -10
- package/types/browser-ui/css-constants.d.ts +57 -8
- package/types/browser-ui/definitions.d.ts +27 -6
- package/types/browser-ui/dialogs/binder.d.ts +0 -11
- package/types/browser-ui/edge-handler-base.d.ts +9 -16
- package/types/browser-ui/edge-input-handler.d.ts +3 -10
- package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +2 -1
- package/types/browser-ui/element-drag-handler-2.d.ts +0 -3
- package/types/browser-ui/icons/definitions.d.ts +20 -0
- package/types/browser-ui/pan-zoom-options.d.ts +10 -21
- package/types/browser-ui/pan-zoom.d.ts +29 -114
- package/types/browser-ui/paper-renderer/definitions.d.ts +2 -0
- package/types/browser-ui/paper-renderer/paper.d.ts +1 -0
- package/types/browser-ui/plugins/background/background-options.d.ts +4 -0
- package/types/browser-ui/plugins/background/tiled-background.d.ts +2 -0
- package/types/browser-ui/plugins/browser-ui-plugin.d.ts +6 -1
- package/types/browser-ui/positioning-and-sizing-utils.d.ts +21 -1
- package/types/browser-ui/shape-library/shape-library-definitions.d.ts +26 -11
- package/types/browser-ui/shape-library/shape-library.d.ts +14 -3
- package/types/browser-ui/shape-library/shapes-basic.d.ts +1 -1
- package/types/browser-ui/shape-library/shapes-flowchart.d.ts +1 -1
- package/types/browser-ui/surface-renderer/anim/definitions.d.ts +13 -4
- package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +0 -1
- package/types/browser-ui/surface-renderer/definitions.d.ts +14 -3
- package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +8 -2
- package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +2 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +4 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +4 -1
- package/types/browser-ui/surface-renderer/diagrams/index.d.ts +4 -2
- package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +14 -0
- package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +3 -1
- package/types/browser-ui/surface-renderer/plugins/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/list-manager/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/list-manager/list-manager-plugin.d.ts +34 -0
- package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +1 -2
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +9 -0
- package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +12 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +0 -2
- package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +5 -2
- package/types/browser-ui/surface-renderer/shape-palette.d.ts +1 -1
- package/types/browser-ui/surface-renderer/surface-render-options.d.ts +0 -30
- package/types/browser-ui/surface-renderer/surface.d.ts +47 -38
- package/types/browser-ui/svg-export/definitions.d.ts +12 -0
- package/types/browser-ui/svg-export/image-exporter.d.ts +2 -0
- package/types/browser-ui/svg-export/svg-exporter.d.ts +3 -0
- package/types/browser-ui/templating/custom-tag-definition.d.ts +1 -2
- package/types/browser-ui/util.d.ts +2 -0
- package/types/charts/bar-and-column/bar-plot.d.ts +2 -0
- package/types/charts/base-chart.d.ts +62 -6
- package/types/charts/chart-exporter.d.ts +3 -0
- package/types/charts/datasource.d.ts +11 -0
- package/types/charts/definitions.d.ts +10 -0
- package/types/charts/domain_scale_utilities.d.ts +4 -0
- package/types/charts/legend.d.ts +2 -0
- package/types/charts/pie/pie-chart.d.ts +2 -0
- package/types/charts/sankey/sankey.d.ts +1 -0
- package/types/charts/scatter/definitions.d.ts +1 -0
- package/types/charts/series/array-based-series.d.ts +2 -0
- package/types/charts/series/definitions.d.ts +1 -0
- package/types/charts/series/series.d.ts +2 -0
- package/types/charts/series-based-chart.d.ts +1 -0
- package/types/charts/tooltip.d.ts +7 -2
- package/types/charts/util.d.ts +10 -3
- package/types/core/autosaver.d.ts +2 -1
- package/types/core/csv-loader.d.ts +8 -2
- package/types/core/event-constants.d.ts +44 -2
- package/types/core/geom.d.ts +1 -0
- package/types/core/io.d.ts +31 -7
- package/types/core/layout/abstract-layout.d.ts +1 -0
- package/types/core/layout/grid/definitions.d.ts +10 -19
- package/types/core/layout/grid/grid-layout.d.ts +2 -2
- package/types/core/layout/hierarchy/util.d.ts +1 -7
- package/types/core/magnetizer.d.ts +1 -0
- package/types/core/model/anchor.d.ts +1 -0
- package/types/core/model/graph.d.ts +3 -11
- package/types/core/model/group-template.d.ts +15 -0
- package/types/core/params.d.ts +2 -2
- package/types/core/renderer.d.ts +3 -0
- package/types/core/rtree/rtree.d.ts +15 -0
- package/types/core/selection.d.ts +2 -6
- package/types/core/templates/core.d.ts +1 -1
- package/types/core/toolkit.d.ts +30 -10
- package/types/core/undo-redo/undo-redo.d.ts +0 -22
- package/types/core/util.d.ts +4 -1
- package/types/ui/common/overlay.d.ts +3 -1
- package/types/ui/common/paint-style.d.ts +2 -0
- package/types/ui/connector-orthogonal/operations.d.ts +1 -18
- package/types/ui/connector-orthogonal/utils.d.ts +0 -6
- package/types/ui/connector-straight/straight-connector.d.ts +2 -5
- package/types/ui/core/component/component.d.ts +1 -4
- package/types/ui/core/connector/connection-impl.d.ts +1 -0
- package/types/ui/core/connector/connections.d.ts +0 -29
- package/types/ui/core/connector/straight-segment.d.ts +0 -6
- package/types/ui/core/constants.d.ts +0 -4
- package/types/ui/core/core-events.d.ts +5 -3
- package/types/ui/core/core.d.ts +19 -21
- package/types/ui/core/defaults.d.ts +43 -9
- package/types/ui/core/definitions.d.ts +39 -20
- package/types/ui/core/event-constants.d.ts +1 -0
- package/types/ui/core/factory/continuous-anchors.d.ts +0 -6
- package/types/ui/core/grid-profile.d.ts +3 -1
- package/types/ui/core/magnetize-profile.d.ts +1 -3
- package/types/ui/core/overlay/overlay.d.ts +2 -0
- package/types/ui/core/params.d.ts +8 -99
- package/types/ui/core/router/default-router.d.ts +89 -18
- package/types/ui/core/router/index.d.ts +0 -1
- package/types/ui/core/router/router-utils.d.ts +0 -24
- package/types/ui/core/router/router.d.ts +29 -20
- package/types/ui/core/type-descriptors.d.ts +2 -0
- package/types/ui/core/ui-model.d.ts +3 -0
- package/types/ui/core/view/edge-options.d.ts +1 -0
- package/types/ui/core/view/events.d.ts +22 -0
- package/types/ui/core/view/node-or-port-options.d.ts +6 -0
- package/types/ui/core/view/vertex-options.d.ts +2 -0
- package/types/ui/core/viewport.d.ts +7 -1
- package/types/ui/plugins/definitions.d.ts +6 -1
- package/types/ui/plugins/plugins.d.ts +4 -0
- package/types/ui/property-mappings/definitions.d.ts +6 -0
- package/types/ui/util/util.d.ts +3 -16
- package/types/version.d.ts +1 -1
- package/types/ui/core/router/base-router.d.ts +0 -100
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LayoutParameters } from "../abstract-layout";
|
|
2
2
|
import { BOTTOM, CENTER, LEFT, RIGHT, TOP } from "../../constants";
|
|
3
|
+
import { Group, Node } from "../../model/graph";
|
|
3
4
|
/**
|
|
4
5
|
* GridLayout type. You can use this in a layout spec for a Surface's render parameters.
|
|
5
6
|
* @internal
|
|
@@ -22,18 +23,6 @@ export declare const LAYOUT_TYPE_ROW = "Row";
|
|
|
22
23
|
* @category Grid
|
|
23
24
|
*/
|
|
24
25
|
export type GridLayoutOrientation = "row" | "column";
|
|
25
|
-
/**
|
|
26
|
-
* Possible values for grid layout vertical alignment
|
|
27
|
-
* @see {@link GridLayoutParameters}
|
|
28
|
-
* @group Layouts
|
|
29
|
-
* @category Grid Layout
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* Possible values for grid layout horizontal alignment
|
|
33
|
-
* @see {@link GridLayoutParameters}
|
|
34
|
-
* @group Layouts
|
|
35
|
-
* @category Grid Layout
|
|
36
|
-
*/
|
|
37
26
|
/**
|
|
38
27
|
* Vertical alignment for cells in grid layout.
|
|
39
28
|
* @see {@link GridLayoutParameters}
|
|
@@ -55,19 +44,15 @@ export type GridLayoutHorizontalAlignment = typeof LEFT | typeof CENTER | typeof
|
|
|
55
44
|
*/
|
|
56
45
|
export interface GridLayoutParameters extends LayoutParameters {
|
|
57
46
|
/**
|
|
58
|
-
* Whether to lay out items row first or column first. Additionally, this
|
|
59
|
-
* setting will determine where any extra items are placed if the dataset does
|
|
60
|
-
* not conform to a grid of equal width and height
|
|
47
|
+
* Whether to lay out items row first or column first. Additionally, this setting will determine where any extra items are placed if the dataset does not conform to a grid of equal width and height
|
|
61
48
|
*/
|
|
62
49
|
orientation?: GridLayoutOrientation;
|
|
63
50
|
/**
|
|
64
|
-
* Optional fixed number of rows. By default this is set to -1 - meaning not fixed - which will result in the layout
|
|
65
|
-
* making its best effort at drawing a grid of equal width and height.
|
|
51
|
+
* Optional fixed number of rows. By default this is set to -1 - meaning not fixed - which will result in the layout making its best effort at drawing a grid of equal width and height.
|
|
66
52
|
*/
|
|
67
53
|
rows?: number;
|
|
68
54
|
/**
|
|
69
|
-
* Optional fixed number of columns. By default this is set to -1 - meaning not fixed - which will result in the layout
|
|
70
|
-
* making its best effort at drawing a grid of equal width and height
|
|
55
|
+
* Optional fixed number of columns. By default this is set to -1 - meaning not fixed - which will result in the layout making its best effort at drawing a grid of equal width and height
|
|
71
56
|
*/
|
|
72
57
|
columns?: number;
|
|
73
58
|
/**
|
|
@@ -78,4 +63,10 @@ export interface GridLayoutParameters extends LayoutParameters {
|
|
|
78
63
|
* Optional alignment for horizontal placement in cells. Defaults to center.
|
|
79
64
|
*/
|
|
80
65
|
horizontalAlignment?: GridLayoutHorizontalAlignment;
|
|
66
|
+
/**
|
|
67
|
+
* Optional sort function to run before layout.
|
|
68
|
+
* @param a
|
|
69
|
+
* @param b
|
|
70
|
+
*/
|
|
71
|
+
sort?: (a: Node | Group, b: Node | Group) => number;
|
|
81
72
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractLayout, InternalLayoutOptions } from "../abstract-layout";
|
|
2
|
-
import { CircularLayoutParameters } from "../circular/circular-layout";
|
|
3
2
|
import { DataSource } from "../../datasource";
|
|
4
3
|
import { GridLayoutParameters } from "./definitions";
|
|
5
4
|
import { PointXY, Size } from "../../util";
|
|
@@ -25,7 +24,8 @@ export declare class GridLayout extends AbstractLayout<GridLayoutParameters> {
|
|
|
25
24
|
private readonly _columnCount;
|
|
26
25
|
private _maxWidth;
|
|
27
26
|
private _maxHeight;
|
|
28
|
-
|
|
27
|
+
private _sort;
|
|
28
|
+
getDefaultParameters(): GridLayoutParameters;
|
|
29
29
|
constructor(params: InternalLayoutOptions<GridLayoutParameters>);
|
|
30
30
|
type: string;
|
|
31
31
|
static type: string;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { EdgeEntry
|
|
1
|
+
import { EdgeEntry } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Returns whether or not the given entry represents an edge.
|
|
4
4
|
* @internal
|
|
5
5
|
* @param entry
|
|
6
6
|
*/
|
|
7
7
|
export declare function isEdgeNodeEntry(entry: any): entry is EdgeEntry;
|
|
8
|
-
/**
|
|
9
|
-
* Returns whether or not the given entry represents a node/group.
|
|
10
|
-
* @internal
|
|
11
|
-
* @param entry
|
|
12
|
-
*/
|
|
13
|
-
export declare function isVertexNodeEntry(entry: any): entry is VertexEntry;
|
|
@@ -130,6 +130,7 @@ export type FilterFunction<T> = (id: string, v: T) => boolean;
|
|
|
130
130
|
* - execute magnetizer using a specific element as the focus
|
|
131
131
|
*
|
|
132
132
|
* @group Components
|
|
133
|
+
* @category Magnetizer
|
|
133
134
|
*/
|
|
134
135
|
export declare class Magnetizer<T extends HasId> {
|
|
135
136
|
private _origin;
|
|
@@ -68,6 +68,7 @@ export interface HasWidthHeight {
|
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Base interface for the result of some delete operation. All operations can result in the deletion of zero or more edges, and if the deletion was for a vertex then that vertex may have been inside some group.
|
|
71
|
+
* @internal
|
|
71
72
|
*/
|
|
72
73
|
export interface Deletion {
|
|
73
74
|
/**
|
|
@@ -81,6 +82,7 @@ export interface Deletion {
|
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* The result of a node deletion.
|
|
85
|
+
* @group Data Model
|
|
84
86
|
*/
|
|
85
87
|
export interface NodeDeletion extends Deletion {
|
|
86
88
|
/**
|
|
@@ -90,7 +92,7 @@ export interface NodeDeletion extends Deletion {
|
|
|
90
92
|
}
|
|
91
93
|
/**
|
|
92
94
|
* The result of a group deletion.
|
|
93
|
-
* @group Model
|
|
95
|
+
* @group Data Model
|
|
94
96
|
*/
|
|
95
97
|
export interface GroupDeletion extends Deletion {
|
|
96
98
|
/**
|
|
@@ -125,12 +127,6 @@ export declare function resolveNodeId(v: Vertex): string;
|
|
|
125
127
|
* @category Utils
|
|
126
128
|
*/
|
|
127
129
|
export declare function resolveNode(v: Vertex): Node | Group;
|
|
128
|
-
/**
|
|
129
|
-
* For the given vertex, resolve its port id. If it is not a port, null is returned. If it is a port, its id is returned (without the parent vertex's id prefixed to it)
|
|
130
|
-
* @param v
|
|
131
|
-
* @internal
|
|
132
|
-
*/
|
|
133
|
-
export declare function resolvePortId(v: Vertex): string;
|
|
134
130
|
/**
|
|
135
131
|
* Returns whether or not the given object is a Node. This method is a type guard and after using this method to test an object it can subsequently be treated as a Node if the method returns true.
|
|
136
132
|
* @group Data Model
|
|
@@ -431,7 +427,6 @@ export declare class Graph {
|
|
|
431
427
|
constructor(params: GraphOptions);
|
|
432
428
|
getIdFunction(): IdFunction;
|
|
433
429
|
setIdFunction(f: IdFunction): void;
|
|
434
|
-
setTypeFunction(f: TypeFunction): void;
|
|
435
430
|
/**
|
|
436
431
|
* Gets the type for some data, by running it through the current typeFunction.
|
|
437
432
|
* @param data Object to get type from.
|
|
@@ -537,9 +532,7 @@ export declare class Graph {
|
|
|
537
532
|
*/
|
|
538
533
|
getGroups(): Array<Group>;
|
|
539
534
|
$addMemberToGroup(v: Node, g: string | Group): void;
|
|
540
|
-
$addMembersToGroup(v: Array<Node>, g: Group): void;
|
|
541
535
|
$removeMemberFromGroup(v: string | Node): void;
|
|
542
|
-
$removeMembersFromGroup(v: Array<Node>): void;
|
|
543
536
|
getGroup(group: string | Group): Group;
|
|
544
537
|
/**
|
|
545
538
|
* Deletes a Group
|
|
@@ -783,7 +776,6 @@ export declare abstract class Vertex extends Base implements AbstractEdgeTerminu
|
|
|
783
776
|
edges: Array<Edge>;
|
|
784
777
|
protected indegreeCentrality: number;
|
|
785
778
|
protected outdegreeCentrality: number;
|
|
786
|
-
nestedGraphs: Array<Graph>;
|
|
787
779
|
graphs: Array<Graph>;
|
|
788
780
|
protected constructor(graph: Graph, data?: ObjectData, idFunction?: IdFunction);
|
|
789
781
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectData } from "./graph";
|
|
2
|
+
export interface GroupTemplate {
|
|
3
|
+
nodes?: Array<ObjectData & {
|
|
4
|
+
id: string;
|
|
5
|
+
}>;
|
|
6
|
+
groups?: Array<ObjectData & {
|
|
7
|
+
id: string;
|
|
8
|
+
groupTemplate?: string | GroupTemplate;
|
|
9
|
+
}>;
|
|
10
|
+
edges?: Array<{
|
|
11
|
+
source: string;
|
|
12
|
+
target: string;
|
|
13
|
+
data?: ObjectData;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
package/types/core/params.d.ts
CHANGED
|
@@ -386,8 +386,8 @@ export declare const CONNECT_REASON_COPY_PASTE = "copyPaste";
|
|
|
386
386
|
export type ConnectReason = typeof CONNECT_REASON_API | typeof CONNECT_REASON_UNDO_REDO | typeof CONNECT_REASON_USER_ACTIVITY | typeof CONNECT_REASON_DATA_LOAD | typeof CONNECT_REASON_TRANSIENT | typeof CONNECT_REASON_COPY_PASTE;
|
|
387
387
|
/**
|
|
388
388
|
* Options for loading data.
|
|
389
|
-
* @group
|
|
390
|
-
* @category
|
|
389
|
+
* @group Input and Output
|
|
390
|
+
* @category Model
|
|
391
391
|
*/
|
|
392
392
|
export interface LoadOptions {
|
|
393
393
|
/**
|
package/types/core/renderer.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import { EdgeAddedParams, EdgeRemovedParams, EdgeSourceChangedParams, EdgeTarget
|
|
|
3
3
|
import { VisuallyJsSelection } from "./selection";
|
|
4
4
|
/**
|
|
5
5
|
* Definition of a gradient - an array of [offset, color] entries.
|
|
6
|
+
* @group UI
|
|
7
|
+
* @category Definitions
|
|
6
8
|
*/
|
|
7
9
|
export type GradientSpec = Array<[number, string]>;
|
|
8
10
|
/**
|
|
9
11
|
* Definition of an object that can render an instance of {@link VisuallyJsModel}. This interface is not something a user of the API needs to be concerned with, unless you are creating your own renderer type.
|
|
12
|
+
* @internal
|
|
10
13
|
*/
|
|
11
14
|
export interface VisuallyJsRenderer<E, EVT = any> {
|
|
12
15
|
id: string;
|
|
@@ -28,7 +28,17 @@ export declare class RTree {
|
|
|
28
28
|
private _root;
|
|
29
29
|
private _dataNodes;
|
|
30
30
|
constructor(maxNodes?: number);
|
|
31
|
+
/**
|
|
32
|
+
* Search the tree and find all entries that intersect the given rectangle.
|
|
33
|
+
* @param searchBoundary
|
|
34
|
+
* @param options
|
|
35
|
+
*/
|
|
31
36
|
search(searchBoundary: RectangleXY, options?: RTreeSearchOptions): Array<RTreeDataNode>;
|
|
37
|
+
/**
|
|
38
|
+
* Search the tree and find all entries that intersect the given rectangle, then rank them by the amount they overlap.
|
|
39
|
+
* @param searchBoundary
|
|
40
|
+
* @param options
|
|
41
|
+
*/
|
|
32
42
|
searchAndRank(searchBoundary: RectangleXY, options?: RTreeSearchOptions): Array<{
|
|
33
43
|
node: RTreeDataNode;
|
|
34
44
|
overlap: number;
|
|
@@ -93,6 +103,11 @@ export declare class RTree {
|
|
|
93
103
|
* @internal
|
|
94
104
|
*/
|
|
95
105
|
getLeafNodes(): Array<RTreeDataNode>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns whether or not the tree is tracking an entry with the given id.
|
|
108
|
+
* @param id
|
|
109
|
+
*/
|
|
110
|
+
has(id: string): boolean;
|
|
96
111
|
/**
|
|
97
112
|
* Get all of the leaf nodes under the given focus.
|
|
98
113
|
* @param focus
|
|
@@ -78,6 +78,8 @@ export interface SelectionOptions {
|
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Events that a Selection can fire.
|
|
81
|
+
* @group Events
|
|
82
|
+
* @category Selection
|
|
81
83
|
*/
|
|
82
84
|
export type SELECTION_EVENTS = typeof EVENT_EDGE_UPDATED | typeof EVENT_DATA_LOAD_END | typeof EVENT_DATA_LOAD_START | typeof EVENT_NODE_UPDATED | typeof EVENT_GRAPH_CLEAR_START | typeof EVENT_GROUP_UPDATED | typeof EVENT_PORT_UPDATED | typeof EVENT_EDGE_TARGET_CHANGED | typeof EVENT_EDGE_SOURCE_CHANGED | typeof EVENT_EDGE_REMOVED | typeof EVENT_EDGE_ADDED | typeof EVENT_GROUP_REMOVED | typeof EVENT_NODE_REMOVED | typeof EVENT_GROUP_ADDED | typeof EVENT_NODE_ADDED;
|
|
83
85
|
/**
|
|
@@ -248,12 +250,6 @@ export declare class VisuallyJsSelection extends OptimisticEventGenerator implem
|
|
|
248
250
|
* @returns An array of Edges, which may be empty. Never null.
|
|
249
251
|
*/
|
|
250
252
|
getAllEdgesFor(node: Vertex, filter?: (e: Edge) => boolean): Array<Edge>;
|
|
251
|
-
/**
|
|
252
|
-
* Gets all source Edges for the given Node or Group.
|
|
253
|
-
* @param v The Node/Group to get source Edges for.
|
|
254
|
-
* @returns An array of Edges, which may be empty. Never null.
|
|
255
|
-
*/
|
|
256
|
-
getSourceEdgesFor(v: Node | Group): Array<Edge>;
|
|
257
253
|
/**
|
|
258
254
|
* Get the current number of Edges in the selection.
|
|
259
255
|
*/
|
|
@@ -78,7 +78,6 @@ export declare abstract class Recado {
|
|
|
78
78
|
* @param forceReload
|
|
79
79
|
*/
|
|
80
80
|
_wrapCache(resolver: TemplateResolver, forceReload?: boolean): TemplateResolver;
|
|
81
|
-
getTemplate(id: string): Array<AbstractEntry>;
|
|
82
81
|
/**
|
|
83
82
|
* Add a template. The template is not parsed until such time as someone asks for it.
|
|
84
83
|
* @param id
|
|
@@ -158,5 +157,6 @@ export declare abstract class Recado {
|
|
|
158
157
|
* .3f float, 3 decimal places, locale separator
|
|
159
158
|
* ,.3f float, 3 decimal places, comma separator
|
|
160
159
|
* '.3f float, 3 decimal places, space separator
|
|
160
|
+
* @internal
|
|
161
161
|
*/
|
|
162
162
|
export declare function lightweightPrintfFormatter(value: number | string, format: string): string;
|
package/types/core/toolkit.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { EVENT_GROUP_ADDED, EVENT_GROUP_MEMBER_ADDED, EVENT_GROUP_MEMBER_REMOVED
|
|
|
15
15
|
import { PointXY, Geometry } from "./util";
|
|
16
16
|
import { OptimisticEventGenerator } from "./event-generator";
|
|
17
17
|
import { ProxyLocation } from "./constants";
|
|
18
|
+
import { GroupTemplate } from "./model/group-template";
|
|
18
19
|
/**
|
|
19
20
|
* Definition of a function to use as a beforeConnect interceptor.
|
|
20
21
|
* @param source The source vertex for the new edge
|
|
@@ -243,21 +244,29 @@ export interface ModelOptions {
|
|
|
243
244
|
* Optional model event mappings to bind
|
|
244
245
|
*/
|
|
245
246
|
events?: ModelEventsOptions;
|
|
247
|
+
/**
|
|
248
|
+
* Optional map of group templates to register on the model.
|
|
249
|
+
*/
|
|
250
|
+
groupTemplates?: Record<string, GroupTemplate>;
|
|
246
251
|
}
|
|
247
252
|
/**
|
|
248
253
|
* Definition of a model event callback.
|
|
254
|
+
* @group Events
|
|
255
|
+
* @category Model
|
|
249
256
|
*/
|
|
250
257
|
export type EventCallback<T = any> = (payload: T, evt?: any) => any;
|
|
251
258
|
/**
|
|
252
259
|
* Model event mappings - a record whose keys are valid {@link ModelEvent}s.
|
|
260
|
+
* @group Events
|
|
261
|
+
* @category Model
|
|
253
262
|
*/
|
|
254
263
|
export type ModelEventsOptions = {
|
|
255
264
|
[K in ModelEvent]?: EventCallback;
|
|
256
265
|
};
|
|
257
266
|
/**
|
|
258
267
|
* Options for data export.
|
|
259
|
-
* @group
|
|
260
|
-
* @category
|
|
268
|
+
* @group Input and Output
|
|
269
|
+
* @category Model
|
|
261
270
|
*/
|
|
262
271
|
export interface ExportOptions {
|
|
263
272
|
/**
|
|
@@ -271,8 +280,8 @@ export interface ExportOptions {
|
|
|
271
280
|
}
|
|
272
281
|
/**
|
|
273
282
|
* Options for a save via ajax.
|
|
274
|
-
* @group
|
|
275
|
-
* @category
|
|
283
|
+
* @group Input and Output
|
|
284
|
+
* @category Model
|
|
276
285
|
*/
|
|
277
286
|
export interface SaveOptions extends ExportOptions {
|
|
278
287
|
/**
|
|
@@ -314,6 +323,7 @@ export interface ConnectOptions {
|
|
|
314
323
|
}
|
|
315
324
|
/**
|
|
316
325
|
* Definition of a function that can act as a factory for model objects.
|
|
326
|
+
* @group Data Model
|
|
317
327
|
*/
|
|
318
328
|
export type ObjectFactory = (model: VisuallyJsModel, type: string, data: ObjectData, continueCallback: (o: ObjectData) => any, abortCallback: () => any, params?: any) => boolean;
|
|
319
329
|
/** @internal */
|
|
@@ -371,6 +381,7 @@ export type InternalModelEvent = typeof EVENT_INTERNAL_GROUP_SIZE_CHANGED | type
|
|
|
371
381
|
/**
|
|
372
382
|
* Names of events that can be fired by the VisuallyJsModel.
|
|
373
383
|
* @group Events
|
|
384
|
+
* @category Model
|
|
374
385
|
*/
|
|
375
386
|
export type ModelEvent = typeof EVENT_NODE_ADDED | typeof EVENT_DATA_UPDATED | typeof EVENT_GROUP_ADDED | typeof EVENT_GROUP_MEMBER_ADDED | typeof EVENT_GROUP_MEMBER_REMOVED | typeof EVENT_EDGE_REMOVED | typeof EVENT_EDGE_SOURCE_CHANGED | typeof EVENT_EDGE_TARGET_CHANGED | typeof EVENT_PORT_ADDED | typeof EVENT_NODE_REMOVED | typeof EVENT_GROUP_REMOVED | typeof EVENT_EDGE_ADDED | typeof EVENT_GRAPH_CLEARED | typeof EVENT_PORT_REMOVED | typeof EVENT_SELECT | typeof EVENT_SELECTION_CLEARED | typeof EVENT_NODE_UPDATED | typeof EVENT_GROUP_UPDATED | typeof EVENT_EDGE_UPDATED | typeof EVENT_EDGE_PATH_EDITED | typeof EVENT_GRAPH_CLEAR_START | typeof EVENT_NODE_TYPE_CHANGED | typeof EVENT_PORT_TYPE_CHANGED | typeof EVENT_GROUP_TYPE_CHANGED | typeof EVENT_EDGE_TYPE_CHANGED | typeof EVENT_PORT_UPDATED | typeof EVENT_DESELECT | typeof EVENT_DATA_LOAD_START | typeof EVENT_DATA_LOAD_END | typeof EVENT_UNDOREDO_UPDATE | typeof EVENT_UNDO | typeof EVENT_REDO | typeof EVENT_DATA_APPEND_START | typeof EVENT_DATA_APPEND_END;
|
|
376
387
|
/**
|
|
@@ -415,8 +426,9 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
|
|
|
415
426
|
beforeStartConnect: BeforeStartConnectInterceptor;
|
|
416
427
|
beforeDetach: BeforeDetachInterceptor;
|
|
417
428
|
beforeStartDetach: BeforeStartDetachInterceptor;
|
|
418
|
-
private
|
|
429
|
+
private _$_currentSelection;
|
|
419
430
|
private _$_renderersById;
|
|
431
|
+
private _groupTemplates;
|
|
420
432
|
constructor(params?: ModelOptions);
|
|
421
433
|
private _prepareDummyVertexPayload;
|
|
422
434
|
private _deriveVertex;
|
|
@@ -517,6 +529,12 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
|
|
|
517
529
|
* Returns all the Groups in the Graph.
|
|
518
530
|
*/
|
|
519
531
|
getGroups(): Array<Group>;
|
|
532
|
+
/**
|
|
533
|
+
* Registers a group template with the model.
|
|
534
|
+
* @param name Name of the template.
|
|
535
|
+
* @param template Template content, as a string.
|
|
536
|
+
*/
|
|
537
|
+
addGroupTemplate(name: string, template: GroupTemplate): void;
|
|
520
538
|
/**
|
|
521
539
|
* Gets a list of nodes/groups that are descendants of the given group.
|
|
522
540
|
* @param vertex
|
|
@@ -706,6 +724,7 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
|
|
|
706
724
|
*
|
|
707
725
|
*/
|
|
708
726
|
addFactoryGroup(type: string, data?: ObjectData, continueCallback?: Function, abortCallback?: Function, useTransaction?: boolean): void;
|
|
727
|
+
addFactoryGroupWithTemplate(type: string, templateId: string, data?: ObjectData, continueCallback?: Function, abortCallback?: Function, useTransaction?: boolean): void;
|
|
709
728
|
/**
|
|
710
729
|
* Adds a new Group.
|
|
711
730
|
* @param data Backing data for the Group.
|
|
@@ -722,6 +741,12 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
|
|
|
722
741
|
*
|
|
723
742
|
*/
|
|
724
743
|
addToGroup(node: Node | Group | string, group: Group | string, position?: PointXY): boolean;
|
|
744
|
+
/**
|
|
745
|
+
* Adds a group to the model using a GroupTemplate. This operation runs in a single transaction.
|
|
746
|
+
* @param data Data for the root group.
|
|
747
|
+
* @param template The template defining internal structure, OR the name of a registered template.
|
|
748
|
+
*/
|
|
749
|
+
addGroupWithTemplate(data: ObjectData, template: GroupTemplate | string): Group;
|
|
725
750
|
/**
|
|
726
751
|
* Adds a Node/Group to a Group. This is an internal method that is not part of the public API.
|
|
727
752
|
* @param node Node/group to add
|
|
@@ -1237,11 +1262,6 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
|
|
|
1237
1262
|
* @returns Either a Renderer that was registered against the given id, or null if none found.
|
|
1238
1263
|
*/
|
|
1239
1264
|
getRenderer<E>(id: string): VisuallyJsRenderer<E>;
|
|
1240
|
-
/**
|
|
1241
|
-
* Gets all renderers registered on this model
|
|
1242
|
-
* @internal
|
|
1243
|
-
*/
|
|
1244
|
-
getRenderers(): Map<string, VisuallyJsRenderer<any>>;
|
|
1245
1265
|
private _$_dispatchToRenderers;
|
|
1246
1266
|
/**
|
|
1247
1267
|
* Registers a renderer on this model instance. For internal use.
|
|
@@ -131,28 +131,6 @@ export declare class UndoRedoManager {
|
|
|
131
131
|
*
|
|
132
132
|
*/
|
|
133
133
|
commitTransaction(commitAll?: boolean): void;
|
|
134
|
-
/**
|
|
135
|
-
* Checks the last action in the stack to see if it was a compound action, and if so, pushes this
|
|
136
|
-
* action onto it. If it wasn't a compound action, a new compound action is created with the original stack head as its
|
|
137
|
-
* first action, and then this action is pushed into it. That new compound action then replaces the head of the stack.
|
|
138
|
-
* @param action
|
|
139
|
-
* @internal
|
|
140
|
-
*/
|
|
141
|
-
_attach(action: UndoRedoAction): void;
|
|
142
|
-
/**
|
|
143
|
-
* Run the given code the next time there is no transaction in progress - which might be right now, or it might be when a current
|
|
144
|
-
* transaction is committed.
|
|
145
|
-
* @param fn
|
|
146
|
-
* @private
|
|
147
|
-
* @internal
|
|
148
|
-
*/
|
|
149
|
-
_doWhenNoCurrentTransaction(fn: () => any): void;
|
|
150
|
-
/**
|
|
151
|
-
* Push a callback to the queue. Then maybe flush the queue, it depends if there is a current transaction
|
|
152
|
-
* @param fn
|
|
153
|
-
* @internal
|
|
154
|
-
*/
|
|
155
|
-
private __enqueueCallback;
|
|
156
134
|
/**
|
|
157
135
|
* If there's no current transaction, run all the functions in the __callbacks list, then empty it out. This method
|
|
158
136
|
* is invoked by __enqueueCallback and also by the commitTransaction method, but NOT by the rollback method. The
|
package/types/core/util.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const logEnabled: boolean;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function log(...args: string[]): void;
|
|
15
15
|
/**
|
|
16
|
-
* Defines an object that has a constructor. Used internally to create
|
|
16
|
+
* Defines an object that has a constructor. Used internally to create connectors/overlays from their names. Exposed as public for people to create their own connectors/overlays.
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export type Constructable<T> = {
|
|
@@ -576,6 +576,8 @@ export declare class PriorityQueue<T> {
|
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* Models the minimum and maximum values in an allowed zoom range. These value are expressed decimals: 0.5 means 50%, for instance.
|
|
579
|
+
* @group UI
|
|
580
|
+
* @category Definitions
|
|
579
581
|
*/
|
|
580
582
|
export type ZoomRange = [number, number];
|
|
581
583
|
/**
|
|
@@ -622,6 +624,7 @@ export interface Geometry {
|
|
|
622
624
|
}
|
|
623
625
|
/**
|
|
624
626
|
* Defines the current location that an anchor is placed at, for use in edge geometry objects.
|
|
627
|
+
* @group Edges
|
|
625
628
|
*/
|
|
626
629
|
export type AnchorPlacement = {
|
|
627
630
|
/**
|
|
@@ -4,7 +4,7 @@ import { FontSpec } from "../../browser-ui";
|
|
|
4
4
|
/**
|
|
5
5
|
* Base options for an overlay.
|
|
6
6
|
* @group Edges
|
|
7
|
-
* @category
|
|
7
|
+
* @category Overlays
|
|
8
8
|
*/
|
|
9
9
|
export interface OverlayOptions extends Record<string, any> {
|
|
10
10
|
/**
|
|
@@ -38,6 +38,7 @@ export interface OverlayOptions extends Record<string, any> {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Common options for subclasses of SimpleShapeOverlay
|
|
41
|
+
* @internal
|
|
41
42
|
*/
|
|
42
43
|
export interface SimpleShapeOverlayOptions extends OverlayOptions {
|
|
43
44
|
/**
|
|
@@ -69,6 +70,7 @@ export interface ArrowOverlayOptions extends SimpleShapeOverlayOptions {
|
|
|
69
70
|
foldback?: number;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
73
|
+
* Options for a label overlay
|
|
72
74
|
* @group Edges
|
|
73
75
|
* @category Overlays
|
|
74
76
|
*/
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ConnectorComputeParams, PaintGeometry } from "../core/connector/abstract-connector";
|
|
2
2
|
import { IOrthogonalConnector, OrthogonalSegment, SegmentMoveResult } from "./definitions";
|
|
3
3
|
import { PointXY, AnchorPlacement } from "../../core";
|
|
4
|
-
import { StraightConnector } from "../connector-straight/straight-connector";
|
|
5
4
|
import { Connection } from "../core";
|
|
6
5
|
/**
|
|
7
|
-
* Updates an orthogonal connector that has user path edits, if the source or target position for this connector has changed since
|
|
8
|
-
* it was last painted.
|
|
6
|
+
* Updates an orthogonal connector that has user path edits, if the source or target position for this connector has changed since it was last painted.
|
|
9
7
|
* @param sp
|
|
10
8
|
* @param tp
|
|
11
9
|
* @param oc
|
|
@@ -32,18 +30,3 @@ export declare function _trimOrthogonalSegments(segments: Array<OrthogonalSegmen
|
|
|
32
30
|
* @private
|
|
33
31
|
*/
|
|
34
32
|
export declare function _trimOrthogonalConnector(oc: IOrthogonalConnector): void;
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
* @private
|
|
38
|
-
* @param oc
|
|
39
|
-
* @param segments
|
|
40
|
-
* @param paintInfo
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* @internal
|
|
44
|
-
* @param oc
|
|
45
|
-
* @param idx
|
|
46
|
-
* @param orientation
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
export declare function _setOrthogonalAnchorOrientation(oc: IOrthogonalConnector | StraightConnector, idx: number, orientation: number[]): void;
|
|
@@ -104,12 +104,6 @@ export declare function aSegmentDirections(segment: OrthogonalSegment): {
|
|
|
104
104
|
[ORTHOGONAL_AXIS_HORIZONTAL]: number;
|
|
105
105
|
[ORTHOGONAL_AXIS_VERTICAL]: number;
|
|
106
106
|
};
|
|
107
|
-
/**
|
|
108
|
-
* @internal
|
|
109
|
-
* @private
|
|
110
|
-
* @param segment
|
|
111
|
-
*/
|
|
112
|
-
export declare function segmentDirections(segment: OrthogonalSegment): [number, number];
|
|
113
107
|
/**
|
|
114
108
|
* @internal
|
|
115
109
|
* @private
|
|
@@ -97,6 +97,8 @@ export interface StraightConnectorGeometry extends Geometry {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* A straight connector consists of a set of segments between 2 points. It may be constrained to be orthogonal, ie. that the segments are vertical or horizontal lines only. It also may be "smoothed", in which the segments are approximated by a series of Bézier curves.
|
|
100
|
+
* @group Edges
|
|
101
|
+
* @category Connectors
|
|
100
102
|
*/
|
|
101
103
|
export interface StraightConnector extends Connector {
|
|
102
104
|
smooth: boolean;
|
|
@@ -114,8 +116,3 @@ export interface StraightConnector extends Connector {
|
|
|
114
116
|
lastOrientation: number;
|
|
115
117
|
slightlyWonky: boolean;
|
|
116
118
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Straight connector.
|
|
119
|
-
* @group Edges
|
|
120
|
-
* @category Connectors
|
|
121
|
-
*/
|
|
@@ -2,7 +2,6 @@ import { CompiledTypeDescriptor } from '../type-descriptors';
|
|
|
2
2
|
import { UICore } from "../core";
|
|
3
3
|
import { PaintStyle } from "../../common";
|
|
4
4
|
import { Connection } from "../connector/connection-impl";
|
|
5
|
-
import { PointXY } from "../../../core";
|
|
6
5
|
export declare function isConnection(c: any): c is Connection<any>;
|
|
7
6
|
export declare const COMPONENT_TYPE_CONNECTION = "connection";
|
|
8
7
|
/**
|
|
@@ -37,7 +36,6 @@ export declare const REMOVE_CLASS_ACTION = "remove";
|
|
|
37
36
|
* @internal
|
|
38
37
|
*/
|
|
39
38
|
export type ClassAction = typeof ADD_CLASS_ACTION | typeof REMOVE_CLASS_ACTION;
|
|
40
|
-
export declare function getComponentXY<EL>(c: ComponentBase<EL>): PointXY;
|
|
41
39
|
/**
|
|
42
40
|
* Base class for components. Perhaps this will disappear over time.
|
|
43
41
|
* @internal
|
|
@@ -81,8 +79,7 @@ export declare const Components: {
|
|
|
81
79
|
* Removes a css class from the component
|
|
82
80
|
* @param c
|
|
83
81
|
* @param clazz Class to remove. May be a space separated list.
|
|
84
|
-
* @param cascade This is for subclasses to use, if they wish to.
|
|
85
|
-
* removal down to its endpoints.
|
|
82
|
+
* @param cascade This is for subclasses to use, if they wish to.
|
|
86
83
|
*
|
|
87
84
|
*/
|
|
88
85
|
removeClass<EL>(c: ComponentBase<EL>, clazz: string, cascade?: boolean): void;
|
|
@@ -29,35 +29,18 @@ export declare function $getOverlay<T extends Overlay<EL>, EL>(c: Connection<EL>
|
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
31
|
export declare function $getOverlays<EL>(c: Connection<EL>): Record<string, Overlay<EL>>;
|
|
32
|
-
/**
|
|
33
|
-
* Hide the overlay with the given id.
|
|
34
|
-
* @param id
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
export declare function $hideOverlay<EL>(c: Connection<EL>, id: string): void;
|
|
38
32
|
/**
|
|
39
33
|
* Hide all overlays, or a specific set of overlays.
|
|
40
34
|
* @param ids optional list of ids to hide.
|
|
41
35
|
* @internal
|
|
42
36
|
*/
|
|
43
37
|
export declare function _hideOverlays<EL>(c: Connection<EL>, ...ids: Array<string>): void;
|
|
44
|
-
/**
|
|
45
|
-
* Show a specific overlay (set it to be visible)
|
|
46
|
-
* @param id
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
export declare function _showOverlay<E>(c: Connection<E>, id: string): void;
|
|
50
38
|
/**
|
|
51
39
|
* Show all overlays, or a specific set of overlays.
|
|
52
40
|
* @param ids optional list of ids to show.
|
|
53
41
|
* @internal
|
|
54
42
|
*/
|
|
55
43
|
export declare function _showOverlays<E>(c: Connection<E>, ...ids: Array<string>): void;
|
|
56
|
-
/**
|
|
57
|
-
* Remove all overlays from this component.
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
export declare function _removeAllOverlays<E>(c: Connection<E>): void;
|
|
61
44
|
/**
|
|
62
45
|
* Remove the overlay with the given id.
|
|
63
46
|
* @param overlayId
|
|
@@ -65,22 +48,10 @@ export declare function _removeAllOverlays<E>(c: Connection<E>): void;
|
|
|
65
48
|
* @internal
|
|
66
49
|
*/
|
|
67
50
|
export declare function _removeOverlay<E>(c: Connection<E>, overlayId: string, dontCleanup?: boolean): void;
|
|
68
|
-
/**
|
|
69
|
-
* Remove the given set of overlays, specified by their ids.
|
|
70
|
-
* @param overlays
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
73
|
-
export declare function _removeOverlays<E>(c: Connection<E>, ...overlays: string[]): void;
|
|
74
51
|
/**
|
|
75
52
|
* @internal
|
|
76
53
|
*/
|
|
77
54
|
export declare function _getLabelOverlay<EL>(c: Connection<EL>): LabelOverlay<EL>;
|
|
78
|
-
/**
|
|
79
|
-
* Set this component's label.
|
|
80
|
-
* @param l Either some text, or a function which returns some text, or an existing label overlay.
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
export declare function _setConnectionLabel<EL>(c: Connection<EL>, l: string | Function | LabelOverlay<EL>): void;
|
|
84
55
|
export declare const ACTION_ADD = "add";
|
|
85
56
|
export declare const ACTION_REMOVE = "remove";
|
|
86
57
|
/**
|