@visuallyjs/browser-ui 1.0.2 → 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 +56 -56
- 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 +16 -6
- 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 +1 -31
- 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
|
@@ -3,6 +3,8 @@ import { ChartModelFilter } from "./base-chart";
|
|
|
3
3
|
import { SeriesBasedChart } from "./series-based-chart";
|
|
4
4
|
/**
|
|
5
5
|
* Base definition for a chart data source.
|
|
6
|
+
* @group Charts
|
|
7
|
+
* @internal
|
|
6
8
|
*/
|
|
7
9
|
export interface ChartDataSource {
|
|
8
10
|
/**
|
|
@@ -17,6 +19,8 @@ export interface ChartDataSource {
|
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Implementation of data source that returns no data. Used in charts initially, before anything is loaded.
|
|
22
|
+
* @group Charts
|
|
23
|
+
* @internal
|
|
20
24
|
*/
|
|
21
25
|
export declare class BlankDataSource implements ChartDataSource {
|
|
22
26
|
load(onLoad: () => any): void;
|
|
@@ -24,6 +28,8 @@ export declare class BlankDataSource implements ChartDataSource {
|
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* Base data source for a SeriesBasedChart.
|
|
31
|
+
* @internal
|
|
32
|
+
* @group Charts
|
|
27
33
|
*/
|
|
28
34
|
export declare abstract class BaseSeriesBasedChartDataSource implements ChartDataSource {
|
|
29
35
|
chart: SeriesBasedChart<any>;
|
|
@@ -34,6 +40,8 @@ export declare abstract class BaseSeriesBasedChartDataSource implements ChartDat
|
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* Data source for a SeriesBasedChart that reads data from an array of objects.
|
|
43
|
+
* @group Charts
|
|
44
|
+
* @internal
|
|
37
45
|
*/
|
|
38
46
|
export declare class DataSeriesBasedDataSource extends BaseSeriesBasedChartDataSource {
|
|
39
47
|
chart: SeriesBasedChart<any>;
|
|
@@ -42,6 +50,8 @@ export declare class DataSeriesBasedDataSource extends BaseSeriesBasedChartDataS
|
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* Data source for a SeriesBasedChart that reads data from a URL. The data returned by the URL is expected to be an array of objects.
|
|
53
|
+
* @group Charts
|
|
54
|
+
* @internal
|
|
45
55
|
*/
|
|
46
56
|
export declare class UrlSeriesBasedDataSource extends BaseSeriesBasedChartDataSource {
|
|
47
57
|
chart: SeriesBasedChart<any>;
|
|
@@ -51,6 +61,7 @@ export declare class UrlSeriesBasedDataSource extends BaseSeriesBasedChartDataSo
|
|
|
51
61
|
}
|
|
52
62
|
/**
|
|
53
63
|
* Data source for a SeriesBasedChart that reads data from a VisuallyJsModel or Selection.
|
|
64
|
+
* @group Charts
|
|
54
65
|
*/
|
|
55
66
|
export declare class ModelSeriesBasedDataSource extends BaseSeriesBasedChartDataSource {
|
|
56
67
|
chart: SeriesBasedChart<any>;
|
|
@@ -54,9 +54,12 @@ export interface AxisCommon {
|
|
|
54
54
|
lineElement?: ChartSVGElement;
|
|
55
55
|
font: FontSpec;
|
|
56
56
|
crosshair: boolean | CrosshairOptions;
|
|
57
|
+
labelColor: string;
|
|
58
|
+
labelColorGenerator?: (v: number, idx: number) => string;
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
59
61
|
* Common properties for value and category axes.
|
|
62
|
+
* @group Charts
|
|
60
63
|
*/
|
|
61
64
|
export interface AxisDefinitionCommon {
|
|
62
65
|
/**
|
|
@@ -87,6 +90,8 @@ export interface AxisDefinitionCommon {
|
|
|
87
90
|
* Whether to show a crosshair for this axis. If you supply 'true', defaults will be used. Otherwise you can supply options to customise the crosshair.
|
|
88
91
|
*/
|
|
89
92
|
crosshair?: boolean | CrosshairOptions;
|
|
93
|
+
labelColor?: string;
|
|
94
|
+
labelColorGenerator?: (v: any, idx: number) => string;
|
|
90
95
|
}
|
|
91
96
|
/**
|
|
92
97
|
* A value axis displays a set of values. It may be in either the X or Y axis, depending on how the chart is setup. For example, in a bar chart, the value axis is on the X axis, and the category axis is on the Y axis, but for a column chart it's the other way around. Scatter and bubble charts have a value axis in both X and Y.
|
|
@@ -122,6 +127,10 @@ export interface ValueAxisDefinition extends AxisDefinitionCommon {
|
|
|
122
127
|
* Optional formatter for all value labels.
|
|
123
128
|
*/
|
|
124
129
|
labelFormatter?: (value: number) => string;
|
|
130
|
+
/**
|
|
131
|
+
* Optional fixed step size for the axis scale.
|
|
132
|
+
*/
|
|
133
|
+
step?: number;
|
|
125
134
|
/**
|
|
126
135
|
* Whether or not to invert the axis. If true, the axis will run from max to min instead of min to max.
|
|
127
136
|
*/
|
|
@@ -143,6 +152,7 @@ export interface ValueAxis extends AxisCommon {
|
|
|
143
152
|
domain: string;
|
|
144
153
|
stackedDomain?: string;
|
|
145
154
|
isPercent?: boolean;
|
|
155
|
+
step?: number;
|
|
146
156
|
labelPrefix?: string;
|
|
147
157
|
/**
|
|
148
158
|
* Optional suffix for all value labels. Will be ignored if you provide a `labelFormatter`.
|
|
@@ -12,7 +12,10 @@ export type AxisDomainKey = "x" | "y" | "xStacked" | "yStacked" | "r" | (string
|
|
|
12
12
|
export interface DomainExtent {
|
|
13
13
|
min: number;
|
|
14
14
|
max: number;
|
|
15
|
+
step?: number;
|
|
15
16
|
stepCount?: number;
|
|
17
|
+
minLimit?: number;
|
|
18
|
+
maxLimit?: number;
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
21
|
* Extents by domain key.
|
|
@@ -27,6 +30,7 @@ export type DomainExtentMap = Partial<Record<AxisDomainKey, DomainExtent>>;
|
|
|
27
30
|
export type DomainOverrideMap = Partial<Record<AxisDomainKey, {
|
|
28
31
|
min?: number;
|
|
29
32
|
max?: number;
|
|
33
|
+
step?: number;
|
|
30
34
|
}>>;
|
|
31
35
|
/**
|
|
32
36
|
* Output: scales by domain.
|
package/types/charts/legend.d.ts
CHANGED
|
@@ -84,6 +84,8 @@ export interface PieChartOptions extends SeriesBasedChartOptions<RecordBasedSeri
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Defines the data point type used in a PieChart. The object that is passed to a color generator is of this type.
|
|
87
|
+
* @group Charts
|
|
88
|
+
* @category Pie Chart
|
|
87
89
|
*/
|
|
88
90
|
export type PieChartDataPoint = {
|
|
89
91
|
/**
|
|
@@ -55,6 +55,7 @@ export declare const CLASS_SANKEY_NODE = "vjs-sankey-node";
|
|
|
55
55
|
export declare const CLASS_SANKEY_LABEL = "vjs-sankey-label";
|
|
56
56
|
/**
|
|
57
57
|
* Options for Sankey diagram
|
|
58
|
+
* @group Charts
|
|
58
59
|
*/
|
|
59
60
|
export interface SankeyOptions extends Omit<BaseChartOptions, "data"> {
|
|
60
61
|
/**
|
|
@@ -13,6 +13,8 @@ export declare const DEFAULT_ARRAY_SERIES_ID_FIELD = "id";
|
|
|
13
13
|
* Definition of a function that can generate labels for an array series.
|
|
14
14
|
* @param index The index of the data point for which we need a label
|
|
15
15
|
* @param data The data object from which the series is being populated
|
|
16
|
+
* @group Charts
|
|
17
|
+
* @category Definitions
|
|
16
18
|
*/
|
|
17
19
|
export type ArraySeriesLabelGenerator = (index: number, data: ObjectData) => string;
|
|
18
20
|
/**
|
|
@@ -5,6 +5,8 @@ import { ArrayBasedSeries } from "./array-based-series";
|
|
|
5
5
|
import { CollationSeries } from "./collation-series";
|
|
6
6
|
/**
|
|
7
7
|
* Defines a function that can resolve a custom SVG marker for a specific data point.
|
|
8
|
+
* @group Charts
|
|
9
|
+
* @category Definitions
|
|
8
10
|
*/
|
|
9
11
|
export type MarkerResolutionFunction = (point: ObjectData) => string;
|
|
10
12
|
/**
|
|
@@ -5,6 +5,7 @@ import { ChartSVGElement } from "./util";
|
|
|
5
5
|
import { DataSource, ObjectData } from "../core";
|
|
6
6
|
/**
|
|
7
7
|
* Base options for a series based chart
|
|
8
|
+
* @group Charts
|
|
8
9
|
*/
|
|
9
10
|
export interface SeriesBasedChartOptions<T extends ChartSeriesOptions> extends BaseChartOptions {
|
|
10
11
|
/**
|
|
@@ -4,6 +4,7 @@ import { RealisedSeries } from "./series/definitions";
|
|
|
4
4
|
import { DualValueChartSeries } from "./series";
|
|
5
5
|
/**
|
|
6
6
|
* Options for a tooltip
|
|
7
|
+
* @group Charts
|
|
7
8
|
*/
|
|
8
9
|
export interface TooltipOptions {
|
|
9
10
|
/**
|
|
@@ -53,6 +54,7 @@ export interface TooltipOptions {
|
|
|
53
54
|
export declare const CLASS_VJS_TOOLTIP = "vjs-tooltip";
|
|
54
55
|
/**
|
|
55
56
|
* Extension of the template renderer to handle tooltips. Only `b`, `strong`, `em` and `br` elements are supported.
|
|
57
|
+
* @internal
|
|
56
58
|
*/
|
|
57
59
|
export declare class TooltipRenderer extends BrowserUiRecado {
|
|
58
60
|
$adt: Array<AbstractEntry>;
|
|
@@ -63,6 +65,7 @@ export declare class TooltipRenderer extends BrowserUiRecado {
|
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
65
67
|
* Definition of the `series` object passed to a Tooltip
|
|
68
|
+
* @group Charts
|
|
66
69
|
*/
|
|
67
70
|
export type TooltipDataSeries = {
|
|
68
71
|
/**
|
|
@@ -92,6 +95,7 @@ export type TooltipDataSeries = {
|
|
|
92
95
|
};
|
|
93
96
|
/**
|
|
94
97
|
* Definition of the `point` object passed to a Tooltip. Not every chart type provides every field - see the individual chart docs for discussions.
|
|
98
|
+
* @group Charts
|
|
95
99
|
*/
|
|
96
100
|
export type TooltipDataPoint = {
|
|
97
101
|
/**
|
|
@@ -124,7 +128,9 @@ export type TooltipDataPoint = {
|
|
|
124
128
|
stackTotal?: number;
|
|
125
129
|
};
|
|
126
130
|
/**
|
|
127
|
-
* A tooltip created for
|
|
131
|
+
* A tooltip created for Charts. Users of the API dont interact directly with Tooltips
|
|
132
|
+
* @group Charts
|
|
133
|
+
* @internal
|
|
128
134
|
*/
|
|
129
135
|
export declare class Tooltip {
|
|
130
136
|
private parentElement;
|
|
@@ -150,7 +156,6 @@ export declare class Tooltip {
|
|
|
150
156
|
* @protected
|
|
151
157
|
*/
|
|
152
158
|
protected show(position: PointXY, tooltipAnchor: PointXY, payload: ObjectData): void;
|
|
153
|
-
protected showAtPageLocation(pageLocation: PointXY, tooltipAnchor: PointXY, payload: ObjectData): void;
|
|
154
159
|
hide(): void;
|
|
155
160
|
}
|
|
156
161
|
export declare class CategoryValueTooltip extends Tooltip {
|
package/types/charts/util.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface SteppedScale extends SteppedScaleCandidate {
|
|
|
29
29
|
* @param candidateStep
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
|
-
export declare function _calculateSteps(min: number, max: number, candidateStep: number): SteppedScaleCandidate;
|
|
32
|
+
export declare function _calculateSteps(min: number, max: number, candidateStep: number, minLimit?: number, maxLimit?: number): SteppedScaleCandidate;
|
|
33
33
|
/**
|
|
34
34
|
* For some given min/max, compute the ideal step size to use as a range. candidateStep is
|
|
35
35
|
* the first value to try; it might be ideal, in which case we use it. But if not, we try
|
|
@@ -39,14 +39,14 @@ export declare function _calculateSteps(min: number, max: number, candidateStep:
|
|
|
39
39
|
* @param candidateStep
|
|
40
40
|
* @internal
|
|
41
41
|
*/
|
|
42
|
-
export declare function _findIdealSteps(min: number, max: number, candidateStep: number, idealStepCount: number): SteppedScale;
|
|
42
|
+
export declare function _findIdealSteps(min: number, max: number, candidateStep: number, idealStepCount: number, minLimit?: number, maxLimit?: number): SteppedScale;
|
|
43
43
|
/**
|
|
44
44
|
* Calculates a reasonable scale for the dataset with the given min and max.
|
|
45
45
|
* @param min
|
|
46
46
|
* @param max
|
|
47
47
|
* @internal
|
|
48
48
|
*/
|
|
49
|
-
export declare function $autoCalculateChartScale(min: number, max: number, idealStepCount?: number): SteppedScale;
|
|
49
|
+
export declare function $autoCalculateChartScale(min: number, max: number, idealStepCount?: number, minLimit?: number, maxLimit?: number): SteppedScale;
|
|
50
50
|
/**
|
|
51
51
|
* Calculates a scale with the exact number of steps between min and max (inclusive). It is the call site's responsibility to ensure that the numbers all relate in such a way that the labels are reasonable.
|
|
52
52
|
* @param min
|
|
@@ -55,6 +55,11 @@ export declare function $autoCalculateChartScale(min: number, max: number, ideal
|
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
export declare function $calculateChartScaleWithSteps(min: number, max: number, stepCount: number): SteppedScale;
|
|
58
|
+
/**
|
|
59
|
+
* Calculates a scale with a fixed step between min and max.
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function $calculateChartScaleWithStep(min: number, max: number, step: number): SteppedScale;
|
|
58
63
|
/**
|
|
59
64
|
* Calculates the power of 10 corresponding to the given number, eg 625 000 gives '3'
|
|
60
65
|
* @param n
|
|
@@ -140,6 +145,8 @@ export declare function createContrastLabel(text: string, x: number, y: number,
|
|
|
140
145
|
* @param chart The chart to export.
|
|
141
146
|
* @param width Optional width for the output SVG.
|
|
142
147
|
* @param height Optional height for the output SVG.
|
|
148
|
+
* @group Charts
|
|
149
|
+
* @category Export
|
|
143
150
|
*/
|
|
144
151
|
export declare function exportSVG(chart: BaseChart, width?: number, height?: number): {
|
|
145
152
|
element: SVGElement;
|
|
@@ -3,6 +3,8 @@ import { ObjectData } from "./model/graph";
|
|
|
3
3
|
export declare const CSV = "csv";
|
|
4
4
|
/**
|
|
5
5
|
* Options for the CsvReader.
|
|
6
|
+
* @group Input and Output
|
|
7
|
+
* @category CSV Import
|
|
6
8
|
*/
|
|
7
9
|
export interface CsvReaderOptions {
|
|
8
10
|
/**
|
|
@@ -20,7 +22,8 @@ export interface CsvReaderOptions {
|
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* A class to read and process CSV data.
|
|
23
|
-
* @group
|
|
25
|
+
* @group Input and Output
|
|
26
|
+
* @category CSV Import
|
|
24
27
|
*/
|
|
25
28
|
export declare class CsvReader {
|
|
26
29
|
csv: string;
|
|
@@ -53,7 +56,8 @@ export declare class CsvReader {
|
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Options for a source,target,value CSV parser.
|
|
56
|
-
* @group
|
|
59
|
+
* @group Input and Output
|
|
60
|
+
* @category CSV Import
|
|
57
61
|
*/
|
|
58
62
|
export interface SourceValueTargetCsvParserOptions {
|
|
59
63
|
/**
|
|
@@ -80,5 +84,7 @@ export interface SourceValueTargetCsvParserOptions {
|
|
|
80
84
|
* @param model
|
|
81
85
|
* @param parameters Optional parameters (currently unused in this implementation).
|
|
82
86
|
* @returns An object containing nodes and edges.
|
|
87
|
+
* @group Input and Output
|
|
88
|
+
* @category CSV Import
|
|
83
89
|
*/
|
|
84
90
|
export declare const SourceValueTargetCsvParser: (csv: string, model: VisuallyJsModel, parameters?: SourceValueTargetCsvParserOptions) => void;
|
|
@@ -54,17 +54,21 @@ export declare const EVENT_DATA_APPEND_END = "dataAppendEnd";
|
|
|
54
54
|
* Event fired alongside any other operation that results in the data being updated. This event is
|
|
55
55
|
* fired often and is used by various internal classes.
|
|
56
56
|
* @event
|
|
57
|
+
* @group Events
|
|
58
|
+
* @category Model
|
|
57
59
|
*/
|
|
58
60
|
export declare const EVENT_DATA_UPDATED = "dataUpdated";
|
|
59
61
|
/**
|
|
60
62
|
* Fired immediately prior to the graph being cleared.
|
|
61
63
|
* @event
|
|
64
|
+
* @group Events
|
|
62
65
|
* @category Model
|
|
63
66
|
*/
|
|
64
67
|
export declare const EVENT_GRAPH_CLEAR_START = "graphClearStart";
|
|
65
68
|
/**
|
|
66
69
|
* Fired immediately after the graph has been cleared.
|
|
67
70
|
* @event
|
|
71
|
+
* @group Events
|
|
68
72
|
* @category Model
|
|
69
73
|
*/
|
|
70
74
|
export declare const EVENT_GRAPH_CLEARED = "graphCleared";
|
|
@@ -76,6 +80,7 @@ export declare const EVENT_GRAPH_CHANGED = "graphChanged";
|
|
|
76
80
|
/**
|
|
77
81
|
* Fired when a group has been updated in the model.
|
|
78
82
|
* @event
|
|
83
|
+
* @group Events
|
|
79
84
|
* @category Model
|
|
80
85
|
* @payload GroupUpdatedParams
|
|
81
86
|
*/
|
|
@@ -83,6 +88,7 @@ export declare const EVENT_GROUP_UPDATED = "group:updated";
|
|
|
83
88
|
/**
|
|
84
89
|
* Fired when a node has been updated in the model.
|
|
85
90
|
* @event
|
|
91
|
+
* @group Events
|
|
86
92
|
* @category Model
|
|
87
93
|
* @payload NodeUpdatedParams
|
|
88
94
|
*/
|
|
@@ -90,6 +96,7 @@ export declare const EVENT_NODE_UPDATED = "node:updated";
|
|
|
90
96
|
/**
|
|
91
97
|
* Fired when a port has been updated in the model.
|
|
92
98
|
* @event
|
|
99
|
+
* @group Events
|
|
93
100
|
* @category Model
|
|
94
101
|
* @payload PortUpdatedParams
|
|
95
102
|
*/
|
|
@@ -97,6 +104,7 @@ export declare const EVENT_PORT_UPDATED = "port:updated";
|
|
|
97
104
|
/**
|
|
98
105
|
* Fired when an edge has been updated in the model.
|
|
99
106
|
* @event
|
|
107
|
+
* @group Events
|
|
100
108
|
* @category Model
|
|
101
109
|
* @payload EdgeUpdatedParams
|
|
102
110
|
*/
|
|
@@ -104,6 +112,7 @@ export declare const EVENT_EDGE_UPDATED = "edge:updated";
|
|
|
104
112
|
/**
|
|
105
113
|
* Fired when an edge has been added to the model.
|
|
106
114
|
* @event
|
|
115
|
+
* @group Events
|
|
107
116
|
* @category Model
|
|
108
117
|
* @payload EdgeAddedParams
|
|
109
118
|
*/
|
|
@@ -111,6 +120,7 @@ export declare const EVENT_EDGE_ADDED = "edge:added";
|
|
|
111
120
|
/**
|
|
112
121
|
* Fired when a node has been added to the model.
|
|
113
122
|
* @event
|
|
123
|
+
* @group Events
|
|
114
124
|
* @category Model
|
|
115
125
|
* @payload NodeAddedParams
|
|
116
126
|
*/
|
|
@@ -118,6 +128,7 @@ export declare const EVENT_NODE_ADDED = "node:added";
|
|
|
118
128
|
/**
|
|
119
129
|
* Fired when an edge has been removed from the model.
|
|
120
130
|
* @event
|
|
131
|
+
* @group Events
|
|
121
132
|
* @category Model
|
|
122
133
|
* @payload EdgeRemovedParams
|
|
123
134
|
*/
|
|
@@ -125,6 +136,7 @@ export declare const EVENT_EDGE_REMOVED = "edge:removed";
|
|
|
125
136
|
/**
|
|
126
137
|
* Fired when a node has been removed from the model.
|
|
127
138
|
* @event
|
|
139
|
+
* @group Events
|
|
128
140
|
* @category Model
|
|
129
141
|
* @payload NodeRemovedParams
|
|
130
142
|
*/
|
|
@@ -132,6 +144,7 @@ export declare const EVENT_NODE_REMOVED = "node:removed";
|
|
|
132
144
|
/**
|
|
133
145
|
* Fired when a port has been added to the model.
|
|
134
146
|
* @event
|
|
147
|
+
* @group Events
|
|
135
148
|
* @category Model
|
|
136
149
|
* @payload PortAddedParams
|
|
137
150
|
*/
|
|
@@ -139,6 +152,7 @@ export declare const EVENT_PORT_ADDED = "port:added";
|
|
|
139
152
|
/**
|
|
140
153
|
* Fired when a port has been removed from the model.
|
|
141
154
|
* @event
|
|
155
|
+
* @group Events
|
|
142
156
|
* @category Model
|
|
143
157
|
* @payload PortRemovedParams
|
|
144
158
|
*/
|
|
@@ -146,6 +160,7 @@ export declare const EVENT_PORT_REMOVED = "port:removed";
|
|
|
146
160
|
/**
|
|
147
161
|
* Fired when the target of some edge has changed
|
|
148
162
|
* @event
|
|
163
|
+
* @group Events
|
|
149
164
|
* @category Model
|
|
150
165
|
* @payload EdgeTargetChangedParams
|
|
151
166
|
*/
|
|
@@ -153,6 +168,7 @@ export declare const EVENT_EDGE_TARGET_CHANGED = "edge:target";
|
|
|
153
168
|
/**
|
|
154
169
|
* Fired when the source of some edge has changed
|
|
155
170
|
* @event
|
|
171
|
+
* @group Events
|
|
156
172
|
* @category Model
|
|
157
173
|
* @payload EdgeSourceChangedParams
|
|
158
174
|
*/
|
|
@@ -160,6 +176,7 @@ export declare const EVENT_EDGE_SOURCE_CHANGED = "edge:source";
|
|
|
160
176
|
/**
|
|
161
177
|
* Fired when an object is added to a selection
|
|
162
178
|
* @event
|
|
179
|
+
* @group Events
|
|
163
180
|
* @category Model
|
|
164
181
|
* @payload SelectionParams
|
|
165
182
|
*/
|
|
@@ -167,6 +184,7 @@ export declare const EVENT_SELECT = "select";
|
|
|
167
184
|
/**
|
|
168
185
|
* Fired when an object is removed from a selection
|
|
169
186
|
* @event
|
|
187
|
+
* @group Events
|
|
170
188
|
* @category Model
|
|
171
189
|
* @payload SelectionParams
|
|
172
190
|
*/
|
|
@@ -174,6 +192,7 @@ export declare const EVENT_DESELECT = "deselect";
|
|
|
174
192
|
/**
|
|
175
193
|
* Fired when a selection is cleared.
|
|
176
194
|
* @event
|
|
195
|
+
* @group Events
|
|
177
196
|
* @category Model
|
|
178
197
|
* @payload SelectionClearedParams
|
|
179
198
|
*/
|
|
@@ -181,41 +200,48 @@ export declare const EVENT_SELECTION_CLEARED = "selection:cleared";
|
|
|
181
200
|
/**
|
|
182
201
|
* Fired by the model when the geometry for an edge has changed
|
|
183
202
|
* @event
|
|
203
|
+
* @group Events
|
|
184
204
|
* @category Model
|
|
185
205
|
*/
|
|
186
206
|
export declare const EVENT_EDGE_GEOMETRY = "edge:geometry";
|
|
187
207
|
/**
|
|
188
208
|
* Fired by the UI when the user has made some edits to an edge path
|
|
189
209
|
* @event
|
|
210
|
+
* @group Events
|
|
190
211
|
* @category UI
|
|
191
212
|
*/
|
|
192
213
|
export declare const EVENT_EDGE_PATH_EDITED = "edge:pathEdited";
|
|
193
214
|
/**
|
|
194
215
|
* Fired by the model when the type of a node has changed.
|
|
195
216
|
* @event
|
|
217
|
+
* @group Events
|
|
196
218
|
* @category Model
|
|
197
219
|
*/
|
|
198
220
|
export declare const EVENT_EDGE_TYPE_CHANGED = "edge:typeChanged";
|
|
199
221
|
/**
|
|
200
222
|
* Fired by the model when the type of a node has changed.
|
|
201
223
|
* @event
|
|
224
|
+
* @group Events
|
|
202
225
|
* @category Model
|
|
203
226
|
*/
|
|
204
227
|
export declare const EVENT_NODE_TYPE_CHANGED = "node:typeChanged";
|
|
205
228
|
/**
|
|
206
229
|
* Fired by the model when the type of a port has changed.
|
|
207
230
|
* @event
|
|
231
|
+
* @group Events
|
|
208
232
|
* @category Model
|
|
209
233
|
*/
|
|
210
234
|
export declare const EVENT_PORT_TYPE_CHANGED = "port:typeChanged";
|
|
211
235
|
/**
|
|
212
236
|
* Fired by the model when the type of a group has changed.
|
|
213
237
|
* @event
|
|
238
|
+
* @group Events
|
|
214
239
|
* @category Model
|
|
215
240
|
*/
|
|
216
241
|
export declare const EVENT_GROUP_TYPE_CHANGED = "group:typeChanged";
|
|
217
242
|
/**
|
|
218
243
|
* Fired as the user starts to drag a group
|
|
244
|
+
* @group Events
|
|
219
245
|
* @category UI
|
|
220
246
|
* @payload VertexMoveStartParams
|
|
221
247
|
* @event
|
|
@@ -224,6 +250,7 @@ export declare const EVENT_GROUP_TYPE_CHANGED = "group:typeChanged";
|
|
|
224
250
|
export declare const EVENT_GROUP_MOVE_START = "group:move:start";
|
|
225
251
|
/**
|
|
226
252
|
* Fired each time the mouse/pointer moves while a group is being dragged.
|
|
253
|
+
* @group Events
|
|
227
254
|
* @category UI
|
|
228
255
|
* @payload VertexMoveParams
|
|
229
256
|
* @event
|
|
@@ -232,6 +259,7 @@ export declare const EVENT_GROUP_MOVE_START = "group:move:start";
|
|
|
232
259
|
export declare const EVENT_GROUP_MOVE = "group:move";
|
|
233
260
|
/**
|
|
234
261
|
* Fired at the end of a group drag
|
|
262
|
+
* @group Events
|
|
235
263
|
* @category UI
|
|
236
264
|
* @payload VertexMoveEndParams
|
|
237
265
|
* @event
|
|
@@ -257,6 +285,7 @@ export declare const EVENT_INTERNAL_GROUP_SIZE_CHANGED_UNDO = "internal:group:si
|
|
|
257
285
|
export declare const EVENT_RENDERER_ADDED = "renderer:added";
|
|
258
286
|
/**
|
|
259
287
|
* Fired as the user starts to drag a node
|
|
288
|
+
* @group Events
|
|
260
289
|
* @category UI
|
|
261
290
|
* @payload VertexMoveStartParams
|
|
262
291
|
* @event
|
|
@@ -265,6 +294,7 @@ export declare const EVENT_RENDERER_ADDED = "renderer:added";
|
|
|
265
294
|
export declare const EVENT_NODE_MOVE_START = "node:move:start";
|
|
266
295
|
/**
|
|
267
296
|
* Fired each time the mouse/pointer moves while a node is being dragged.
|
|
297
|
+
* @group Events
|
|
268
298
|
* @category UI
|
|
269
299
|
* @payload VertexMoveParams
|
|
270
300
|
* @event
|
|
@@ -273,29 +303,40 @@ export declare const EVENT_NODE_MOVE_START = "node:move:start";
|
|
|
273
303
|
export declare const EVENT_NODE_MOVE = "node:move";
|
|
274
304
|
/**
|
|
275
305
|
* Fired at the end of a node drag
|
|
306
|
+
* @group Events
|
|
276
307
|
* @category UI
|
|
277
308
|
* @payload VertexMoveEndParams
|
|
278
309
|
* @event
|
|
279
310
|
* @context element-dragging
|
|
280
311
|
*/
|
|
281
312
|
export declare const EVENT_NODE_MOVE_END = "node:move:end";
|
|
313
|
+
/**
|
|
314
|
+
* Fired if a node drag is aborted
|
|
315
|
+
* @group Events
|
|
316
|
+
* @category UI
|
|
317
|
+
* @payload VertexMoveStartParams
|
|
318
|
+
* @event
|
|
319
|
+
* @context element-dragging
|
|
320
|
+
*/
|
|
321
|
+
export declare const EVENT_NODE_MOVE_ABORT = "node:move:abort";
|
|
282
322
|
/**
|
|
283
323
|
* Fired when the undo/redo manager has performed an undo or a redo.
|
|
284
324
|
* @event
|
|
325
|
+
* @group Events
|
|
285
326
|
* @category Model
|
|
286
327
|
* @context undo-redo
|
|
287
328
|
*/
|
|
288
329
|
export declare const EVENT_UNDOREDO_UPDATE = "undoredo:update";
|
|
289
330
|
/**
|
|
290
331
|
* Fired when the `undo` operation has occurred in the model
|
|
291
|
-
* @group
|
|
332
|
+
* @group Events
|
|
292
333
|
* @category Model
|
|
293
334
|
* @context undo-redo
|
|
294
335
|
*/
|
|
295
336
|
export declare const EVENT_UNDO = "undo";
|
|
296
337
|
/**
|
|
297
338
|
* Fired when the `redo` operation has occurred in the model
|
|
298
|
-
* @group
|
|
339
|
+
* @group Events
|
|
299
340
|
* @category Model
|
|
300
341
|
* @context undo-redo
|
|
301
342
|
*/
|
|
@@ -304,5 +345,6 @@ export declare const EVENT_REDO = "redo";
|
|
|
304
345
|
* Fired when a renderer is destroyed.
|
|
305
346
|
* @event
|
|
306
347
|
* @category UI
|
|
348
|
+
* @group Events
|
|
307
349
|
*/
|
|
308
350
|
export declare const EVENT_DESTROY = "destroy";
|
package/types/core/geom.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export declare function rectanglesIntersect(r1: RectangleXY, r2: RectangleXY): b
|
|
|
79
79
|
* Computes how much the two rectangles overlap, in square units.
|
|
80
80
|
* @param r1
|
|
81
81
|
* @param r2
|
|
82
|
+
* @internal
|
|
82
83
|
*/
|
|
83
84
|
export declare function computeRectangleIntersection(r1: RectangleXY, r2: RectangleXY): number;
|
|
84
85
|
/**
|
package/types/core/io.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { PointXY, Geometry } from "./util";
|
|
|
4
4
|
import { ObjectAnchorSpec } from "./model/anchor";
|
|
5
5
|
/**
|
|
6
6
|
* Options for a URL fetch.
|
|
7
|
-
* @group
|
|
8
|
-
* @category
|
|
7
|
+
* @group Input and Output
|
|
8
|
+
* @category Model
|
|
9
9
|
*/
|
|
10
10
|
export interface UrlFetchOptions {
|
|
11
11
|
type?: string;
|
|
@@ -18,18 +18,19 @@ export interface UrlFetchOptions {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Definition of a function that can parse JSON into a model. This is a high level interface that makes no assumptions about data format. You won't need to use this type unless you are writing your own parser.
|
|
21
|
-
* @group
|
|
22
|
-
* @category
|
|
21
|
+
* @group Input and Output
|
|
22
|
+
* @category Model
|
|
23
23
|
*/
|
|
24
24
|
export type Parser = (data: any, instance: VisuallyJsModel, parameters?: any) => any;
|
|
25
25
|
/**
|
|
26
26
|
* Definition of a function that can export the contents of a model. This is a high level interface that makes no assumptions about data format. You won't need to use this type unless you are writing your own exporter.
|
|
27
|
-
* @group
|
|
28
|
-
* @category
|
|
27
|
+
* @group Input and Output
|
|
28
|
+
* @category Model
|
|
29
29
|
*/
|
|
30
30
|
export type Exporter = (instance: VisuallyJsModel, parameters: any) => any;
|
|
31
31
|
/**
|
|
32
32
|
* The default type that represents an edge in a dataset to load or a saved dataset
|
|
33
|
+
* @group Model
|
|
33
34
|
*/
|
|
34
35
|
export interface EdgeData {
|
|
35
36
|
/**
|
|
@@ -66,15 +67,17 @@ export interface EdgeData {
|
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* The default type that represents a node in a dataset to load or a saved dataset
|
|
70
|
+
* @group Data Model
|
|
69
71
|
*/
|
|
70
72
|
export type NodeData = Record<string, any>;
|
|
71
73
|
/**
|
|
72
74
|
* The default type that represents a group in a dataset to load or a saved dataset
|
|
75
|
+
* @group Data Model
|
|
73
76
|
*/
|
|
74
77
|
export type GroupData = Record<string, any>;
|
|
75
78
|
/**
|
|
76
79
|
* The default JSON format, consisting of optional lists of nodes, edges and groups.
|
|
77
|
-
* @group Model
|
|
80
|
+
* @group Data Model
|
|
78
81
|
* @category Input and Output
|
|
79
82
|
*/
|
|
80
83
|
export interface VisuallyJsDefaultJSON {
|
|
@@ -93,8 +96,29 @@ export interface VisuallyJsDefaultJSON {
|
|
|
93
96
|
}
|
|
94
97
|
export declare const JSON_DATATYPE = "json";
|
|
95
98
|
export declare const HIERARCHICAL_JSON_DATATYPE = "hierarchical-json";
|
|
99
|
+
/**
|
|
100
|
+
* Register a parser for some given datatype
|
|
101
|
+
* @param name The name you will use to refer to the datatype.
|
|
102
|
+
* @param p Parser for the datatype
|
|
103
|
+
* @group Data Model
|
|
104
|
+
* @category Input and Output
|
|
105
|
+
*/
|
|
96
106
|
export declare function registerParser(name: string, p: Parser): void;
|
|
107
|
+
/**
|
|
108
|
+
* Register an exporter for some given datatype
|
|
109
|
+
* @param name The name you will use to refer to the datatype.
|
|
110
|
+
* @param p Exporter for the datatype
|
|
111
|
+
* @group Data Model
|
|
112
|
+
* @category Input and Output
|
|
113
|
+
*/
|
|
97
114
|
export declare function registerExporter(name: string, p: Exporter): void;
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
* @param type
|
|
118
|
+
* @param source
|
|
119
|
+
* @param instance
|
|
120
|
+
* @param parameters
|
|
121
|
+
*/
|
|
98
122
|
export declare function parse(type: string, source: any, instance: VisuallyJsModel, parameters: any): any;
|
|
99
123
|
/**
|
|
100
124
|
* Internal method that handles data export, by looking for an exporter registered for the given `type`.
|