@visuallyjs/browser-ui 1.2.8 → 1.2.10
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 +64 -64
- package/js/visuallyjs.browser-ui.esm.js +67 -67
- package/package.json +1 -1
- package/types/browser-ui/browser-util.d.ts +1 -1
- package/types/browser-ui/browser-visuallyjs-instance.d.ts +4 -2
- package/types/browser-ui/surface-renderer/surface.d.ts +1 -0
- package/types/browser-ui/svg-element-connector.d.ts +3 -3
- package/types/index.d.ts +1 -0
- package/types/perf.d.ts +16 -0
- package/types/ui/common/overlay.d.ts +4 -0
- package/types/ui/core/core.d.ts +21 -2
- package/types/ui/core/defaults.d.ts +12 -0
- package/types/ui/core/overlay/overlay.d.ts +3 -0
- package/types/version.d.ts +1 -1
package/package.json
CHANGED
|
@@ -60,7 +60,7 @@ export declare function getClass(el: BrowserElement): string;
|
|
|
60
60
|
* @param el
|
|
61
61
|
* @param clazz
|
|
62
62
|
*/
|
|
63
|
-
export declare function addClass(el: BrowserElement | NodeListOf<BrowserElement>, clazz: string): void;
|
|
63
|
+
export declare function addClass(el: BrowserElement | NodeListOf<BrowserElement>, clazz: string | Array<string>): void;
|
|
64
64
|
/**
|
|
65
65
|
* @internal
|
|
66
66
|
* @param el
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVENT_EDGE_CLICK, EVENT_EDGE_CONTEXTMENU, EVENT_EDGE_DBLCLICK, EVENT_EDGE_MOUSEDOWN, EVENT_EDGE_MOUSEOUT, EVENT_EDGE_MOUSEOVER, EVENT_EDGE_MOUSEUP, EVENT_VERTEX_CLICK, EVENT_VERTEX_TAP, EVENT_VERTEX_DBLTAP, EVENT_VERTEX_MOUSEOVER, EVENT_VERTEX_MOUSEOUT, EVENT_VERTEX_MOUSEMOVE, EVENT_VERTEX_MOUSEUP, EVENT_VERTEX_MOUSEDOWN, EVENT_VERTEX_CONTEXTMENU, EVENT_VERTEX_DBLCLICK, Overlay, OverlayPaintParams, LabelOverlay, Connection, ConnectorPath, UICore, TypeDescriptorBase, VertexMapping, GroupMapping, PortMapping, NodeMapping, DragHandler2, ViewportElement, OverlaySpec, Connector, PaintStyle, ZoomToFitOptions, ZoomToFitIfNecessaryOptions, ZoomToElementsOptions, PropertyMapper, EdgePropertyMappings, ViewportGroupElement, ViewportNodeElement } from '../ui';
|
|
1
|
+
import { EVENT_EDGE_CLICK, EVENT_EDGE_CONTEXTMENU, EVENT_EDGE_DBLCLICK, EVENT_EDGE_MOUSEDOWN, EVENT_EDGE_MOUSEOUT, EVENT_EDGE_MOUSEOVER, EVENT_EDGE_MOUSEUP, EVENT_VERTEX_CLICK, EVENT_VERTEX_TAP, EVENT_VERTEX_DBLTAP, EVENT_VERTEX_MOUSEOVER, EVENT_VERTEX_MOUSEOUT, EVENT_VERTEX_MOUSEMOVE, EVENT_VERTEX_MOUSEUP, EVENT_VERTEX_MOUSEDOWN, EVENT_VERTEX_CONTEXTMENU, EVENT_VERTEX_DBLCLICK, Overlay, OverlayPaintParams, LabelOverlay, Connection, ConnectorPath, UICore, TypeDescriptorBase, VertexMapping, GroupMapping, PortMapping, NodeMapping, DragHandler2, ViewportElement, OverlaySpec, Connector, PaintStyle, ZoomToFitOptions, ZoomToFitIfNecessaryOptions, ZoomToElementsOptions, PropertyMapper, EdgePropertyMappings, ViewportGroupElement, ViewportNodeElement, EdgeRenderContext } from '../ui';
|
|
2
2
|
import { VisuallyJSDOMElement } from './element-facade';
|
|
3
3
|
import { VisuallyJsModel, Base, Edge, Group, Node, ObjectData, Port, Vertex, VisuallyJsSelection, DataSource, EVENT_GROUP_MOVE, Grid, GroupRemovedParams, NodeRemovedParams, PointXY, RectangleXY, Size, CustomTagOptions, AbstractLayoutAdapter, LayoutResultSet, EVENT_EDGE_DRAG_START, EVENT_EDGE_DRAG, EVENT_EDGE_DRAG_END, EVENT_EDGE_DRAG_ABORT } from "../core";
|
|
4
4
|
import { TemplateRenderer } from "./browser-ui";
|
|
@@ -145,6 +145,8 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
|
|
|
145
145
|
$appendOverlayElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
146
146
|
$appendVertexElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
147
147
|
$appendEdgeElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
148
|
+
$createEdgeElementFragment(): DocumentFragment;
|
|
149
|
+
$appendEdgeElementFragment(fragment: unknown): void;
|
|
148
150
|
/**
|
|
149
151
|
*
|
|
150
152
|
* @param el
|
|
@@ -632,7 +634,7 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
|
|
|
632
634
|
* @param connection
|
|
633
635
|
* @param paintStyle
|
|
634
636
|
*/
|
|
635
|
-
$paintConnector(connection: Connection<BrowserElement>, paintStyle: PaintStyle): void;
|
|
637
|
+
$paintConnector(connection: Connection<BrowserElement>, paintStyle: PaintStyle, edgeRenderContext?: EdgeRenderContext): void;
|
|
636
638
|
/**
|
|
637
639
|
* @internal
|
|
638
640
|
* @param connection
|
|
@@ -168,6 +168,7 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
|
|
|
168
168
|
$appendOverlayElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
169
169
|
$appendVertexElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
170
170
|
$appendEdgeElement(e: BrowserElement, insertAtStart?: boolean): void;
|
|
171
|
+
$appendEdgeElementFragment(fragment: unknown): void;
|
|
171
172
|
/**
|
|
172
173
|
* Internal callback to register an edge path editor and ensure that the various editors are initialized.
|
|
173
174
|
* @param editor
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BrowserUI } from "./browser-visuallyjs-instance";
|
|
2
|
-
import { PaintStyle, Connector, Connection } from "../ui";
|
|
3
|
-
export declare function paintSvgConnector(instance: BrowserUI, connection: Connection<any>, paintStyle: PaintStyle): void;
|
|
2
|
+
import { PaintStyle, Connector, Connection, EdgeRenderContext } from "../ui";
|
|
3
|
+
export declare function paintSvgConnector(instance: BrowserUI, connection: Connection<any>, paintStyle: PaintStyle, edgeRenderContext?: EdgeRenderContext): void;
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -13,4 +13,4 @@ export interface SvgConnector extends Connector {
|
|
|
13
13
|
targetZone: SVGElement;
|
|
14
14
|
gradient?: SVGLinearGradientElement;
|
|
15
15
|
}
|
|
16
|
-
export declare function getConnectorElement(instance: BrowserUI, connection: Connection<any
|
|
16
|
+
export declare function getConnectorElement(instance: BrowserUI, connection: Connection<any>, edgeFragment?: DocumentFragment): SVGElement;
|
package/types/index.d.ts
CHANGED
package/types/perf.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class VisuallyJsPerformance {
|
|
2
|
+
static p: VisuallyJsPerformance;
|
|
3
|
+
metrics: Map<string, number>;
|
|
4
|
+
track: Map<string, number>;
|
|
5
|
+
counts: Map<string, number>;
|
|
6
|
+
level: number;
|
|
7
|
+
_disabled: boolean;
|
|
8
|
+
static get(): VisuallyJsPerformance;
|
|
9
|
+
private padTopic;
|
|
10
|
+
disable(): void;
|
|
11
|
+
enable(): void;
|
|
12
|
+
begin(topic: string): void;
|
|
13
|
+
end(topic: string): void;
|
|
14
|
+
reset(): void;
|
|
15
|
+
log(): void;
|
|
16
|
+
}
|
|
@@ -20,6 +20,10 @@ export interface OverlayOptions extends Record<string, any> {
|
|
|
20
20
|
* Defaults to 0.5. See docs.
|
|
21
21
|
*/
|
|
22
22
|
location?: number;
|
|
23
|
+
/** Minimum zoom at which this overlay is visible. Defaults to 0. Null or a negative value disables this bound. */
|
|
24
|
+
minZoom?: number | null;
|
|
25
|
+
/** Maximum zoom at which this overlay is visible. Defaults to Infinity. Null or a negative value disables this bound. */
|
|
26
|
+
maxZoom?: number | null;
|
|
23
27
|
/**
|
|
24
28
|
* 1 to point forwards (the default), -1 to point backwards. Only taken into consideration in some overlay types.
|
|
25
29
|
*/
|
package/types/ui/core/core.d.ts
CHANGED
|
@@ -103,6 +103,13 @@ export interface LineStyle {
|
|
|
103
103
|
*/
|
|
104
104
|
fontFamily?: string;
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Used by the bulk loader to provide a fragment to which edge elements are appended, rather than the DOM itself. At the end of a bulk load the entire fragment is appended. This provides a performance boost.
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
export interface EdgeRenderContext {
|
|
111
|
+
edgeElementFragment?: unknown;
|
|
112
|
+
}
|
|
106
113
|
/**
|
|
107
114
|
* Base UI for apps and diagrams.
|
|
108
115
|
* @internal
|
|
@@ -176,6 +183,12 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
176
183
|
def: any;
|
|
177
184
|
eventInfo: any;
|
|
178
185
|
}>;
|
|
186
|
+
/**
|
|
187
|
+
* Measurements that will need to be made once the bulk load completes
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
190
|
+
private _pendingInitialSizeMeasurements;
|
|
191
|
+
private _deferredInitialVertexRenderedEvents;
|
|
179
192
|
/**
|
|
180
193
|
* Map of group member added events which have not yet been processed, due to the group in question not having yet been rendered at the time the event was fired. The contents of this map are processed whenever a new group is added. Users of the API should not modify the contents of this map.
|
|
181
194
|
* @internal
|
|
@@ -189,6 +202,8 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
189
202
|
$_useModelForSizes: boolean;
|
|
190
203
|
$_writeSizeToElements: boolean;
|
|
191
204
|
$_useModelForPositions: boolean;
|
|
205
|
+
$_batchInitialElementMeasurements: boolean;
|
|
206
|
+
$_batchEdgeInsertions: boolean;
|
|
192
207
|
readonly $_allowUnattachedEdges: boolean;
|
|
193
208
|
readonly $_edgesDetachable: boolean;
|
|
194
209
|
readonly $_reattachEdges: boolean;
|
|
@@ -352,6 +367,7 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
352
367
|
*/
|
|
353
368
|
$dataAppendStart(): void;
|
|
354
369
|
$dataAppendEnd(noDataWasAppended?: boolean): void;
|
|
370
|
+
private $measureInitialElementSizes;
|
|
355
371
|
/**
|
|
356
372
|
This method needs to be updated to work with _setDataLoading to ensure that all vertices for some batch load have been rendered before the stuff here happens. Vertices might be painted async by the underlying template engine, such as React 18 or Vue 3.
|
|
357
373
|
* @param noDataWasLoaded
|
|
@@ -546,7 +562,7 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
546
562
|
/**
|
|
547
563
|
* @internal
|
|
548
564
|
*/
|
|
549
|
-
$redrawEveryConnection(): void;
|
|
565
|
+
$redrawEveryConnection(timestamp?: string, edgeRenderContext?: EdgeRenderContext): void;
|
|
550
566
|
private $redrawConnectionsForViewportElement;
|
|
551
567
|
private _repaintConnections;
|
|
552
568
|
/**
|
|
@@ -963,6 +979,7 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
963
979
|
$paintConnection(connection: Connection<EL>, params?: {
|
|
964
980
|
timestamp?: string;
|
|
965
981
|
fireEvent?: boolean;
|
|
982
|
+
edgeRenderContext?: EdgeRenderContext;
|
|
966
983
|
}): void;
|
|
967
984
|
/**
|
|
968
985
|
* Adds an overlay to the given component, repainting the UI as necessary.
|
|
@@ -1169,6 +1186,8 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
1169
1186
|
* @internal
|
|
1170
1187
|
*/
|
|
1171
1188
|
abstract $appendEdgeElement(e: EL, insertAtStart?: boolean): void;
|
|
1189
|
+
abstract $createEdgeElementFragment(): unknown;
|
|
1190
|
+
abstract $appendEdgeElementFragment(fragment: unknown): void;
|
|
1172
1191
|
abstract $setElementVisible(el: EL, visible: boolean): void;
|
|
1173
1192
|
/**
|
|
1174
1193
|
* Sets the size of the element in the UI. The details of this are specific to the concrete subclass. No model edits occur as a result of this method.
|
|
@@ -1754,7 +1773,7 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
1754
1773
|
* @param paintStyle
|
|
1755
1774
|
* @param extents
|
|
1756
1775
|
*/
|
|
1757
|
-
abstract $paintConnector(connection: Connection<any>, paintStyle: PaintStyle): void;
|
|
1776
|
+
abstract $paintConnector(connection: Connection<any>, paintStyle: PaintStyle, edgeRenderContext?: EdgeRenderContext): void;
|
|
1758
1777
|
/**
|
|
1759
1778
|
* @internal
|
|
1760
1779
|
* @param connection
|
|
@@ -150,6 +150,12 @@ export interface UIEdgeOptions {
|
|
|
150
150
|
* The default color to paint a connector's outline path. Defaults to `"transparent"`. Can be overridden on a per-edge basis via the `outlineColor` setting.
|
|
151
151
|
*/
|
|
152
152
|
outlineColor?: string;
|
|
153
|
+
/**
|
|
154
|
+
* defaults to true, connector elements created during the final initial render pass are appended to the DOM in a single batch. only exposing this option in case a major regression is detected and the functionality needs to be switched off. and marking internal so it's a need to know.
|
|
155
|
+
* @internal
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
batchEdgeInsertions?: boolean;
|
|
153
159
|
}
|
|
154
160
|
/**
|
|
155
161
|
* Base options for a renderer.
|
|
@@ -205,6 +211,12 @@ export interface UICoreOptions<E, O extends UICoreDefaults> {
|
|
|
205
211
|
* Defaults to false. When true, newly created nodes are sized according to values in their backing data, using the modelWidthAttribute and modelHeightAttribute as keys. NOTE: when this flag is set, VisuallyJs will write the size onto each element as it is created. Depending on your app, you may not need it to do this - if you know your node sizes are set via css, for instance, or you know the template rendering your vertices writes out the size in an element's style or an SVG element's width/height. If that is the case, you can set {@link writeSizeToElements} to be false, and you'll get a performance boost.
|
|
206
212
|
*/
|
|
207
213
|
useModelForSizes?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Defaults to true. During initial data rendering, append vertices first and measure their DOM sizes together before layout. This preserves DOM-derived sizes while avoiding a layout read after each append. only exposing this option in case a major regression is detected and the functionality needs to be switched off. and marking internal so it's a need to know.
|
|
216
|
+
* @internal
|
|
217
|
+
* @deprecated
|
|
218
|
+
*/
|
|
219
|
+
batchInitialElementMeasurements?: boolean;
|
|
208
220
|
/**
|
|
209
221
|
* When {@link useModelForSizes} is true, VisuallyJs will write out the model size onto each element rendered. But if you know your node sizes are set via css, or you know the template rendering your vertices writes out the size in an element's style or an SVG element's width/height, you can instruct VisuallyJs not to bother writing out the size to the element itself, by setting this flag to true (the default is false). This can provide a performance boost.
|
|
210
222
|
*/
|
|
@@ -70,6 +70,8 @@ export declare abstract class Overlay<EL, O extends OverlayOptions = OverlayOpti
|
|
|
70
70
|
_visibility: OverlayVisibility;
|
|
71
71
|
visible: boolean;
|
|
72
72
|
location: number;
|
|
73
|
+
minZoom: number;
|
|
74
|
+
maxZoom: number;
|
|
73
75
|
events: Record<string, (value: any, event?: any) => any>;
|
|
74
76
|
attributes: Record<string, string>;
|
|
75
77
|
/**
|
|
@@ -83,6 +85,7 @@ export declare abstract class Overlay<EL, O extends OverlayOptions = OverlayOpti
|
|
|
83
85
|
ignoreTypes: boolean;
|
|
84
86
|
constructor(connection: Connection<EL>, p: O);
|
|
85
87
|
abstract updateFrom(opts: O, context: ObjectData): void;
|
|
88
|
+
setZoomRange(options: OverlayOptions): void;
|
|
86
89
|
abstract isSimpleShape: boolean;
|
|
87
90
|
}
|
|
88
91
|
/**
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.2.
|
|
1
|
+
export declare const VERSION = "1.2.10";
|