@visuallyjs/browser-ui 1.2.6 → 1.2.7
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/css/visuallyjs.css +16 -12
- package/js/visuallyjs.browser-ui.cjs.js +60 -60
- package/js/visuallyjs.browser-ui.esm.js +63 -63
- package/package.json +1 -1
- package/types/browser-ui/browser-visuallyjs-instance.d.ts +1 -3
- package/types/browser-ui/components/edge-type-picker/edge-type-picker.d.ts +6 -2
- package/types/browser-ui/components/inspector/inspector.d.ts +9 -1
- package/types/browser-ui/components/palette/auto-edge-connect.d.ts +1 -1
- package/types/browser-ui/components/palette/palette-options.d.ts +11 -11
- package/types/browser-ui/components/palette/palette.d.ts +2 -2
- package/types/browser-ui/definitions.d.ts +10 -45
- package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +28 -0
- package/types/browser-ui/shape-library/shape-library-definitions.d.ts +21 -4
- package/types/browser-ui/shape-library/shape-library.d.ts +1 -1
- package/types/browser-ui/surface-renderer/definitions.d.ts +7 -1
- package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +36 -3
- package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +1 -2
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +64 -0
- package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +2 -2
- package/types/browser-ui/surface-renderer/shape-palette.d.ts +2 -2
- package/types/browser-ui/surface-renderer/surface.d.ts +3 -4
- package/types/browser-ui/svg-element-overlay.d.ts +3 -3
- package/types/charts/base-chart.d.ts +2 -1
- package/types/charts/definitions.d.ts +1 -1
- package/types/charts/dual-value-chart.d.ts +2 -1
- package/types/charts/legend.d.ts +1 -1
- package/types/charts/pie/pie-chart.d.ts +2 -1
- package/types/charts/sankey/sankey.d.ts +2 -1
- package/types/charts/tooltip.d.ts +2 -1
- package/types/charts/util.d.ts +2 -1
- package/types/test-support/test-support.d.ts +3 -3
- package/types/ui/common/overlay.d.ts +6 -2
- package/types/ui/common/paint-style.d.ts +7 -0
- package/types/ui/core/core.d.ts +32 -1
- package/types/ui/core/definitions.d.ts +49 -0
- package/types/ui/core/overlay/custom-overlay.d.ts +2 -2
- package/types/ui/core/overlay/label-overlay.d.ts +6 -5
- package/types/ui/core/overlay/overlay.d.ts +3 -3
- package/types/ui/core/params.d.ts +5 -0
- package/types/ui/core/view/edge-options.d.ts +44 -2
- package/types/ui/property-mappings/definitions.d.ts +4 -0
- package/types/version.d.ts +1 -1
package/package.json
CHANGED
|
@@ -13,10 +13,8 @@ import { BrowserUIClipboard } from "./copy-paste";
|
|
|
13
13
|
*/
|
|
14
14
|
export type BrowserUIEvent = typeof EVENT_EDGE_MOUSEUP | typeof EVENT_EDGE_MOUSEDOWN | typeof EVENT_VERTEX_CLICK | typeof EVENT_VERTEX_DBLCLICK | typeof EVENT_EDGE_CONTEXTMENU | typeof EVENT_EDGE_CLICK | typeof EVENT_EDGE_DBLCLICK | typeof EVENT_VERTEX_DBLTAP | typeof EVENT_VERTEX_TAP | typeof EVENT_VERTEX_MOUSEOVER | typeof EVENT_VERTEX_MOUSEOUT | typeof EVENT_VERTEX_MOUSEMOVE | typeof EVENT_VERTEX_MOUSEDOWN | typeof EVENT_VERTEX_MOUSEUP | typeof EVENT_VERTEX_CONTEXTMENU | typeof EVENT_VERTEX_MOUSEOVER | typeof EVENT_EDGE_MOUSEOVER | typeof EVENT_EDGE_MOUSEOUT | typeof EVENT_GROUP_MOVE | typeof EVENT_EDGE_DRAG_START | typeof EVENT_EDGE_DRAG | typeof EVENT_EDGE_DRAG_END | typeof EVENT_EDGE_DRAG_ABORT;
|
|
15
15
|
/**
|
|
16
|
-
* Subclass of UICore that renders to the DOM in a browser, and supports dragging of elements/connections.
|
|
16
|
+
* Subclass of UICore that renders to the DOM in a browser, and supports dragging of elements/connections. This class is abstract and is not something users of the API will instantiate.
|
|
17
17
|
* @group Components
|
|
18
|
-
* @internal
|
|
19
|
-
*
|
|
20
18
|
*/
|
|
21
19
|
export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement, EVT | BrowserUIEvent> {
|
|
22
20
|
protected $suspendRendering: boolean;
|
|
@@ -14,8 +14,7 @@ export declare const CLASS_EDGE_TYPE_PICKER = "vjs-edge-type-picker";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const CLASS_EDGE_TYPE_PICKER_SELECTED = "vjs-edge-type-picker-selected";
|
|
16
16
|
/**
|
|
17
|
-
* Helper class that renders a set of edge styles to the DOM and offers a callback method for when one is selected
|
|
18
|
-
* via a mouse click.
|
|
17
|
+
* Helper class that renders a set of edge styles to the DOM and offers a callback method for when one is selected via a mouse click.
|
|
19
18
|
* @group Components
|
|
20
19
|
* @category Edge Type Picker
|
|
21
20
|
*/
|
|
@@ -34,4 +33,9 @@ export declare class EdgeTypePicker {
|
|
|
34
33
|
* @param value
|
|
35
34
|
*/
|
|
36
35
|
select(property: string, value: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clears the visible selection state
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
reset(): void;
|
|
37
41
|
}
|
|
@@ -35,6 +35,14 @@ export declare const CLASS_INSPECTOR = "vjs-inspector";
|
|
|
35
35
|
* @context inspector
|
|
36
36
|
*/
|
|
37
37
|
export declare const CLASS_INSPECTOR_CLOSE = "vjs-inspector-close";
|
|
38
|
+
/**
|
|
39
|
+
* Assigned to sections drawn inside an inspector by certain helper inspector components
|
|
40
|
+
* @group Components
|
|
41
|
+
* @category Inspector
|
|
42
|
+
* @cssClass
|
|
43
|
+
* @context inspector
|
|
44
|
+
*/
|
|
45
|
+
export declare const CLASS_INSPECTOR_SECTION = "vjs-inspector-section";
|
|
38
46
|
/**
|
|
39
47
|
* Fired by an Inspector when its contents have changed.
|
|
40
48
|
* @group Components
|
|
@@ -107,7 +115,7 @@ export declare class Inspector extends VjsContext {
|
|
|
107
115
|
* @param value
|
|
108
116
|
*
|
|
109
117
|
*/
|
|
110
|
-
setValue(key: string, value: any, portId: string, repaintAfterwards?: boolean): void;
|
|
118
|
+
setValue(key: string, value: any, portId: string | null, repaintAfterwards?: boolean): void;
|
|
111
119
|
/**
|
|
112
120
|
* @internal
|
|
113
121
|
* @param b
|
|
@@ -41,7 +41,7 @@ export declare class AutoEdgeConnectManager {
|
|
|
41
41
|
private _transientEdges;
|
|
42
42
|
private _keyListener;
|
|
43
43
|
private _getSourceTargetElements;
|
|
44
|
-
constructor(ui: UICore<any>, palette: Palette
|
|
44
|
+
constructor(ui: UICore<any>, palette: Palette, activeClass: string, mode: "eager" | "onDemand", lineStyle: LineStyle, key: string);
|
|
45
45
|
private _clearProximityState;
|
|
46
46
|
private _toggleCssClasses;
|
|
47
47
|
private _setStatus;
|
|
@@ -6,7 +6,7 @@ export declare const PALETTE_MODE_DRAG = "drag";
|
|
|
6
6
|
export declare const PALETTE_MODE_TAP = "tap";
|
|
7
7
|
export declare const PALETTE_MODE_DRAW = "draw";
|
|
8
8
|
export type PaletteMode = typeof PALETTE_MODE_TAP | typeof PALETTE_MODE_DRAG | typeof PALETTE_MODE_DRAW;
|
|
9
|
-
export type CanDropOnEdgeFilter
|
|
9
|
+
export type CanDropOnEdgeFilter = (d: ObjectData) => boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Defines the source/target port ids to use on a vertex dropped on an edge.
|
|
12
12
|
* @group Components
|
|
@@ -23,7 +23,7 @@ export type EdgeDropInfo = {
|
|
|
23
23
|
* @group Components
|
|
24
24
|
* @category Palette
|
|
25
25
|
*/
|
|
26
|
-
export interface PaletteOptions
|
|
26
|
+
export interface PaletteOptions {
|
|
27
27
|
/**
|
|
28
28
|
* The element containing things that will be dragged/tapped.
|
|
29
29
|
*/
|
|
@@ -35,23 +35,23 @@ export interface PaletteOptions<T> {
|
|
|
35
35
|
/**
|
|
36
36
|
* Optional function to generate the size to use for some object that is being dragged.
|
|
37
37
|
*/
|
|
38
|
-
dragSizeGenerator?: (payload:
|
|
38
|
+
dragSizeGenerator?: (payload: ObjectData, el: BrowserElement) => Size;
|
|
39
39
|
/**
|
|
40
40
|
* Optional function to generate an initial payload from an element that has started to be dragged/has been tapped.
|
|
41
41
|
*/
|
|
42
|
-
dataGenerator?: DataGeneratorFunction
|
|
42
|
+
dataGenerator?: DataGeneratorFunction;
|
|
43
43
|
/**
|
|
44
44
|
* Optional function to determine the type of the data object from an element that is being dragged (in drag mode) or has been tapped (in draw/tap mode)
|
|
45
45
|
*/
|
|
46
|
-
typeGenerator?: TypeGeneratorFunction
|
|
46
|
+
typeGenerator?: TypeGeneratorFunction;
|
|
47
47
|
/**
|
|
48
48
|
* Optional function to use to determine if the element being dragged/has been tapped represents a group. If you do not provide this, the default behaviour is to check for the presence of a `data-vjs-is-group` attribute on the element, with a value of `true`.
|
|
49
49
|
*/
|
|
50
|
-
groupIdentifier?: GroupIdentifierFunction
|
|
50
|
+
groupIdentifier?: GroupIdentifierFunction;
|
|
51
51
|
/**
|
|
52
52
|
* Defaults to false. Allows items to be dropped onto edges in the canvas. A drop on an edge causes that edge to be split, with one edge having the new vertex as a target, and another edge with the new vertex as source.
|
|
53
53
|
*/
|
|
54
|
-
allowDropOnEdge?: boolean | CanDropOnEdgeFilter
|
|
54
|
+
allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
|
|
55
55
|
/**
|
|
56
56
|
* If `allowDropOnEdge` is true, this function can be provided, to customise the behaviour of the drop. By default, the new vertex is used as the target of the original edge and the source of the new edge. But you might want to connect to ports on the new vertex, and this method allows you to do that: you can return the ID of a port to use for the existing edge's target, a port ID to use for the new edge's source, a source anchor or a target anchor.
|
|
57
57
|
* @param newVertex The newly dropped vertex
|
|
@@ -106,7 +106,7 @@ export interface PaletteOptions<T> {
|
|
|
106
106
|
/**
|
|
107
107
|
* Optional function that you can use to inform the Palette that drop should be aborted. This method is invoked at the start of a drag (in drag mode) or when an item is tapped (in tap/draw mode) and is passed the candidate drag object's data.
|
|
108
108
|
*/
|
|
109
|
-
canvasDropFilter?: CanvasDropFilter
|
|
109
|
+
canvasDropFilter?: CanvasDropFilter;
|
|
110
110
|
/**
|
|
111
111
|
* Mode to operate in - 'drag', 'tap' or 'draw'. Defaults to 'drag'.
|
|
112
112
|
*/
|
|
@@ -127,7 +127,7 @@ export interface PaletteOptions<T> {
|
|
|
127
127
|
* @param p Location on the canvas where the mousedown event occurred.
|
|
128
128
|
* @param e Mouse down event
|
|
129
129
|
*/
|
|
130
|
-
vertexPreviewGenerator?: (objectType: string, type: string, data:
|
|
130
|
+
vertexPreviewGenerator?: (objectType: string, type: string, data: ObjectData, p: PointXY, e: MouseEvent) => BrowserElement;
|
|
131
131
|
/**
|
|
132
132
|
* When in draw mode this function is repeatedly called as the mouse is dragging a new shape. It provides a hook for you to update the element's appearance. This is only called if you provided a vertexPreviewGenerator and it has returned a valid DOM element at the start of a drag.
|
|
133
133
|
* @param el The element you returned from vertexPreviewGenerator.
|
|
@@ -135,7 +135,7 @@ export interface PaletteOptions<T> {
|
|
|
135
135
|
* @param size The current size of the new vertex.
|
|
136
136
|
* @param data The return value from the dataGenerator
|
|
137
137
|
*/
|
|
138
|
-
vertexPreviewUpdater?: (el: BrowserElement, origin: PointXY, size: Size, data:
|
|
138
|
+
vertexPreviewUpdater?: (el: BrowserElement, origin: PointXY, size: Size, data: ObjectData) => any;
|
|
139
139
|
/**
|
|
140
140
|
* When in 'draw' mode, you can optionally provide a class to set on the lasso used by the vertex drawing plugin.
|
|
141
141
|
*/
|
|
@@ -175,7 +175,7 @@ export interface PaletteOptions<T> {
|
|
|
175
175
|
/**
|
|
176
176
|
* Optional function to invoke as the user is dragging a new element, or has tapped an element and is moving the mouse over the canvas.
|
|
177
177
|
*/
|
|
178
|
-
onDrag?: DragFunction
|
|
178
|
+
onDrag?: DragFunction;
|
|
179
179
|
/**
|
|
180
180
|
* Optional template that will be used in conjunction with `data` to generate the HTML content of the palette. The template can return any number of elements (ie. you're not limited to just a single root node)
|
|
181
181
|
*/
|
|
@@ -9,7 +9,7 @@ import { BrowserUI } from "../../browser-visuallyjs-instance";
|
|
|
9
9
|
* @group Components
|
|
10
10
|
* @category Palette
|
|
11
11
|
*/
|
|
12
|
-
export declare class Palette
|
|
12
|
+
export declare class Palette {
|
|
13
13
|
private readonly ui;
|
|
14
14
|
private readonly _$_mode;
|
|
15
15
|
readonly source: BrowserElement;
|
|
@@ -96,7 +96,7 @@ export declare class Palette<T> {
|
|
|
96
96
|
private _rotationSpeed;
|
|
97
97
|
private readonly _autoEdgeConnect;
|
|
98
98
|
private _autoEdgeConnectManager;
|
|
99
|
-
constructor(ui: BrowserUI, options: PaletteOptions
|
|
99
|
+
constructor(ui: BrowserUI, options: PaletteOptions);
|
|
100
100
|
/**
|
|
101
101
|
* Sets the enabled state of the palette
|
|
102
102
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BrowserElement } from "./util";
|
|
2
2
|
import { BoundingBox, Edge, Group, Node, ObjectData, Port, Vertex, VisuallyJsModel, VisuallyJsSelection } from "../core";
|
|
3
3
|
import { PointXY, Size } from "../core";
|
|
4
|
-
import { UICoreDefaults, UICoreOptions, UIEdgeOptions, DragOptions, Overlay, Connection, EdgePropertyMappings, AlignContentOptions } from "../ui";
|
|
4
|
+
import { UICoreDefaults, UICoreOptions, UIEdgeOptions, DragOptions, Overlay, Connection, EdgePropertyMappings, AlignContentOptions, FontSpec } from "../ui";
|
|
5
5
|
import { EdgeInputMethod } from "./edge-handler-base";
|
|
6
6
|
import { LabelBackgroundOptions, LabelPosition, ShapeLibrary, ShapeSet } from "./shape-library/shape-library-definitions";
|
|
7
7
|
import { VisuallyJSDOMElement } from "./element-facade";
|
|
@@ -13,58 +13,58 @@ import { ConnectorEditorActivateParams } from "./connector-editor";
|
|
|
13
13
|
* @group Components
|
|
14
14
|
* @category Palette
|
|
15
15
|
*/
|
|
16
|
-
export type CanvasDropFilter
|
|
16
|
+
export type CanvasDropFilter = (data: ObjectData) => boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Defines a function used to filter drop on an edge.
|
|
19
19
|
* @group Components
|
|
20
20
|
* @category Palette
|
|
21
21
|
*/
|
|
22
|
-
export type
|
|
22
|
+
export type EdgeDropFilterObjectData = (data: ObjectData, target: Edge) => boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Defines the callback function invoked when an item is being dragged.
|
|
25
25
|
* @group Components
|
|
26
26
|
* @category Palette
|
|
27
27
|
*/
|
|
28
|
-
export type DragFunction
|
|
28
|
+
export type DragFunction = (data: ObjectData, el: BrowserElement, e: Event) => any;
|
|
29
29
|
/**
|
|
30
30
|
* Defines the function invoked when an item is dropped onto an existing vertex.
|
|
31
31
|
* @group Components
|
|
32
32
|
* @category Palette
|
|
33
33
|
*/
|
|
34
|
-
export type DropFunction
|
|
34
|
+
export type DropFunction = (data: ObjectData, target: Node | Group, draggedElement?: BrowserElement, e?: Event, position?: PointXY, canvasLocation?: PointXY, targetLocation?: PointXY, locationOnTarget?: PointXY) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Defines the function invoked when an item is dropped on an edge.
|
|
37
37
|
* @group Components
|
|
38
38
|
* @category Palette
|
|
39
39
|
*/
|
|
40
|
-
export type EdgeDropFunction
|
|
40
|
+
export type EdgeDropFunction = (data: ObjectData, target: Edge, draggedElement?: BrowserElement, e?: Event, position?: PointXY, canvasLocation?: PointXY) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Defines the function invoked when an item is dropped onto whitespace in the canvas.
|
|
43
43
|
* @group Components
|
|
44
44
|
* @category Palette
|
|
45
45
|
*/
|
|
46
|
-
export type CanvasDropFunction
|
|
46
|
+
export type CanvasDropFunction = (data: ObjectData, canvasPosition: PointXY, draggedElement?: BrowserElement, e?: Event, position?: PointXY, elementSize?: Size) => void;
|
|
47
47
|
/**
|
|
48
48
|
* Defines the function that is invoked to gather a dataset to associate with an item that is being dragged.
|
|
49
49
|
* @group Components
|
|
50
50
|
* @category Palette
|
|
51
51
|
* @typeParam T Defines the type of the object that will be created.
|
|
52
52
|
*/
|
|
53
|
-
export type DataGeneratorFunction
|
|
53
|
+
export type DataGeneratorFunction = (el: BrowserElement) => ObjectData;
|
|
54
54
|
/**
|
|
55
55
|
* Defines the function invoked to determine the type of some item that is about to be dragged.
|
|
56
56
|
* @group Components
|
|
57
57
|
* @category Palette
|
|
58
58
|
* @typeParam T Defines the kind of the object from which to extract the type id.
|
|
59
59
|
*/
|
|
60
|
-
export type TypeGeneratorFunction
|
|
60
|
+
export type TypeGeneratorFunction = (d: ObjectData) => string;
|
|
61
61
|
/**
|
|
62
62
|
* Defines the function that is invoked to determine whether an item that is about to be dragged represents a group.
|
|
63
63
|
* @group Components
|
|
64
64
|
* @category Palette
|
|
65
65
|
* @typeParam T Defines the kind of the associated data object.
|
|
66
66
|
*/
|
|
67
|
-
export type GroupIdentifierFunction
|
|
67
|
+
export type GroupIdentifierFunction = (d: ObjectData, el: BrowserElement) => boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Defines the method signature for the `onVertexAdded` callback.
|
|
70
70
|
* @group Components
|
|
@@ -366,41 +366,6 @@ export interface Background {
|
|
|
366
366
|
export interface ImageBackground extends Background {
|
|
367
367
|
setUrl(url: string): void;
|
|
368
368
|
}
|
|
369
|
-
/**
|
|
370
|
-
* Style for a font - oblique, italic or normal.
|
|
371
|
-
* @group UI
|
|
372
|
-
* @category Definitions
|
|
373
|
-
*/
|
|
374
|
-
export type FontStyle = "normal" | "oblique" | "italic";
|
|
375
|
-
/**
|
|
376
|
-
* Font weight to use (e.g., "normal", "bold", "100", "300").
|
|
377
|
-
* @group UI
|
|
378
|
-
* @category Definitions
|
|
379
|
-
*/
|
|
380
|
-
export type FontWeight = string | number;
|
|
381
|
-
/**
|
|
382
|
-
* Specs for a font. The default values depend on the context.
|
|
383
|
-
* @group UI
|
|
384
|
-
* @category Definitions
|
|
385
|
-
*/
|
|
386
|
-
export interface FontSpec {
|
|
387
|
-
/**
|
|
388
|
-
* Size of the font. Default value depends on the context this spec occurs in.
|
|
389
|
-
*/
|
|
390
|
-
size?: number;
|
|
391
|
-
/**
|
|
392
|
-
* Font style to use. Default value depends on the context this spec occurs in.
|
|
393
|
-
*/
|
|
394
|
-
style?: FontStyle;
|
|
395
|
-
/**
|
|
396
|
-
* Font weight to use (e.g., "normal", "bold", "100", "300"). Defaults to null, which browsers treat as "normal".
|
|
397
|
-
*/
|
|
398
|
-
weight?: FontWeight;
|
|
399
|
-
/**
|
|
400
|
-
* Font family to use.
|
|
401
|
-
*/
|
|
402
|
-
family?: string;
|
|
403
|
-
}
|
|
404
369
|
/**
|
|
405
370
|
* @internal
|
|
406
371
|
* @param o
|
|
@@ -3,11 +3,36 @@ export declare const DEFAULT_FLOWCHART_ARROW_WIDTH = 15;
|
|
|
3
3
|
export declare const DEFAULT_FLOWCHART_ARROW_LENGTH = 10;
|
|
4
4
|
export declare const DEFAULT_FLOWCHART_PROPERTY_MARKERS = "markers";
|
|
5
5
|
export declare const DEFAULT_FLOWCHART_PROPERTY_LINE_STYLE = "lineStyle";
|
|
6
|
+
export declare const DEFAULT_FLOWCHART_PROPERTY_THICKNESS = "thickness";
|
|
6
7
|
export declare const FLOWCHART_EDGE_TYPE_SOURCE_ARROW = "sourceArrow";
|
|
7
8
|
export declare const FLOWCHART_EDGE_TYPE_TARGET_ARROW = "targetArrow";
|
|
8
9
|
export declare const FLOWCHART_EDGE_TYPE_BOTH_ARROWS = "bothArrows";
|
|
9
10
|
export declare const FLOWCHART_EDGE_TYPE_PLAIN = "plain";
|
|
10
11
|
export declare const FLOWCHART_EDGE_TYPE_DASHED = "dashed";
|
|
12
|
+
/**
|
|
13
|
+
* Config for line thickness option in flowchart edge mappings.
|
|
14
|
+
*/
|
|
15
|
+
export type LineThicknessMappingsConfig = {
|
|
16
|
+
/**
|
|
17
|
+
* Whether or not to enable the 'thickness' property mapping. Defaults to false, for backwards compatibility reasons, will likely default to true in v2.
|
|
18
|
+
*/
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Defaults to "thickness"
|
|
22
|
+
*/
|
|
23
|
+
propertyName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Defaults to "Line Thickness" - a name for the mapping that can be used in an inspector.
|
|
26
|
+
*/
|
|
27
|
+
mappingName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* List of thicknesses to support, and their keys. Defaults to [1:thin, 3:medium, 5:thick]
|
|
30
|
+
*/
|
|
31
|
+
values?: Array<{
|
|
32
|
+
key: string;
|
|
33
|
+
value: number;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
11
36
|
/**
|
|
12
37
|
* Basic edge mappings for flowcharts - a 'dashed' or 'plain' line style, and source/target/both/none arrow markers, with a configurable width/height
|
|
13
38
|
* @param options
|
|
@@ -20,4 +45,7 @@ export declare function FlowchartBasicEdgeMappings(options?: {
|
|
|
20
45
|
markersProperty?: string;
|
|
21
46
|
arrowWidth?: number;
|
|
22
47
|
arrowLength?: number;
|
|
48
|
+
lineStyleMappingName?: string;
|
|
49
|
+
markersMappingName?: string;
|
|
50
|
+
lineThickness?: boolean | LineThicknessMappingsConfig;
|
|
23
51
|
}): EdgePropertyMappings;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Size, Group, Node, ObjectData, AbstractEntry, CustomTagOptions, PointXY } from "../../core";
|
|
2
2
|
import { BrowserElement } from "../util";
|
|
3
3
|
import { IconDefinition } from "../icons";
|
|
4
|
-
import { FontSpec } from "../definitions";
|
|
5
4
|
import { GroupTemplate } from "../../core/model/group-template";
|
|
5
|
+
import { FontSpec } from "../../ui";
|
|
6
6
|
/**
|
|
7
7
|
* Default fill/stroke/text color for items in ShapeLibrary.
|
|
8
8
|
* @internal
|
|
@@ -243,7 +243,16 @@ export declare const CLASS_SHAPE = "vjs-shape";
|
|
|
243
243
|
* @group Diagrams
|
|
244
244
|
* @category Shapes
|
|
245
245
|
*/
|
|
246
|
-
export type ShapePropertyType = "string" | "number" | "boolean" | "color" | "font";
|
|
246
|
+
export type ShapePropertyType = "string" | "number" | "boolean" | "color" | "font" | "text";
|
|
247
|
+
/**
|
|
248
|
+
* Definition of a value in a shape property's list of allowed values.
|
|
249
|
+
* @group Diagrams
|
|
250
|
+
* @category Shapes
|
|
251
|
+
*/
|
|
252
|
+
export type ShapePropertyValueDefinition = {
|
|
253
|
+
label: string;
|
|
254
|
+
value: any;
|
|
255
|
+
};
|
|
247
256
|
/**
|
|
248
257
|
* Defines a single configurable property exposed by a shape.
|
|
249
258
|
* @group Diagrams
|
|
@@ -259,7 +268,7 @@ export interface ShapePropertyDefinition {
|
|
|
259
268
|
*/
|
|
260
269
|
label: string;
|
|
261
270
|
/**
|
|
262
|
-
* The data type of the property, telling the inspector which UI control to render.
|
|
271
|
+
* The data type of the property, telling the inspector which UI control to render by default. For properties that include a `values` array (and also properties of type boolean) you can override the choice of UI control via the `editor` option.
|
|
263
272
|
*/
|
|
264
273
|
type: ShapePropertyType;
|
|
265
274
|
/**
|
|
@@ -281,7 +290,15 @@ export interface ShapePropertyDefinition {
|
|
|
281
290
|
/**
|
|
282
291
|
* Optional set of values to pick current value from
|
|
283
292
|
*/
|
|
284
|
-
values?: Array<
|
|
293
|
+
values?: Array<string | ShapePropertyValueDefinition>;
|
|
294
|
+
/**
|
|
295
|
+
* Specifies the type of UI input to use to manage the property. Only used if you have supplied `values`, or if the property type is "boolean" (since in that case the property's values are implicitly a list, containing true and false values).
|
|
296
|
+
*/
|
|
297
|
+
editor?: null | "radio" | "select";
|
|
298
|
+
/**
|
|
299
|
+
* Specifies the labels to use for this property if it is a boolean and you've specified you want a 'radio' or 'select' editor. You could use this, for example, to show "On/Off" or "Yes/No" labels in the UI, rather than "True/False".
|
|
300
|
+
*/
|
|
301
|
+
booleanLabels?: [string, string];
|
|
285
302
|
}
|
|
286
303
|
export type LabelPosition = "top" | "bottom" | "center";
|
|
287
304
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RenderedShapeSet, ShapeGeneratorFunction, ShapeLibrary, ShapeSet, LabelPosition, RealisedShapeType, LabelBackgroundOptions } from "./shape-library-definitions";
|
|
2
|
+
import { FontSpec } from "../../ui";
|
|
2
3
|
import { BrowserElement } from "../util";
|
|
3
4
|
import { CustomTagOptions, Recado, AbstractEntry, ObjectData } from "../../core";
|
|
4
5
|
import { IconDefinition } from "../icons";
|
|
5
|
-
import { FontSpec } from "../definitions";
|
|
6
6
|
export declare const ATTRIBUTE_ORIGIN = "origin";
|
|
7
7
|
export declare const ATTRIBUTE_ORIGIN_X = "originX";
|
|
8
8
|
export declare const ATTRIBUTE_ORIGIN_Y = "originY";
|
|
@@ -84,11 +84,17 @@ export interface SurfaceVertexCloneOptions extends VertexCloneOptions {
|
|
|
84
84
|
flash?: boolean;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
|
-
* Definition of the payload returned from the Surface's
|
|
87
|
+
* Definition of the payload returned from the Surface's `save` method.
|
|
88
88
|
* @group Components
|
|
89
89
|
* @category Input and Output
|
|
90
90
|
*/
|
|
91
91
|
export interface SurfaceSaveData extends UISaveData {
|
|
92
|
+
/**
|
|
93
|
+
* The current pan position of the surface canvas
|
|
94
|
+
*/
|
|
92
95
|
pan: PointXY;
|
|
96
|
+
/**
|
|
97
|
+
* The current position of the surface's transform origin.
|
|
98
|
+
*/
|
|
93
99
|
transformOrigin: PointXY;
|
|
94
100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LabelBackgroundOptions, LabelPosition, ShapeSet } from "../../shape-library";
|
|
2
2
|
import { Group, ObjectData, PointXY, Size, Vertex, Node, BeforeConnectInterceptor } from "../../../core";
|
|
3
3
|
import { DiagramCell } from "./diagram-cell";
|
|
4
|
-
import { GridOptions, UIExportOptions, UICoreDefaults, EdgeEventOptions, OverlaySpec, ConnectorSpec, NodeEventOptions, GroupMapping, NodeMapping, AnchorSpec, EdgePropertyMappings, MagnetizeOptions, PaintStyle, OverlayVisibility, EdgeDeleteConfirmationFunction } from "../../../ui";
|
|
4
|
+
import { GridOptions, UIExportOptions, UICoreDefaults, EdgeEventOptions, OverlaySpec, ConnectorSpec, NodeEventOptions, GroupMapping, NodeMapping, AnchorSpec, EdgePropertyMappings, MagnetizeOptions, PaintStyle, OverlayVisibility, EdgeDeleteConfirmationFunction, LabelBackgroundStyle, FontSpec } from "../../../ui";
|
|
5
5
|
import { SurfaceSaveData } from "../definitions";
|
|
6
6
|
import { BrowserElement } from "../../util";
|
|
7
7
|
import { PaletteMode, AutoEdgeConnectOptions, CanDropOnEdgeFilter } from "../../components/palette/palette-options";
|
|
@@ -9,7 +9,7 @@ import { PanOptions, WheelOptions, ZoomOptions } from "../../pan-zoom-options";
|
|
|
9
9
|
import { MiniviewPluginOptions, LassoPluginOptions, ResizingToolsModelUpdater, ResizingToolsHandlerFactory, DragGroupsPluginOptions, ResizingToolsResizeMethod, SnaplinesPluginOptions, PanButtonsPluginOptions, LineCrossingsPluginOptions } from "../plugins";
|
|
10
10
|
import { EdgeSnapOptions, EdgeInputMethod } from "../../edge-handler-base";
|
|
11
11
|
import { DiagramActionMediator } from "./mediator";
|
|
12
|
-
import { OnVertexAddedCallback
|
|
12
|
+
import { OnVertexAddedCallback } from "../../definitions";
|
|
13
13
|
import { PreparedShape } from "../shape-palette-options";
|
|
14
14
|
/**
|
|
15
15
|
* Options for the {@link Diagram.addLink method}
|
|
@@ -172,6 +172,10 @@ export interface DiagramOptions {
|
|
|
172
172
|
* Optional font for edge labels.
|
|
173
173
|
*/
|
|
174
174
|
labelFont?: FontSpec;
|
|
175
|
+
/**
|
|
176
|
+
* Optional style for the label's background.
|
|
177
|
+
*/
|
|
178
|
+
labelBackgroundStyle?: LabelBackgroundStyle;
|
|
175
179
|
/**
|
|
176
180
|
* Optional map of event handlers for edges.
|
|
177
181
|
*/
|
|
@@ -192,6 +196,35 @@ export interface DiagramOptions {
|
|
|
192
196
|
* Styles for the edge highlight box.
|
|
193
197
|
*/
|
|
194
198
|
highlightStyle?: PaintStyle;
|
|
199
|
+
/**
|
|
200
|
+
* Optional default styles for edges. These are overwritten by edges that have values in their backing data.
|
|
201
|
+
*/
|
|
202
|
+
lineStyle?: {
|
|
203
|
+
/**
|
|
204
|
+
* Width of the edge path
|
|
205
|
+
*/
|
|
206
|
+
lineWidth?: number;
|
|
207
|
+
/**
|
|
208
|
+
* Width to draw the edge's outline path
|
|
209
|
+
*/
|
|
210
|
+
outlineWidth?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Color to paint the edge's path
|
|
213
|
+
*/
|
|
214
|
+
color?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Color to paint the edge's outline path
|
|
217
|
+
*/
|
|
218
|
+
outlineColor?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Definition of dash pattern to use to draw the edge path
|
|
221
|
+
*/
|
|
222
|
+
dashArray?: string;
|
|
223
|
+
/**
|
|
224
|
+
* An array of color stops to use as a linear gradient for the edge path. When this is set, `color` is ignored.
|
|
225
|
+
*/
|
|
226
|
+
gradient?: Array<[number, string]>;
|
|
227
|
+
};
|
|
195
228
|
};
|
|
196
229
|
/**
|
|
197
230
|
* Defaults to #FFFFFF
|
|
@@ -514,7 +547,7 @@ export interface DiagramPaletteOptions {
|
|
|
514
547
|
/**
|
|
515
548
|
* If true, shapes can be dropped on edges in the canvas. The edge on which the shape was dropped has its target set to be the new node, and a new edge is added with the new node as source and the original edge's target as target.
|
|
516
549
|
*/
|
|
517
|
-
allowDropOnEdge?: boolean | CanDropOnEdgeFilter
|
|
550
|
+
allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
|
|
518
551
|
/**
|
|
519
552
|
* If `allowDropOnEdge` is also true, this flag instructs the shape palette to provide a default `edgeDropHandler` to the underlying palette which will attempt to find a source and target port on the new vertex, and connect to those instead of to the vertex itself. Defaults to true.
|
|
520
553
|
* @advanced
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { BaseBrowserUIPlugin, BrowserUIPlugin } from "../../../plugins";
|
|
2
2
|
import { PaletteOptions } from "../../../components";
|
|
3
|
-
import { BrowserElement } from "../../../util";
|
|
4
3
|
import { BrowserUI } from "../../../browser-visuallyjs-instance";
|
|
5
4
|
/**
|
|
6
5
|
* Options for the palette plugin
|
|
7
6
|
* @group Plugins
|
|
8
7
|
* @category Palette
|
|
9
8
|
*/
|
|
10
|
-
export interface PalettePluginOptions extends PaletteOptions
|
|
9
|
+
export interface PalettePluginOptions extends PaletteOptions {
|
|
11
10
|
}
|
|
12
11
|
export declare class PalettePlugin extends BaseBrowserUIPlugin implements BrowserUIPlugin<PalettePluginOptions> {
|
|
13
12
|
static type: string;
|
|
@@ -372,6 +372,70 @@ export declare const ATT_VJS_RESIZABLE = "data-vjs-resizable";
|
|
|
372
372
|
* @context resizingTools
|
|
373
373
|
*/
|
|
374
374
|
export declare const ATT_VJS_ROTATABLE = "data-vjs-rotatable";
|
|
375
|
+
/**
|
|
376
|
+
* The color to use as the stroke for a resize handle
|
|
377
|
+
* @group Plugins
|
|
378
|
+
* @category Resizing Tools
|
|
379
|
+
* @cssVariable
|
|
380
|
+
* @context resizingTools
|
|
381
|
+
*/
|
|
382
|
+
export declare const CSS_VARIABLE_RESIZE_HANDLE_COLOR = "--vjs-resize-handle-color";
|
|
383
|
+
/**
|
|
384
|
+
* The color to use as the stroke for a resize handle when it is in use
|
|
385
|
+
* @group Plugins
|
|
386
|
+
* @category Resizing Tools
|
|
387
|
+
* @cssVariable
|
|
388
|
+
* @context resizingTools
|
|
389
|
+
*/
|
|
390
|
+
export declare const CSS_VARIABLE_RESIZE_ACTIVE_COLOR = "--vjs-resize-active-color";
|
|
391
|
+
/**
|
|
392
|
+
* The size to use for a resize handle. For circles this denotes the diameter; for rectangles it denotes the side length.
|
|
393
|
+
* @group Plugins
|
|
394
|
+
* @category Resizing Tools
|
|
395
|
+
* @cssVariable
|
|
396
|
+
* @context resizingTools
|
|
397
|
+
*/
|
|
398
|
+
export declare const CSS_VARIABLE_RESIZE_HANDLE_SIZE = "--vjs-resize-handle-size";
|
|
399
|
+
/**
|
|
400
|
+
* The color to use as the fill for a resize handle
|
|
401
|
+
* @group Plugins
|
|
402
|
+
* @category Resizing Tools
|
|
403
|
+
* @cssVariable
|
|
404
|
+
* @context resizingTools
|
|
405
|
+
*/
|
|
406
|
+
export declare const CSS_VARIABLE_RESIZE_HANDLE_FILL_COLOR = "--vjs-resize-handle-fill-color";
|
|
407
|
+
/**
|
|
408
|
+
* The stroke width to use on the resize frame
|
|
409
|
+
* @group Plugins
|
|
410
|
+
* @category Resizing Tools
|
|
411
|
+
* @cssVariable
|
|
412
|
+
* @context resizingTools
|
|
413
|
+
*/
|
|
414
|
+
export declare const CSS_VARIABLE_RESIZE_FRAME_LINE_WIDTH = "--vjs-resize-frame-line-width";
|
|
415
|
+
/**
|
|
416
|
+
* The length of the leader line for the rotate handle
|
|
417
|
+
* @group Plugins
|
|
418
|
+
* @category Resizing Tools
|
|
419
|
+
* @cssVariable
|
|
420
|
+
* @context resizingTools
|
|
421
|
+
*/
|
|
422
|
+
export declare const CSS_VARIABLE_RESIZE_ROTATE_LEADER_LENGTH = "--vjs-resize-rotate-leader-length";
|
|
423
|
+
/**
|
|
424
|
+
* The stroke width of the leader line for the rotate handle
|
|
425
|
+
* @group Plugins
|
|
426
|
+
* @category Resizing Tools
|
|
427
|
+
* @cssVariable
|
|
428
|
+
* @context resizingTools
|
|
429
|
+
*/
|
|
430
|
+
export declare const CSS_VARIABLE_RESIZE_ROTATE_LEADER_WIDTH = "--vjs-resize-rotate-leader-width";
|
|
431
|
+
/**
|
|
432
|
+
* The diameter of the rotate handle
|
|
433
|
+
* @group Plugins
|
|
434
|
+
* @category Resizing Tools
|
|
435
|
+
* @cssVariable
|
|
436
|
+
* @context resizingTools
|
|
437
|
+
*/
|
|
438
|
+
export declare const CSS_VARIABLE_RESIZE_ROTATE_HANDLE_SIZE = "--vjs-resize-rotate-handle-size";
|
|
375
439
|
/** @internal */
|
|
376
440
|
export declare const ATT_DATA_DIR = "data-dir";
|
|
377
441
|
/**
|
|
@@ -55,7 +55,7 @@ export interface ShapePaletteOptions<T extends ObjectData> {
|
|
|
55
55
|
/**
|
|
56
56
|
* Optional data generator to allow you to specify initial data for some element to be dragged. Note that you cannot override the object's `type` with this function. The palette will set the new object's type to match the type of the element that the user is dragging from the palette.
|
|
57
57
|
*/
|
|
58
|
-
dataGenerator?: DataGeneratorFunction
|
|
58
|
+
dataGenerator?: DataGeneratorFunction;
|
|
59
59
|
/**
|
|
60
60
|
* 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.
|
|
61
61
|
*/
|
|
@@ -102,7 +102,7 @@ export interface ShapePaletteOptions<T extends ObjectData> {
|
|
|
102
102
|
/**
|
|
103
103
|
* If true, shapes can be dropped on edges in the canvas. The edge on which the shape was dropped has its target set to be the new node, and a new edge is added with the new node as source and the original edge's target as target.
|
|
104
104
|
*/
|
|
105
|
-
allowDropOnEdge?: boolean | CanDropOnEdgeFilter
|
|
105
|
+
allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
|
|
106
106
|
/**`
|
|
107
107
|
* If `allowDropOnEdge` is also true, this flag instructs the shape palette to provide a default `edgeDropHandler` to the underlying palette which will attempt to find a source and target port on the new vertex, and connect to those instead of to the vertex itself. Defaults to true.
|
|
108
108
|
* @advanced
|
|
@@ -16,8 +16,8 @@ export declare const ATTRIBUTE_DATA_SHAPE_ID = "data-shape-id";
|
|
|
16
16
|
export declare class ShapePalette<T extends ObjectData> {
|
|
17
17
|
private ui;
|
|
18
18
|
_$_templateEngine: BrowserUiRecado;
|
|
19
|
-
_$_palette: Palette
|
|
20
|
-
_$_userDataGenerator: DataGeneratorFunction
|
|
19
|
+
_$_palette: Palette;
|
|
20
|
+
_$_userDataGenerator: DataGeneratorFunction;
|
|
21
21
|
_$_showGroups: boolean;
|
|
22
22
|
/**
|
|
23
23
|
* @internal
|
|
@@ -206,27 +206,26 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
|
|
|
206
206
|
}): void;
|
|
207
207
|
$selectionCleared(sel: VisuallyJsSelection): any;
|
|
208
208
|
/**
|
|
209
|
-
* Save the dataset and the current state of the Surface - its pan and zoom settings.
|
|
209
|
+
* Save the dataset and the current state of the Surface - its pan and zoom settings, as well as data for any registered data hooks.
|
|
210
210
|
* @param options
|
|
211
211
|
* @tags input/output
|
|
212
212
|
*/
|
|
213
213
|
save(options?: UIExportOptions): SurfaceSaveData;
|
|
214
214
|
/**
|
|
215
|
-
* Load the dataset and the current state of the Surface - its pan and zoom settings.
|
|
215
|
+
* Load the dataset and the current state of the Surface - its pan and zoom settings, as well as data for any registered data hooks.
|
|
216
216
|
* @param data
|
|
217
217
|
* @param onload Optional function to invoke after load.
|
|
218
|
+
* @tags input/output
|
|
218
219
|
*/
|
|
219
220
|
load(data: SurfaceSaveData, onload?: Function): void;
|
|
220
221
|
/**
|
|
221
222
|
* Start editing the given edge or connection, optionally with the given edit parameters.
|
|
222
223
|
* @param edgeOrConnection
|
|
223
224
|
* @param params
|
|
224
|
-
*
|
|
225
225
|
*/
|
|
226
226
|
startEditingPath<T extends ConnectorEditorActivateParams<BrowserElement>>(edgeOrConnection: Edge | Connection<BrowserElement>, params?: T): void;
|
|
227
227
|
/**
|
|
228
228
|
* Stop editing any connector paths.
|
|
229
|
-
*
|
|
230
229
|
*/
|
|
231
230
|
stopEditingPath(): void;
|
|
232
231
|
/**
|