@visuallyjs/browser-ui 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/js/visuallyjs.browser-ui.cjs.js +57 -57
  2. package/js/visuallyjs.browser-ui.esm.js +57 -57
  3. package/package.json +1 -1
  4. package/types/browser-ui/browser-ui.d.ts +4 -7
  5. package/types/browser-ui/browser-util.d.ts +1 -0
  6. package/types/browser-ui/browser-visuallyjs-instance.d.ts +12 -6
  7. package/types/browser-ui/components/controls/css-classes.d.ts +24 -0
  8. package/types/browser-ui/components/inspector/color-picker-tag.d.ts +6 -0
  9. package/types/browser-ui/components/palette/palette.d.ts +1 -0
  10. package/types/browser-ui/connector-editors/editor-base.d.ts +0 -1
  11. package/types/browser-ui/connector-editors/util.d.ts +0 -2
  12. package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +0 -12
  13. package/types/browser-ui/constants.d.ts +4 -10
  14. package/types/browser-ui/css-constants.d.ts +57 -8
  15. package/types/browser-ui/definitions.d.ts +27 -6
  16. package/types/browser-ui/dialogs/binder.d.ts +0 -11
  17. package/types/browser-ui/edge-handler-base.d.ts +9 -16
  18. package/types/browser-ui/edge-input-handler.d.ts +3 -10
  19. package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +2 -1
  20. package/types/browser-ui/element-drag-handler-2.d.ts +0 -3
  21. package/types/browser-ui/icons/definitions.d.ts +20 -0
  22. package/types/browser-ui/pan-zoom-options.d.ts +10 -21
  23. package/types/browser-ui/pan-zoom.d.ts +29 -114
  24. package/types/browser-ui/paper-renderer/definitions.d.ts +2 -0
  25. package/types/browser-ui/paper-renderer/paper.d.ts +1 -0
  26. package/types/browser-ui/plugins/background/background-options.d.ts +4 -0
  27. package/types/browser-ui/plugins/background/tiled-background.d.ts +2 -0
  28. package/types/browser-ui/plugins/browser-ui-plugin.d.ts +6 -1
  29. package/types/browser-ui/positioning-and-sizing-utils.d.ts +21 -1
  30. package/types/browser-ui/shape-library/shape-library-definitions.d.ts +26 -11
  31. package/types/browser-ui/shape-library/shape-library.d.ts +14 -3
  32. package/types/browser-ui/shape-library/shapes-basic.d.ts +1 -1
  33. package/types/browser-ui/shape-library/shapes-flowchart.d.ts +1 -1
  34. package/types/browser-ui/surface-renderer/anim/definitions.d.ts +13 -4
  35. package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +0 -1
  36. package/types/browser-ui/surface-renderer/definitions.d.ts +14 -3
  37. package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +8 -2
  38. package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +2 -0
  39. package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +4 -0
  40. package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +4 -1
  41. package/types/browser-ui/surface-renderer/diagrams/index.d.ts +4 -2
  42. package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +14 -0
  43. package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +2 -0
  44. package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +3 -1
  45. package/types/browser-ui/surface-renderer/plugins/index.d.ts +1 -0
  46. package/types/browser-ui/surface-renderer/plugins/list-manager/index.d.ts +1 -0
  47. package/types/browser-ui/surface-renderer/plugins/list-manager/list-manager-plugin.d.ts +34 -0
  48. package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +2 -0
  49. package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +1 -2
  50. package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +9 -0
  51. package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +12 -0
  52. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +0 -2
  53. package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +5 -2
  54. package/types/browser-ui/surface-renderer/shape-palette.d.ts +1 -1
  55. package/types/browser-ui/surface-renderer/surface-render-options.d.ts +0 -30
  56. package/types/browser-ui/surface-renderer/surface.d.ts +47 -38
  57. package/types/browser-ui/svg-export/definitions.d.ts +12 -0
  58. package/types/browser-ui/svg-export/image-exporter.d.ts +2 -0
  59. package/types/browser-ui/svg-export/svg-exporter.d.ts +3 -0
  60. package/types/browser-ui/templating/custom-tag-definition.d.ts +1 -2
  61. package/types/browser-ui/util.d.ts +2 -0
  62. package/types/charts/bar-and-column/bar-plot.d.ts +2 -0
  63. package/types/charts/base-chart.d.ts +62 -6
  64. package/types/charts/chart-exporter.d.ts +3 -0
  65. package/types/charts/datasource.d.ts +11 -0
  66. package/types/charts/definitions.d.ts +10 -0
  67. package/types/charts/domain_scale_utilities.d.ts +4 -0
  68. package/types/charts/legend.d.ts +2 -0
  69. package/types/charts/pie/pie-chart.d.ts +2 -0
  70. package/types/charts/sankey/sankey.d.ts +1 -0
  71. package/types/charts/scatter/definitions.d.ts +1 -0
  72. package/types/charts/series/array-based-series.d.ts +2 -0
  73. package/types/charts/series/definitions.d.ts +1 -0
  74. package/types/charts/series/series.d.ts +2 -0
  75. package/types/charts/series-based-chart.d.ts +1 -0
  76. package/types/charts/tooltip.d.ts +7 -2
  77. package/types/charts/util.d.ts +10 -3
  78. package/types/core/autosaver.d.ts +2 -1
  79. package/types/core/csv-loader.d.ts +8 -2
  80. package/types/core/event-constants.d.ts +44 -2
  81. package/types/core/geom.d.ts +1 -0
  82. package/types/core/io.d.ts +31 -7
  83. package/types/core/layout/abstract-layout.d.ts +1 -0
  84. package/types/core/layout/grid/definitions.d.ts +10 -19
  85. package/types/core/layout/grid/grid-layout.d.ts +2 -2
  86. package/types/core/layout/hierarchy/util.d.ts +1 -7
  87. package/types/core/magnetizer.d.ts +1 -0
  88. package/types/core/model/anchor.d.ts +1 -0
  89. package/types/core/model/graph.d.ts +3 -11
  90. package/types/core/model/group-template.d.ts +15 -0
  91. package/types/core/params.d.ts +2 -2
  92. package/types/core/renderer.d.ts +3 -0
  93. package/types/core/rtree/rtree.d.ts +15 -0
  94. package/types/core/selection.d.ts +2 -6
  95. package/types/core/templates/core.d.ts +1 -1
  96. package/types/core/toolkit.d.ts +30 -10
  97. package/types/core/undo-redo/undo-redo.d.ts +0 -22
  98. package/types/core/util.d.ts +4 -1
  99. package/types/ui/common/overlay.d.ts +3 -1
  100. package/types/ui/common/paint-style.d.ts +2 -0
  101. package/types/ui/connector-orthogonal/operations.d.ts +1 -18
  102. package/types/ui/connector-orthogonal/utils.d.ts +0 -6
  103. package/types/ui/connector-straight/straight-connector.d.ts +2 -5
  104. package/types/ui/core/component/component.d.ts +1 -4
  105. package/types/ui/core/connector/connection-impl.d.ts +1 -0
  106. package/types/ui/core/connector/connections.d.ts +0 -29
  107. package/types/ui/core/connector/straight-segment.d.ts +0 -6
  108. package/types/ui/core/constants.d.ts +0 -4
  109. package/types/ui/core/core-events.d.ts +5 -3
  110. package/types/ui/core/core.d.ts +19 -21
  111. package/types/ui/core/defaults.d.ts +43 -9
  112. package/types/ui/core/definitions.d.ts +39 -20
  113. package/types/ui/core/event-constants.d.ts +1 -0
  114. package/types/ui/core/factory/continuous-anchors.d.ts +0 -6
  115. package/types/ui/core/grid-profile.d.ts +3 -1
  116. package/types/ui/core/magnetize-profile.d.ts +1 -3
  117. package/types/ui/core/overlay/overlay.d.ts +2 -0
  118. package/types/ui/core/params.d.ts +8 -99
  119. package/types/ui/core/router/default-router.d.ts +89 -18
  120. package/types/ui/core/router/index.d.ts +0 -1
  121. package/types/ui/core/router/router-utils.d.ts +0 -24
  122. package/types/ui/core/router/router.d.ts +29 -20
  123. package/types/ui/core/type-descriptors.d.ts +2 -0
  124. package/types/ui/core/ui-model.d.ts +3 -0
  125. package/types/ui/core/view/edge-options.d.ts +1 -0
  126. package/types/ui/core/view/events.d.ts +22 -0
  127. package/types/ui/core/view/node-or-port-options.d.ts +6 -0
  128. package/types/ui/core/view/vertex-options.d.ts +2 -0
  129. package/types/ui/core/viewport.d.ts +7 -1
  130. package/types/ui/plugins/definitions.d.ts +6 -1
  131. package/types/ui/plugins/plugins.d.ts +4 -0
  132. package/types/ui/property-mappings/definitions.d.ts +6 -0
  133. package/types/ui/util/util.d.ts +3 -16
  134. package/types/version.d.ts +1 -1
  135. package/types/ui/core/router/base-router.d.ts +0 -100
