@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LabelOverlay, PaintStyle, Overlay, OverlayPaintParams, SimpleShapeOverlay } from "../ui";
|
|
1
|
+
import { LabelOverlay, PaintStyle, Overlay, OverlayPaintParams, SimpleShapeOverlay, OverlayOptions, LabelOverlayOptions } from "../ui";
|
|
2
2
|
import { Extents, PointXY } from "../core";
|
|
3
3
|
import { BrowserUI } from "./browser-visuallyjs-instance";
|
|
4
4
|
/**
|
|
@@ -46,11 +46,11 @@ export declare function paintSVGLabelOverlay(instance: BrowserUI, o: SVGLabelOve
|
|
|
46
46
|
* @internal
|
|
47
47
|
*/
|
|
48
48
|
export declare function destroySVGOverlay(o: SVGElementOverlay<any>, force?: boolean): void;
|
|
49
|
-
export declare abstract class SVGElementOverlay<EL> extends Overlay<EL> {
|
|
49
|
+
export declare abstract class SVGElementOverlay<EL, O extends OverlayOptions = OverlayOptions> extends Overlay<EL, O> {
|
|
50
50
|
contentElements: Array<SVGElement>;
|
|
51
51
|
backgroundContentElements: Array<SVGElement>;
|
|
52
52
|
}
|
|
53
|
-
export interface SVGLabelOverlay<EL> extends SVGElementOverlay<EL>, LabelOverlay<EL> {
|
|
53
|
+
export interface SVGLabelOverlay<EL> extends SVGElementOverlay<EL, LabelOverlayOptions>, LabelOverlay<EL> {
|
|
54
54
|
textElement: SVGTextElement;
|
|
55
55
|
bgElement: SVGRectElement;
|
|
56
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OptimisticEventGenerator, ColorGenerator, PointXY, ObjectData, DataSource, Node, Group } from "../core";
|
|
2
|
-
import { EventManager, BrowserElement,
|
|
2
|
+
import { EventManager, BrowserElement, ImageExportOptions, ImageReadyFunction } from "../browser-ui";
|
|
3
3
|
import { ChartSVGElement } from "./util";
|
|
4
|
+
import { FontSpec } from "../ui";
|
|
4
5
|
import { ChartLegend, LegendSpec } from "./legend";
|
|
5
6
|
import { TooltipOptions } from "./tooltip";
|
|
6
7
|
import { ChartDimensions } from "./definitions";
|
|
@@ -3,7 +3,7 @@ import { AxisTitleAlignment, AxisTitleSpec } from "./base-chart";
|
|
|
3
3
|
import { ChartSVGElement, SteppedScale } from "./util";
|
|
4
4
|
import { XYChartOptions } from "./base-xy-chart";
|
|
5
5
|
import { DualValueSeriesOptions } from "./series";
|
|
6
|
-
import { FontSpec } from "../
|
|
6
|
+
import { FontSpec } from "../ui";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { XYChart } from "./base-xy-chart";
|
|
2
2
|
import { DualValueChartOptions, ValueAxis, ValueAxisDefinition } from "./definitions";
|
|
3
3
|
import { ObjectData } from "../core";
|
|
4
|
-
import { BrowserElement
|
|
4
|
+
import { BrowserElement } from "../browser-ui";
|
|
5
5
|
import { ChartSVGElement } from "./util";
|
|
6
|
+
import { FontSpec } from "../ui";
|
|
6
7
|
import { DualValueChartSeries, DualValueSeriesOptions } from "./series";
|
|
7
8
|
import { DualValueAxisTooltip, TooltipOptions } from "./tooltip";
|
|
8
9
|
/**
|
package/types/charts/legend.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SeriesBasedChart, SeriesBasedChartOptions } from "../series-based-chart";
|
|
2
2
|
import { ObjectData } from "../../core";
|
|
3
3
|
import { ChartSVGElement } from "../util";
|
|
4
|
-
import { BrowserElement
|
|
4
|
+
import { BrowserElement } from "../../browser-ui";
|
|
5
|
+
import { FontSpec } from "../../ui";
|
|
5
6
|
import { ChartDimensions } from "../definitions";
|
|
6
7
|
import { RealisedSeries, RecordBasedSeriesOptions } from "../series";
|
|
7
8
|
import { CategoryValueTooltip, TooltipOptions } from "../tooltip";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SankeyLayer } from './preprocessor';
|
|
2
2
|
import { Node, Edge, Vertex, DataSource, VisuallyJsDefaultJSON } from "../../core";
|
|
3
|
-
import {
|
|
3
|
+
import { FontSpec } from "../../ui";
|
|
4
|
+
import { BrowserElement, BrowserUIModel } from "../../browser-ui";
|
|
4
5
|
import { ChartSVGElement } from "../util";
|
|
5
6
|
import { BaseChart, BaseChartOptions } from "../base-chart";
|
|
6
7
|
import { Tooltip, TooltipOptions } from "../tooltip";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PointXY, ElementFacade, AbstractEntry, ObjectData } from "../core";
|
|
2
|
-
import { BrowserUiRecado, BrowserElement
|
|
2
|
+
import { BrowserUiRecado, BrowserElement } from "../browser-ui";
|
|
3
|
+
import { FontSpec } from "../ui";
|
|
3
4
|
import { RealisedSeries } from "./series/definitions";
|
|
4
5
|
import { DualValueChartSeries } from "./series";
|
|
5
6
|
/**
|
package/types/charts/util.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BrowserElement
|
|
1
|
+
import { BrowserElement } from "../browser-ui";
|
|
2
2
|
import { BaseChart } from "./base-chart";
|
|
3
3
|
import { RectangleXY } from "../core";
|
|
4
|
+
import { FontSpec, FontStyle } from "../ui";
|
|
4
5
|
import { AxisCommon, CategoryAxis, ValueAxis } from "./definitions";
|
|
5
6
|
/**
|
|
6
7
|
* internal candidate for a stepped scale.
|
|
@@ -788,9 +788,9 @@ export declare class TestHarness {
|
|
|
788
788
|
private _addFromPaletteInit;
|
|
789
789
|
private _addFromPalette;
|
|
790
790
|
private _addFromPaletteASync;
|
|
791
|
-
dragFromPalette(palette: Palette
|
|
792
|
-
dragFromPaletteAsync(palette: Palette
|
|
793
|
-
tapFromPalette(palette: Palette
|
|
791
|
+
dragFromPalette(palette: Palette, selector: string, options?: any, metaKeys?: Record<string, boolean>): void;
|
|
792
|
+
dragFromPaletteAsync(palette: Palette, selector: string, options?: any, metaKeys?: Record<string, boolean>): PaletteDragHarness;
|
|
793
|
+
tapFromPalette(palette: Palette, selector: string, options?: any): void;
|
|
794
794
|
/**
|
|
795
795
|
* Trigger a mousedown event on the edge with the given id.
|
|
796
796
|
* @param edgeId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaintStyle } from './paint-style';
|
|
2
2
|
import { OverlayEvents, OverlayVisibility } from "../core/overlay/overlay";
|
|
3
|
-
import { FontSpec } from "../../browser-ui";
|
|
4
3
|
import { Edge } from "../../core";
|
|
4
|
+
import { FontSpec, LabelBackgroundStyle } from "../core";
|
|
5
5
|
/**
|
|
6
6
|
* Base options for an overlay.
|
|
7
7
|
* @group Edges
|
|
@@ -93,7 +93,11 @@ export interface LabelOverlayOptions extends OverlayOptions {
|
|
|
93
93
|
*/
|
|
94
94
|
font?: FontSpec;
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
96
|
+
* Optional style for the label's background.
|
|
97
|
+
*/
|
|
98
|
+
backgroundStyle?: LabelBackgroundStyle;
|
|
99
|
+
/**
|
|
100
|
+
* Sets whether the label can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the label will be made rotatable, in "legible" mode - in which VisuallyJs ensures that the label is legible by avoiding rotating the text so that it is upside down or otherwise awkward to read. You can set "strict" mode, which will rotate the label to the appropriate angle regardless of whether or not it will make the label difficult to read. If you supply boolean false, the label will not be rotatable in any situation.
|
|
97
101
|
*/
|
|
98
102
|
rotatable?: boolean | "legible" | "strict" | null;
|
|
99
103
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LineStyle } from "../core";
|
|
1
2
|
/**
|
|
2
3
|
* Basic style definition for an edge
|
|
3
4
|
* @group UI
|
|
@@ -33,3 +34,9 @@ export interface PaintStyle {
|
|
|
33
34
|
*/
|
|
34
35
|
gradient?: Array<[number, string]>;
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @param ls
|
|
40
|
+
* @param p
|
|
41
|
+
*/
|
|
42
|
+
export declare function $transferLineStyleToPaintStyle(ls: LineStyle, p: PaintStyle): void;
|
package/types/ui/core/core.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { GroupMapping, NodeMapping, NodeOrGroupMapping, PortMapping, VertexMappi
|
|
|
15
15
|
import { Magnetizer, MagnetizeResult } from "../../core/magnetizer";
|
|
16
16
|
import { AbstractLayout, LayoutParameters, LayoutResultSet } from "../../core/layout/abstract-layout";
|
|
17
17
|
import { DataSource, EdgeAddedParams, EdgeRemovedParams, EdgeSourceChangedParams, EdgeTargetChangedParams, Extents, FilterableDataset, Grid, GroupAddedParams, GroupMemberAddedParams, GroupMemberRemovedParams, GroupRemovedParams, NodeAddedParams, NodeRemovedParams, OptimisticEventGenerator, PointXY, RectangleXY, VisuallyJsSelection, Size, VisuallyJsRenderer, VertexUpdatedParams, VisuallyJsModel, SaveOptions, Rotations, AbstractLayoutAdapter } from "../../core";
|
|
18
|
-
import { DataHook, ElementType, EnclosedVerticesOptions, GroupContentAreaInfo, GroupResizeResult, IntersectingVerticesOptions, UICapabilities, UIExportOptions, UISaveData, ViewportBounds, ZoomToElementsOptions, ZoomToFitIfNecessaryOptions, ZoomToFitOptions } from "./definitions";
|
|
18
|
+
import { DataHook, ElementType, EnclosedVerticesOptions, FontStyle, GroupContentAreaInfo, GroupResizeResult, IntersectingVerticesOptions, UICapabilities, UIExportOptions, UISaveData, ViewportBounds, ZoomToElementsOptions, ZoomToFitIfNecessaryOptions, ZoomToFitOptions } from "./definitions";
|
|
19
19
|
import { GridProfile } from "./grid-profile";
|
|
20
20
|
import { MagnetizeProfile } from "./magnetize-profile";
|
|
21
21
|
import { UIPlugin, UIPluginOptions, UIPluginSpec } from "../plugins/definitions";
|
|
@@ -78,6 +78,30 @@ export interface LineStyle {
|
|
|
78
78
|
* Definition of dash pattern to use to draw the edge path
|
|
79
79
|
*/
|
|
80
80
|
dashArray?: string;
|
|
81
|
+
/**
|
|
82
|
+
* An array of color stops to use as a linear gradient for the edge path. When this is set, `color` is ignored.
|
|
83
|
+
*/
|
|
84
|
+
gradient?: Array<[number, string]>;
|
|
85
|
+
/**
|
|
86
|
+
* Label to show on the edge
|
|
87
|
+
*/
|
|
88
|
+
label?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Location for the label, defaults to 0.5
|
|
91
|
+
*/
|
|
92
|
+
labelLocation?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Font size to use; defaults to whatever the browser decides given the context
|
|
95
|
+
*/
|
|
96
|
+
fontSize?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Font style to use; defaults to whatever the browser decides given the context
|
|
99
|
+
*/
|
|
100
|
+
fontStyle?: FontStyle;
|
|
101
|
+
/**
|
|
102
|
+
* Font size to use; defaults to whatever the browser decides given the context
|
|
103
|
+
*/
|
|
104
|
+
fontFamily?: string;
|
|
81
105
|
}
|
|
82
106
|
/**
|
|
83
107
|
* Base UI for apps and diagrams.
|
|
@@ -375,6 +399,13 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
|
|
|
375
399
|
*/
|
|
376
400
|
$_extractSimpleEdgeStyles(data: ObjectData, o: Record<string, any>): boolean;
|
|
377
401
|
private _doRenderEdgeNew;
|
|
402
|
+
/**
|
|
403
|
+
* If simple edge styles are active, merge properties from the edge data on top of the given paint style.
|
|
404
|
+
* @param edge
|
|
405
|
+
* @param paintStyle
|
|
406
|
+
* @internal
|
|
407
|
+
*/
|
|
408
|
+
$realiseEdgePaintStyle(edge: Edge, paintStyle: PaintStyle): PaintStyle;
|
|
378
409
|
/**
|
|
379
410
|
* @internal
|
|
380
411
|
*/
|
|
@@ -243,7 +243,13 @@ export interface UIExportOptions extends ExportOptions {
|
|
|
243
243
|
* @category Input and Output
|
|
244
244
|
*/
|
|
245
245
|
export interface UISaveData {
|
|
246
|
+
/**
|
|
247
|
+
* The current zoom level
|
|
248
|
+
*/
|
|
246
249
|
zoom: number;
|
|
250
|
+
/**
|
|
251
|
+
* Data exported from the model
|
|
252
|
+
*/
|
|
247
253
|
data: any;
|
|
248
254
|
}
|
|
249
255
|
/**
|
|
@@ -292,7 +298,15 @@ export interface ViewportBounds {
|
|
|
292
298
|
* @category Model
|
|
293
299
|
*/
|
|
294
300
|
export interface DataHook {
|
|
301
|
+
/**
|
|
302
|
+
* Notification that data has been loaded.
|
|
303
|
+
* @param d
|
|
304
|
+
*/
|
|
295
305
|
load: (d: UISaveData) => any;
|
|
306
|
+
/**
|
|
307
|
+
* Notification that data is being saved. Your hook can write its data to `d`.
|
|
308
|
+
* @param d
|
|
309
|
+
*/
|
|
296
310
|
save: (d: UISaveData) => any;
|
|
297
311
|
}
|
|
298
312
|
/**
|
|
@@ -578,4 +592,39 @@ export declare enum UICapabilities {
|
|
|
578
592
|
vertexResize = "vertexResize",
|
|
579
593
|
vertexDrawing = "vertexDrawing"
|
|
580
594
|
}
|
|
595
|
+
/**
|
|
596
|
+
* Style for a font - oblique, italic or normal.
|
|
597
|
+
* @group UI
|
|
598
|
+
* @category Definitions
|
|
599
|
+
*/
|
|
600
|
+
export type FontStyle = "normal" | "oblique" | "italic";
|
|
601
|
+
/**
|
|
602
|
+
* Font weight to use (e.g., "normal", "bold", "100", "300").
|
|
603
|
+
* @group UI
|
|
604
|
+
* @category Definitions
|
|
605
|
+
*/
|
|
606
|
+
export type FontWeight = string | number;
|
|
607
|
+
/**
|
|
608
|
+
* Specs for a font. The default values depend on the context.
|
|
609
|
+
* @group UI
|
|
610
|
+
* @category Definitions
|
|
611
|
+
*/
|
|
612
|
+
export interface FontSpec {
|
|
613
|
+
/**
|
|
614
|
+
* Size of the font. Default value depends on the context this spec occurs in.
|
|
615
|
+
*/
|
|
616
|
+
size?: number;
|
|
617
|
+
/**
|
|
618
|
+
* Font style to use. Default value depends on the context this spec occurs in.
|
|
619
|
+
*/
|
|
620
|
+
style?: FontStyle;
|
|
621
|
+
/**
|
|
622
|
+
* Font weight to use (e.g., "normal", "bold", "100", "300"). Defaults to null, which browsers treat as "normal".
|
|
623
|
+
*/
|
|
624
|
+
weight?: FontWeight;
|
|
625
|
+
/**
|
|
626
|
+
* Font family to use.
|
|
627
|
+
*/
|
|
628
|
+
family?: string;
|
|
629
|
+
}
|
|
581
630
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Overlay } from "./overlay";
|
|
2
2
|
import { UICore } from "../core";
|
|
3
|
-
import { OverlayOptions } from "../../common";
|
|
3
|
+
import { InternalOverlayOptions, OverlayOptions } from "../../common";
|
|
4
4
|
import { Connection } from "../connector/connection-impl";
|
|
5
5
|
import { Edge, ObjectData, VisuallyJsModel } from "../../../core";
|
|
6
6
|
import { BrowserUI } from "../../../browser-ui";
|
|
@@ -45,7 +45,7 @@ export declare class CustomOverlayImpl<EL> extends Overlay<EL> implements Custom
|
|
|
45
45
|
rotatable: boolean | "strict" | "legible" | null;
|
|
46
46
|
constructor(instance: UICore<EL>, connection: Connection<EL>, p: CustomOverlayOptions<EL>);
|
|
47
47
|
type: string;
|
|
48
|
-
updateFrom(d:
|
|
48
|
+
updateFrom(d: InternalOverlayOptions, context: ObjectData): void;
|
|
49
49
|
}
|
|
50
50
|
export interface CustomOverlayHolder<EL> extends CustomOverlayImpl<EL> {
|
|
51
51
|
contentElement: EL;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Overlay } from "./overlay";
|
|
2
|
-
import { UICore } from "../core";
|
|
2
|
+
import { LineStyle, UICore } from "../core";
|
|
3
3
|
import { LabelOverlayOptions } from "../../common";
|
|
4
4
|
import { Connection } from "../connector/connection-impl";
|
|
5
5
|
import { ObjectData } from "../../../core";
|
|
6
|
-
import { FontSpec } from "
|
|
6
|
+
import { FontSpec } from "../definitions";
|
|
7
7
|
/**
|
|
8
8
|
* An overlay that draws some text. By default this overlay will use an HTML element, and that element's parent will be the surface canvas, unless the container is an SVG element, in which case the overlay will use an SVG element. You can set `useHTMLElement:false` in the options if you want the overlay to use an SVG element regardless of the container element type.
|
|
9
9
|
* @group Edges
|
|
10
10
|
* @category Overlays
|
|
11
11
|
*/
|
|
12
|
-
export declare class LabelOverlay<EL> extends Overlay<EL> {
|
|
12
|
+
export declare class LabelOverlay<EL> extends Overlay<EL, LabelOverlayOptions> {
|
|
13
13
|
private instance;
|
|
14
14
|
connection: Connection<EL>;
|
|
15
15
|
label: string | Function;
|
|
@@ -18,11 +18,12 @@ export declare class LabelOverlay<EL> extends Overlay<EL> {
|
|
|
18
18
|
useHTMLElement: boolean;
|
|
19
19
|
rotatable: boolean | string;
|
|
20
20
|
font: FontSpec;
|
|
21
|
+
backgroundStyle: any;
|
|
21
22
|
constructor(instance: UICore<EL>, connection: Connection<EL>, p: LabelOverlayOptions);
|
|
22
23
|
isSimpleShape: boolean;
|
|
23
24
|
getLabel(): string;
|
|
24
25
|
setLabel(l: string | Function): void;
|
|
25
|
-
updateFrom(d:
|
|
26
|
+
updateFrom(d: LabelOverlayOptions, context: ObjectData): void;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* @internal
|
|
@@ -35,4 +36,4 @@ export declare function isLabelOverlay<EL>(o: Overlay<EL>): o is LabelOverlay<EL
|
|
|
35
36
|
* @param data
|
|
36
37
|
* @internal
|
|
37
38
|
*/
|
|
38
|
-
export declare function $updateLabelOverlayFont(lo: LabelOverlay<any>, data: ObjectData): void;
|
|
39
|
+
export declare function $updateLabelOverlayFont(lo: LabelOverlay<any>, data: ObjectData & LineStyle): void;
|
|
@@ -62,7 +62,7 @@ export declare function setOverlayLocation(o: Overlay<any>, l: number | string):
|
|
|
62
62
|
* @category Overlays
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
|
-
export declare abstract class Overlay<EL> {
|
|
65
|
+
export declare abstract class Overlay<EL, O extends OverlayOptions = OverlayOptions> {
|
|
66
66
|
connection: Connection<EL>;
|
|
67
67
|
id: string;
|
|
68
68
|
abstract type: string;
|
|
@@ -81,8 +81,8 @@ export declare abstract class Overlay<EL> {
|
|
|
81
81
|
* @param p
|
|
82
82
|
*/
|
|
83
83
|
ignoreTypes: boolean;
|
|
84
|
-
constructor(connection: Connection<EL>, p:
|
|
85
|
-
abstract updateFrom(opts:
|
|
84
|
+
constructor(connection: Connection<EL>, p: O);
|
|
85
|
+
abstract updateFrom(opts: O, context: ObjectData): void;
|
|
86
86
|
abstract isSimpleShape: boolean;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConnectorSpec, PaintStyle, OverlaySpec, AnchorSpec, LightweightAnchor } from "../common";
|
|
2
2
|
import { Extents, PointXY, Size, Edge, Group, Node, AbstractLayout, GradientSpec } from "../../core";
|
|
3
|
+
import { LabelBackgroundStyle } from "./view";
|
|
3
4
|
/**
|
|
4
5
|
* Options for the `connect` call on a UICore
|
|
5
6
|
* @internal
|
|
@@ -41,6 +42,10 @@ export interface ConnectParams<E> {
|
|
|
41
42
|
* When true, the label will be rotated so that it is at the same angle as the slope of the connector at the point at which the label is located.
|
|
42
43
|
*/
|
|
43
44
|
labelsRotatable?: boolean | "strict" | "legible" | null;
|
|
45
|
+
/**
|
|
46
|
+
* Optional style for the label's background. This is ignored if `useHTMLLabel` is set to true.
|
|
47
|
+
*/
|
|
48
|
+
labelBackgroundStyle?: LabelBackgroundStyle;
|
|
44
49
|
/**
|
|
45
50
|
* Spec for the connector used to paint the connection.
|
|
46
51
|
*/
|
|
@@ -4,7 +4,45 @@ import { AnchorSpec, ConnectorSpec, OverlaySpec, PaintStyle } from "../../common
|
|
|
4
4
|
import { OverlayVisibility } from "../overlay/overlay";
|
|
5
5
|
import { EdgeEventOptions } from "./events";
|
|
6
6
|
import { LineStyle } from "../core";
|
|
7
|
-
import { FontSpec } from "
|
|
7
|
+
import { FontSpec } from "../definitions";
|
|
8
|
+
/**
|
|
9
|
+
* Defines the style for the background of a label overlay.
|
|
10
|
+
* @group Edges
|
|
11
|
+
*/
|
|
12
|
+
export interface LabelBackgroundStyle {
|
|
13
|
+
/**
|
|
14
|
+
* Fill color for the background.
|
|
15
|
+
*/
|
|
16
|
+
fill?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Opacity for the background.
|
|
19
|
+
*/
|
|
20
|
+
opacity?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Padding to leave around the label. Defaults to 5.
|
|
23
|
+
*/
|
|
24
|
+
padding?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Horizontal radius for the background rectangle's corners.
|
|
27
|
+
*/
|
|
28
|
+
rx?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Vertical radius for the background rectangle's corners. If you provide `rx` but not this, `ry` will take the value of `rx`.
|
|
31
|
+
*/
|
|
32
|
+
ry?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Stroke color for the background.
|
|
35
|
+
*/
|
|
36
|
+
stroke?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Stroke width for the background.
|
|
39
|
+
*/
|
|
40
|
+
strokeWidth?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Stroke opacity for the background.
|
|
43
|
+
*/
|
|
44
|
+
strokeOpacity?: number;
|
|
45
|
+
}
|
|
8
46
|
/**
|
|
9
47
|
* Definition of the function you can provide as `deleteConfirm` on an edge definition. VisuallyJs gives you the edge to be possibly deleted and the pointer event that instigated the deletion. If you wish to delete the edge you must invoke the `proceed()` function.
|
|
10
48
|
* @group Edges
|
|
@@ -18,7 +56,7 @@ export type EdgeDeleteConfirmationFunction = (params: {
|
|
|
18
56
|
* @group Components
|
|
19
57
|
* @category View
|
|
20
58
|
*/
|
|
21
|
-
export interface EdgeMapping extends BaseViewObjectMapping, LineStyle {
|
|
59
|
+
export interface EdgeMapping extends BaseViewObjectMapping, Omit<LineStyle, 'fontSize' | 'fontStyle' | 'fontFamily'> {
|
|
22
60
|
/**
|
|
23
61
|
* Name/definition of the connector to use. If you omit this, the default connector will be used.
|
|
24
62
|
*/
|
|
@@ -79,6 +117,10 @@ export interface EdgeMapping extends BaseViewObjectMapping, LineStyle {
|
|
|
79
117
|
* Optional spec for label font. Will use browser defaults if not specified (or CSS, but remember that CSS is not taken into account when you export an SVG from a diagram or an app using an SVG container)
|
|
80
118
|
*/
|
|
81
119
|
labelFont?: FontSpec;
|
|
120
|
+
/**
|
|
121
|
+
* Optional style for the label's background. This is ignored if `useHTMLLabel` is set to true.
|
|
122
|
+
*/
|
|
123
|
+
labelBackgroundStyle?: LabelBackgroundStyle;
|
|
82
124
|
/**
|
|
83
125
|
* Sets whether the label can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the label will be made rotatable in "legible" mode, in which VisuallyJs ensures that the label is always easy to read, by avoiding rotating the text so that it is upside down or other awkward to read. You can set "strict" mode, which will rotate the label to the appropriate angle regardless of whether or not it will make the label difficult to read.
|
|
84
126
|
*/
|
|
@@ -10,6 +10,10 @@ export interface PropertyMapping<D> {
|
|
|
10
10
|
* Property or properties to map. If an array is provided, values are matched against all properties in the order given.
|
|
11
11
|
*/
|
|
12
12
|
property: string | Array<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Optional name to use for the mapping in the UI (for example, in an inspector)
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
13
17
|
/**
|
|
14
18
|
* A map whose keys are expected values for the given property (or a space-separated string of values if an array of properties was provided), and the values are the type to apply.
|
|
15
19
|
*/
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.2.
|
|
1
|
+
export declare const VERSION = "1.2.7";
|