@@ -46,36 +46,48 @@ interface HorizontalSnapRange extends SnapRange {
46
46
  * Assigned to both horizontal and vertical snaplines when active
47
47
  * @cssClass
48
48
  * @context snaplines
49
+ * @group Plugins
50
+ * @category Snaplines
49
51
  */
50
52
  export declare const CLASS_SNAPLINE = "vjs-snapline";
51
53
  /**
52
54
  * Assigned to vertical snaplines when active
53
55
  * @cssClass
54
56
  * @context snaplines
57
+ * @group Plugins
58
+ * @category Snaplines
55
59
  */
56
60
  export declare const CLASS_SNAPLINE_VERTICAL = "vjs-snapline-vertical";
57
61
  /**
58
62
  * Assigned to horizontal snaplines when active
59
63
  * @cssClass
60
64
  * @context snaplines
65
+ * @group Plugins
66
+ * @category Snaplines
61
67
  */
62
68
  export declare const CLASS_SNAPLINE_HORIZONTAL = "vjs-snapline-horizontal";
63
69
  /**
64
70
  * Assigned to both horizontal and vertical snaplines when the elements are exactly aligned
65
71
  * @cssClass
66
72
  * @context snaplines
73
+ * @group Plugins
74
+ * @category Snaplines
67
75
  */
68
76
  export declare const CLASS_SNAPLINE_EXACT = "vjs-snapline-exact";
69
77
  /**
70
78
  * Assigned to an element attached to an active snapline
71
79
  * @cssClass
72
80
  * @context snaplines
81
+ * @group Plugins
82
+ * @category Snaplines
73
83
  */
74
84
  export declare const CLASS_SNAPLINE_ACTIVE = "vjs-snapline-active";
75
85
  /**
76
86
  * Assigned to an element attached to an active snapline and the elements on the snapline are exactly aligned (parsed to integers).
77
87
  * @cssClass
78
88
  * @context snaplines
89
+ * @group Plugins
90
+ * @category Snaplines
79
91
  */
80
92
  export declare const CLASS_SNAPLINE_ACTIVE_EXACT = "vjs-snapline-active-exact";
81
93
  /**
@@ -59,6 +59,4 @@ export declare class VertexDrawingPlugin extends BaseBrowserUIPlugin implements
59
59
  private _addNewNode;
60
60
  private _resetSelectedElements;
61
61
  reset(): void;
62
- activated(): void;
63
- deactivated(): void;
64
62
  }
@@ -3,9 +3,9 @@ import { ShapeLibrary } from "../shape-library";
3
3
  import { DataGeneratorFunction, OnVertexAddedCallback } from "../definitions";
4
4
  import { PaletteMode } from "../components";
5
5
  /**
6
- * Options for a shape library palette.
6
+ * Options for a shape palette.
7
7
  * @group Components
8
- * @category ShapePalette
8
+ * @category Shape Palette
9
9
  */
10
10
  export interface ShapePaletteOptions<T extends ObjectData> {
11
11
  /**
@@ -98,6 +98,9 @@ export interface ShapePaletteOptions<T extends ObjectData> {
98
98
  }
99
99
  /**
100
100
  * Defines a wrapper around a shape with some `type` and `category` that adds properties (to be used to define the shape's appearance) and, optionally, the shape's initial size.
101
+ * @group Components
102
+ * @category Shape Palette
103
+ * @internal
101
104
  */
102
105
  export interface PreparedShape {
103
106
  /**
@@ -11,7 +11,7 @@ export declare const ATTRIBUTE_DATA_SHAPE_ID = "data-shape-id";
11
11
  /**
12
12
  * A palette for drag/drop that renders the contents of a shape library.
13
13
  * @group Components
14
- * @category ShapePalette
14
+ * @category Shape Palette
15
15
  */
16
16
  export declare class ShapePalette<T extends ObjectData> {
17
17
  private ui;
@@ -1,6 +1,5 @@
1
1
  import { ModelEventSpec, SurfaceMode } from './definitions';
2
2
  import { DecoratorSpec } from './surface-decorator';
3
- import { GridOptions } from "../../ui";
4
3
  import { BrowserElement } from "../util";
5
4
  import { CustomTagDefinition } from "../templating";
6
5
  import { IDecorator } from "./decorators";
@@ -8,7 +7,6 @@ import { SurfaceEventOptions } from "./surface-events";
8
7
  import { BrowserUIOptions } from "../definitions";
9
8
  import { PanOptions, WheelOptions, ZoomOptions } from "../pan-zoom-options";
10
9
  import { EdgeSnapOptions } from "../edge-handler-base";
11
- import { LayoutSpec } from "../../core";
12
10
  /**
13
11
  * This interface defines the allowed parameters on a `render` call that will create a new Surface.
14
12
  * @group Components
@@ -55,22 +53,6 @@ export interface SurfaceOptions extends BrowserUIOptions {
55
53
  * Optional map of handlers for various events generated by the Surface.
56
54
  */
57
55
  events?: SurfaceEventOptions;
58
- /**
59
- * Options for imposing a grid onto the elements in the Surface.
60
- */
61
- grid?: GridOptions;
62
- /**
63
- * Optional ID for the Surface. Allows you to retrieve this Surface from a model's `getRenderer(id)` method.
64
- */
65
- id?: string;
66
- /**
67
- * Defines the layout to use.
68
- */
69
- layout?: LayoutSpec;
70
- /**
71
- * Defaults to false. When true, the UI treats the vertex's DOM element as the DOM element for the port if it cannot find a specific element for the port.
72
- */
73
- logicalPorts?: boolean;
74
56
  /**
75
57
  * Mode to start in. Defaults to 'pan'.
76
58
  */
@@ -79,10 +61,6 @@ export interface SurfaceOptions extends BrowserUIOptions {
79
61
  * Optional map of event handlers. Each entry consists of the event name, a CSS selector to target, and a callback function. Supplying this is equivalent to calling `bindModelEvent(..)` on a Surface.
80
62
  */
81
63
  modelEvents?: Array<ModelEventSpec>;
82
- /**
83
- * When true, the Surface will run a `refresh` of the underlying layout whenever a new edge is established. This defaults to false, but you might want to set this to true if you're using the Hierarchical or Hierarchy layouts, because it has a bearing on the way they paint. However, if your users are able to drag vertices around, you may not wish for the layout to move things that they have placed, which is why this defaults to false.
84
- */
85
- refreshLayoutOnEdgeConnect?: boolean;
86
64
  /**
87
65
  * Defaults to false. When true, changes to a group cause the entire surface to perform a relayout.
88
66
  */
@@ -99,14 +77,6 @@ export interface SurfaceOptions extends BrowserUIOptions {
99
77
  * Options to control how a user pans the canvas.
100
78
  */
101
79
  pan?: PanOptions;
102
- /**
103
- * If true, zoom the display so that the dataset is entirely visible after initialisation.
104
- */
105
- zoomToFit?: boolean;
106
- /**
107
- * If true, zoom the display so that the dataset is entirely visible after initialisation, but only adjust the zoom level if the dataset is not already visible at the default zoom level.
108
- */
109
- zoomToFitIfNecessary?: boolean;
110
80
  }
111
81
  /**
112
82
  * Constructor options for the Surface in the browser-ui (vanilla) package.
@@ -6,7 +6,7 @@ import { UIPath } from '../ui-path';
6
6
  import { FixedElement, FixedElementConstraints } from "../fixed-layer";
7
7
  import { SurfaceOptions } from "./surface-render-options";
8
8
  import { Base, Node, Group, Edge, Port, Vertex, ObjectData, VisuallyJsSelection, PathOptions, DataSource, NodeRemovedParams, PointXY, RectangleXY, ZoomRange, LayoutResultSet, GroupRemovedParams } from '../../core';
9
- import { Connection, SupportsElementDragging, DragOptions, Overlay, ViewportBounds, UIExportOptions, ZoomToFitIfNecessaryOptions, ZoomToFitOptions, ZoomToElementsOptions, ViewportNodeElement, ViewportElement, ViewportGroupElement, CenterContentOptions, AlignContentOptions, AlignContentToFaceOptions } from "../../ui";
9
+ import { Connection, SupportsElementDragging, DragOptions, Overlay, ViewportBounds, UIExportOptions, ZoomToFitIfNecessaryOptions, ZoomToFitOptions, ZoomToElementsOptions, ViewportNodeElement, ViewportElement, ViewportGroupElement, CenterContentOptions, AlignContentOptions, AlignContentToFaceOptions, CenterContentHorizontallyOptions, CenterContentVerticallyOptions } from "../../ui";
10
10
  import { BrowserUI } from "../browser-visuallyjs-instance";
11
11
  import { BrowserElement } from "../util";
12
12
  import { EdgeInputMethod } from "../edge-input-handler";
@@ -20,6 +20,7 @@ import { MiniviewPluginOptions } from "./plugins";
20
20
  /**
21
21
  * Provides a canvas on which nodes, groups and edges can be rendered, with support for pan/zoom, layouts and various plugins. This is not a class that API users should instantiate directly: for users of a library integration, a Surface will be created internally by the appropriate component; for users of vanilla VisuallyJs, a Surface is created either via the {@link createSurface} factory method, or via a `render` call on an instance of the {@link BrowserUIModel}.
22
22
  * @group Components
23
+ * @category Surface
23
24
  */
24
25
  export declare class Surface extends BrowserUI<SurfaceEvents> implements SupportsElementDragging<BrowserElement>, SupportsPathEditing, SupportsViewportManipulation {
25
26
  model: BrowserUIModel;
@@ -248,6 +249,11 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
248
249
  * @param clazz Either a single class name, or a comma separated list of classnames, or an array of classnames.
249
250
  */
250
251
  removeDragClassnameFilter(clazz: string | Array<string>): void;
252
+ /**
253
+ * Adds a CSS selector filter to the wheel event.
254
+ * @param selector
255
+ */
256
+ addWheelSelectorFilter(selector: string): void;
251
257
  /**
252
258
  * Adds the given element(s) to the given drag group.
253
259
  * @param spec Either the ID of some drag group, in which case the elements are all added as 'active', or an object containing the ID of the drag group and the element's participation in the group. `active` participation, which is the default, indicates whether dragging the given element(s) should cause all the elements in the drag group to be dragged. If `active` is false it means the given element(s) is "passive" and should only move when an active member of the drag group is dragged. The elements passed in to this method will be added to the drag group with an `added` membership flag, meaning any drag group an element has been added to via this method will take precedence over a drag group an element gets added to via a drag group assigner (see the DragGroupsPlugin for a discussion of automatically assigning elements to drag groups)
@@ -284,36 +290,6 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
284
290
  * @magnetizer
285
291
  */
286
292
  magnetizeAtEvent(event: MouseEvent): void;
287
- /**
288
- * Positions a DOM element at a given X,Y on the canvas, in canvas coordinates (meaning it takes into account the current zoom and pan). This is not intended for use with elements the surface is managing: it is designed to be used with elements such as pop-ups that you may wish to position relative to the content in your canvas.
289
- * @param el Element to position.
290
- * @param x X location on canvas to move element's left edge to.
291
- * @param y Y location on canvas to move element's top edge to.
292
- * @param xShift Optional absolute number of pixels to shift the element by in the x axis after calculating its position relative to the canvas. Typically you'd use this to place something other than the top left corner of your element at the desired location.
293
- * @param yShift Optional absolute number of pixels to shift the element by in the y axis after calculating its position relative to the canvas.
294
- * @param ensureOnScreen If true, will ensure that x and y positions are never negative.
295
- *
296
- */
297
- positionElementAt(el: BrowserElement, x: number, y: number, xShift?: number, yShift?: number, ensureOnScreen?: boolean): void;
298
- /**
299
- * Positions a DOM element at the apparent canvas location corresponding to the page location given by some event. This is not intended for use with elements the surface is managing: it is designed to be used with elements such as pop-ups that you may wish to position relative to the content in your canvas.
300
- * @param el - Element to position.
301
- * @param evt - Event to position element at.
302
- * @param xShift - Optional absolute number of pixels to shift the element by in the x axis after calculating its position relative to the canvas. Typically you'd use this to place something other than the top left corner of your element at the desired location.
303
- * @param yShift - Optional absolute number of pixels to shift the element by in the y axis after calculating its position relative to the canvas.
304
- *
305
- */
306
- positionElementAtEventLocation(el: BrowserElement, evt: MouseEvent, xShift?: number, yShift?: number): void;
307
- /**
308
- * Positions a DOM element at the apparent canvas location corresponding to the given page location. This is not intended for use with elements the surface is managing: it is designed to be used with elements such as pop-ups that you may wish to position relative to the content in your canvas.
309
- * @param el - Element to position.
310
- * @param x - X location on canvas to move element's left edge to.
311
- * @param y - Y location on canvas to move element's top edge to.
312
- * @param xShift - Optional absolute number of pixels to shift the element by in the x axis after calculating its position relative to the canvas. Typically you'd use this to place something other than the top left corner of your element at the desired location.
313
- * @param yShift - Optional absolute number of pixels to shift the element by in the y axis after calculating its position relative to the canvas.
314
- *
315
- */
316
- positionElementAtPageLocation(el: BrowserElement, x: number, y: number, xShift?: number, yShift?: number): void;
317
293
  /**
318
294
  * Cleans up the Surface. When using a library integration such as Angular/React/Vue/Svelte, this method will be called automatically when the associated component is unloaded. If you're using vanilla VisaullyJs, you might want to call this method if you're cleaning up your UI and you don't need this Surface any longer.
319
295
  *
@@ -358,9 +334,38 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
358
334
  /**
359
335
  * Centers the tracked content inside the viewport, but does not adjust the current zoom (so the content may still extend past the viewport bounds)
360
336
  * @param options Method parameters.
337
+ * @canvasPositioning
361
338
  *
362
339
  */
363
340
  centerContent(options?: CenterContentOptions): void;
341
+ /**
342
+ * Centers the tracked content horizontally inside the viewport, but does not adjust the current zoom (so the content may still extend past the viewport bounds)
343
+ * @param options Method parameters.
344
+ * @canvasPositioning
345
+ */
346
+ centerContentHorizontally(options?: CenterContentHorizontallyOptions): void;
347
+ /**
348
+ * Centers the tracked content vertically inside the viewport, but does not adjust the current zoom (so the content may still extend past the viewport bounds)
349
+ * @param options Method parameters.
350
+ * @canvasPositioning
351
+ */
352
+ centerContentVertically(options?: CenterContentVerticallyOptions): void;
353
+ /**
354
+ * Position the surface so the background is centered in the viewport, without changing the current zoom.
355
+ * @param params.onComplete Optional function to call on operation complete (centering may be animated).
356
+ * @param params.doNotAnimate If true, centering content will not use animation.
357
+ */
358
+ centerBackground(params: {
359
+ doNotAnimate?: boolean;
360
+ onComplete?: (p: PointXY) => any;
361
+ }): void;
362
+ /**
363
+ * Positions the widget so that the edges of the background align with the viewport. This method is useful for snapping to a corner of the background.
364
+ * @param axes Spec for the axes to align to. This should be a space-separated string containing a value
365
+ * for the x (allowed values `left` and `right`) and, optionally, y (allowed values `top` and `bottom`) axes. The default value is `"left top"`.
366
+ * @param animationDuration Defaults to 150ms
367
+ */
368
+ alignBackground(axes: string, animationDuration?: number): void;
364
369
  /**
365
370
  * Zooms the display so that the current selected nodes are all visible, optionally animating the transition.
366
371
  * @param params Optional method params
@@ -501,29 +506,28 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
501
506
  /**
502
507
  * Center on the current object and zoom in on it.
503
508
  * @param element - The element to center. Can be a DOM element, vertex id, or a Node/Group
504
- * @param fillRatio How much of the viewport to fill with the object we zoom in on. This will be limited by the
505
- * current zoom range. Defaults to 0.6.
509
+ * @param fillRatio How much of the viewport to fill with the object we zoom in on. This will be limited by the current zoom range. Defaults to 0.6.
506
510
  * @param doNotAnimate - by default, this operation will be animated.
511
+ * @canvasPosition
507
512
  *
508
513
  */
509
514
  centerOnAndZoom(element: string | Vertex | Element, fillRatio?: number, doNotAnimate?: boolean): void;
510
515
  /**
511
- * Takes a node/group as argument and positions the surface canvas such that the given node is at the center in
512
- * both axes.
516
+ * Takes a node/group as argument and positions the surface canvas such that the given node is at the center in both axes.
513
517
  * @param element - The element to center. Can be a DOM element, vertex id, or a Node/Group.
514
- *
518
+ * @canvasPosition
515
519
  */
516
520
  centerOn(element: string | Vertex | Element): void;
517
521
  /**
518
522
  * Takes a node/group as argument and positions the surface canvas such that the given node is at the center in the horizontal axis.
519
523
  * @param element - The element to center. Can be a DOM element, vertex id, or a Node/Group
520
- *
524
+ * @canvasPosition
521
525
  */
522
526
  centerOnHorizontally(element: string | Vertex | Element): void;
523
527
  /**
524
528
  * Takes a node/group as argument and positions the surface canvas such that the given node is at the center in the vertical axis.
525
529
  * @param element - The element to center. Can be a DOM element, vertex id, or a Node/Group
526
- *
530
+ * @canvasPosition
527
531
  */
528
532
  centerOnVertically(element: string | Vertex | Element): void;
529
533
  /**
@@ -532,6 +536,11 @@ export declare class Surface extends BrowserUI<SurfaceEvents> implements Support
532
536
  *
533
537
  */
534
538
  setClamping(clamping: boolean): void;
539
+ /**
540
+ * Sets the location of the canvas such that the given point appears at the center of the viewport.
541
+ * @param xy - location of the point on the canvas to position in the center of the viewport.
542
+ */
543
+ setViewportCenter(xy: PointXY): void;
535
544
  /**
536
545
  * Returns whether or not the given point (relative to page origin) is within the viewport for the widget.
537
546
  * @param x X location of point to test
@@ -1,6 +1,8 @@
1
1
  import { PointXY } from "../../core";
2
2
  /**
3
3
  * Options for an SVG export.
4
+ * @group Input and Output
5
+ * @category SVG Export
4
6
  */
5
7
  export interface SvgExportOptions {
6
8
  /**
@@ -112,30 +114,40 @@ export type ImageReadyFunction = (result: {
112
114
  * The modal backing element for SVG/PNG/JPG export dialog
113
115
  * @cssClass
114
116
  * @context svg-png-jpg-export
117
+ * @group Components
118
+ * @category SVG/PNG/JPG Export
115
119
  */
116
120
  export declare const CLASS_EXPORT_UNDERLAY = "vjs-export-underlay";
117
121
  /**
118
122
  * Content element for SVG/PNG/JPG export dialog
119
123
  * @cssClass
120
124
  * @context svg-png-jpg-export
125
+ * @group Components
126
+ * @category SVG/PNG/JPG Export
121
127
  */
122
128
  export declare const CLASS_EXPORT_OVERLAY = "vjs-export-overlay";
123
129
  /**
124
130
  * Class assigned to the cancel button on an export dialog
125
131
  * @cssClass
126
132
  * @context svg-png-jpg-export
133
+ * @group Components
134
+ * @category SVG/PNG/JPG Export
127
135
  */
128
136
  export declare const CLASS_EXPORT_CANCEL = "vjs-export-cancel";
129
137
  /**
130
138
  * Class assigned to the dimensions drop down in an export dialog
131
139
  * @cssClass
132
140
  * @context svg-png-jpg-export
141
+ * @group Components
142
+ * @category SVG/PNG/JPG Export
133
143
  */
134
144
  export declare const CLASS_EXPORT_DIMENSIONS = "vjs-export-dimensions";
135
145
  /**
136
146
  * Class assigned to the element containing buttons and dimensions picker on an export dialog
137
147
  * @cssClass
138
148
  * @context svg-png-jpg-export
149
+ * @group Components
150
+ * @category SVG/PNG/JPG Export
139
151
  */
140
152
  export declare const CLASS_EXPORT_DOWNLOAD_TOOLS = "vjs-export-download-tools";
141
153
  export declare const DEFAULT_EXPORT_FILENAME = "visuallyjs-export";
@@ -6,6 +6,8 @@ import { RectangleXY } from "../../core";
6
6
  * @param ui
7
7
  * @param options
8
8
  * @param onready
9
+ * @group Input and Output
10
+ * @category Image Export
9
11
  */
10
12
  export declare function exportImage(ui: BrowserUI, options: ImageExportOptions, onready: ImageReadyFunction): void;
11
13
  export declare function $doImageExport(svgElementInfo: {
@@ -1,6 +1,9 @@
1
1
  import { RectangleXY } from "../../core";
2
2
  import { BrowserUI } from "../browser-visuallyjs-instance";
3
3
  import { SvgExportOptions } from "./definitions";
4
+ /**
5
+ * @internal
6
+ */
4
7
  export declare function exportSvg(ui: BrowserUI, options?: SvgExportOptions): {
5
8
  element: SVGElement;
6
9
  extents: RectangleXY;
@@ -25,8 +25,7 @@ export interface CustomTagDefinition {
25
25
  */
26
26
  updated: (el: Element, data: any, instance: Recado, ui: Surface, vertex: Vertex) => any;
27
27
  /**
28
- * If set to true, the element rendered for this tag is removed from the DOM. The Toolkit uses this capability internally
29
- * to add endpoints to the DOM.
28
+ * If set to true, the element rendered for this tag is removed from the DOM.
30
29
  */
31
30
  remove?: boolean;
32
31
  }
@@ -1,4 +1,6 @@
1
1
  /**
2
2
  * Abstraction of HTML/SVG element. Used extensively internally, and by a number of methods in the public API.
3
+ * @group UI
4
+ * @category Definitions
3
5
  */
4
6
  export type BrowserElement = HTMLElement | SVGElement;
@@ -25,6 +25,8 @@ export interface StackablePlotOptions {
25
25
  }
26
26
  /**
27
27
  * Defines the format for data labels options.
28
+ * @group Charts
29
+ * @category Options
28
30
  */
29
31
  export type DataLabelsOptions = boolean | string;
30
32
  /**
@@ -6,44 +6,66 @@ import { TooltipOptions } from "./tooltip";
6
6
  import { ChartDimensions } from "./definitions";
7
7
  import { ChartExporter, ChartExporterOptions } from "./chart-exporter";
8
8
  import { ChartZoomControls } from "./chart-zoom-controls";
9
+ /**
10
+ * The default background color for charts, and for their plot area, is #FFFFFF.
11
+ * @constant
12
+ * @group Charts
13
+ * @category Constants
14
+ */
9
15
  export declare const DEFAULT_BACKGROUND_COLOR = "#FFFFFF";
16
+ /**
17
+ * The default label color for charts is #000000.
18
+ * @constant
19
+ * @group Charts
20
+ * @category Constants
21
+ */
22
+ export declare const DEFAULT_LABEL_COLOR = "#000000";
10
23
  export declare const DEFAULT_MARGIN = 15;
11
24
  /**
12
25
  * Middle alignment (centered) for chart title.
13
26
  * @constant
14
27
  * @group Charts
28
+ * @category Options
15
29
  */
16
30
  export declare const CHART_TITLE_ALIGN_MIDDLE = "middle";
17
31
  /**
18
32
  * Left alignment for chart title.
19
33
  * @constant
20
34
  * @group Charts
35
+ * @category Options
21
36
  */
22
37
  export declare const CHART_TITLE_ALIGN_LEFT = "left";
23
38
  /**
24
39
  * Right alignment for chart title.
25
40
  * @constant
26
41
  * @group Charts
42
+ * @category Options
27
43
  */
28
44
  export declare const CHART_TITLE_ALIGN_RIGHT = "right";
29
45
  /**
30
46
  * Chart title alignment
47
+ * @group Charts
48
+ * @category Options
31
49
  */
32
50
  export type ChartTitleAlignment = typeof CHART_TITLE_ALIGN_LEFT | typeof CHART_TITLE_ALIGN_MIDDLE | typeof CHART_TITLE_ALIGN_RIGHT;
33
51
  /**
34
52
  * Defines placing the chart title at the top of the chart
35
53
  * @constant
36
54
  * @group Charts
55
+ * @category Options
37
56
  */
38
57
  export declare const CHART_TITLE_PLACEMENT_TOP = "top";
39
58
  /**
40
59
  * Defines placing the chart title at the bottom of the chart
41
60
  * @constant
42
61
  * @group Charts
62
+ * @category Options
43
63
  */
44
64
  export declare const CHART_TITLE_PLACEMENT_BOTTOM = "bottom";
45
65
  /**
46
66
  * Chart title placement - at the top or the bottom.
67
+ * @group Charts
68
+ * @category Options
47
69
  */
48
70
  export type ChartTitlePlacement = typeof CHART_TITLE_PLACEMENT_TOP | typeof CHART_TITLE_PLACEMENT_BOTTOM;
49
71
  /**
@@ -107,22 +129,27 @@ export interface SubtitleSpec extends BaseTitleSpec {
107
129
  * Middle alignment (centered) for axis title.
108
130
  * @constant
109
131
  * @group Charts
132
+ * @category Options
110
133
  */
111
134
  export declare const CHART_AXIS_TITLE_ALIGN_MIDDLE = "middle";
112
135
  /**
113
136
  * At start alignment for axis title.
114
137
  * @constant
115
138
  * @group Charts
139
+ * @category Options
116
140
  */
117
141
  export declare const CHART_AXIS_TITLE_ALIGN_START = "start";
118
142
  /**
119
143
  * At end alignment for axis title.
120
144
  * @constant
121
145
  * @group Charts
146
+ * @category Options
122
147
  */
123
148
  export declare const CHART_AXIS_TITLE_ALIGN_END = "end";
124
149
  /**
125
150
  * Axis title alignment - start, middle or end. Middle is the default.
151
+ * @group Charts
152
+ * @category Options
126
153
  */
127
154
  export type AxisTitleAlignment = typeof CHART_AXIS_TITLE_ALIGN_MIDDLE | typeof CHART_AXIS_TITLE_ALIGN_START | typeof CHART_AXIS_TITLE_ALIGN_END;
128
155
  /**
@@ -185,10 +212,6 @@ export interface BaseChartOptions {
185
212
  * Height for the chart. If omitted, height is computed from the width of the chart's container
186
213
  */
187
214
  height?: number;
188
- /**
189
- * Background color for chart. Defaults to #FFFFFF. You can also use the `.vjs-chart-background` css class to set this.
190
- */
191
- backgroundColor?: string;
192
215
  /**
193
216
  * Title for the chart.
194
217
  */
@@ -253,13 +276,27 @@ export declare const DEFAULT_GRID_LINE_COLOR = "#AAAAAA";
253
276
  export declare const DEFAULT_LEGEND_OUTLINE_WIDTH = 1;
254
277
  export declare const DEFAULT_LEGEND_BACKGROUND_COLOR = "#FFFFFFCC";
255
278
  /**
279
+ * Style options for a chart. This is a realised object; no settings are blank.
256
280
  * @internal
257
281
  */
258
282
  export interface ChartStyle {
283
+ /**
284
+ * Color for chart's gridlines. Defaults to #AAAAAA.
285
+ */
259
286
  gridLineColor: string;
260
287
  legendOutlineColor: string;
261
288
  legendOutlineWidth: number;
262
289
  legendBackgroundColor: string;
290
+ /**
291
+ * Background color for chart. Defaults to #FFFFFF. You can also use the `.vjs-chart-background` css class to set this.
292
+ */
293
+ backgroundColor: string;
294
+ /**
295
+ * Background color for chart's plot area. Defaults to being the same as the value calculated for `backgroundColor`. You can also use the `.vjs-chart-plot-background` css class to set this.
296
+ */
297
+ plotBackgroundColor: string;
298
+ labelColor: string;
299
+ labelColorGenerator?: (v: any, idx: number) => string;
263
300
  }
264
301
  /**
265
302
  * Basic style options for a chart.
@@ -268,7 +305,7 @@ export interface ChartStyle {
268
305
  */
269
306
  export interface ChartStyleOptions {
270
307
  /**
271
- * What color to draw gridlines.
308
+ * What color to draw gridlines. Defaults to #AAAAAA.
272
309
  */
273
310
  gridLineColor?: string;
274
311
  /**
@@ -287,6 +324,24 @@ export interface ChartStyleOptions {
287
324
  * What color to draw crosshairs
288
325
  */
289
326
  crosshairColor?: string;
327
+ /**
328
+ * Background color for chart. Defaults to #FFFFFF. You can also use the `.vjs-chart-background` css class to set this.
329
+ */
330
+ backgroundColor?: string;
331
+ /**
332
+ * Background color for chart's plot area. Defaults to being the same as the value calculated for `backgroundColor`. You can also use the `.vjs-chart-plot-background` css class to set this.
333
+ */
334
+ plotBackgroundColor?: string;
335
+ /**
336
+ * Color for labels, defaults to #000000. Can be overridden in axis definitions via the `labelColor` property.
337
+ */
338
+ labelColor?: string;
339
+ /**
340
+ * Optional function invoked to compute a custom color for a given label
341
+ * @param v
342
+ * @param idx
343
+ */
344
+ labelColorGenerator?: (v: number, idx: number) => string;
290
345
  }
291
346
  /**
292
347
  * Base class for charts. This class is abstract; you won't need to interact with this class unless you're making your own chart type.
@@ -305,7 +360,6 @@ export declare abstract class BaseChart extends OptimisticEventGenerator {
305
360
  $resizeObserver: ResizeObserver;
306
361
  $eventManager: EventManager;
307
362
  colorGenerator: ColorGenerator<ObjectData>;
308
- private _backgroundColor;
309
363
  /**
310
364
  * color to use for every series. Not set by default.
311
365
  * @internal
@@ -369,6 +423,8 @@ export declare abstract class BaseChart extends OptimisticEventGenerator {
369
423
  */
370
424
  $precomputeTitle(svgRoot: SVGElement, width: number): ChartSVGElement;
371
425
  $getBackgroundColor(): string;
426
+ $getPlotBackgroundColor(): string;
427
+ $getLabelColor(): string;
372
428
  abstract hasData(): boolean;
373
429
  /**
374
430
  * Map the given page location to an x/y location on the chart's canvas
@@ -2,6 +2,8 @@ import { BaseChart } from "./base-chart";
2
2
  import { BrowserElement } from "../browser-ui";
3
3
  /**
4
4
  * Options for a chart export menu.
5
+ * @group Charts
6
+ * @category Input and Output
5
7
  */
6
8
  export interface ChartExporterOptions {
7
9
  /**
@@ -19,6 +21,7 @@ export interface ChartExporterOptions {
19
21
  }
20
22
  /**
21
23
  * Component that adds an export menu to a chart.
24
+ * @group Charts
22
25
  */
23
26
  export declare class ChartExporter {
24
27
  private chart;
@@ -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>;