@metadev/daga 1.2.0 → 1.3.1

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 (55) hide show
  1. package/Changelog.md +16 -0
  2. package/README.md +2 -2
  3. package/fesm2022/metadev-daga.mjs +810 -58
  4. package/fesm2022/metadev-daga.mjs.map +1 -1
  5. package/lib/collapse-button/collapse-button.component.d.ts +4 -0
  6. package/lib/diagram/diagram.component.d.ts +1 -0
  7. package/lib/diagram-buttons/diagram-buttons.component.d.ts +4 -0
  8. package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +4 -0
  9. package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +4 -0
  10. package/lib/diagram-editor/diagram/converters/daga-model.d.ts +5 -0
  11. package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
  12. package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
  13. package/lib/diagram-editor/diagram/diagram-action.d.ts +67 -1
  14. package/lib/diagram-editor/diagram/diagram-canvas.d.ts +4 -0
  15. package/lib/diagram-editor/diagram/diagram-config.d.ts +21 -3
  16. package/lib/diagram-editor/diagram/diagram-connection.d.ts +75 -0
  17. package/lib/diagram-editor/diagram/diagram-element.d.ts +40 -3
  18. package/lib/diagram-editor/diagram/diagram-field.d.ts +64 -0
  19. package/lib/diagram-editor/diagram/diagram-model.d.ts +75 -2
  20. package/lib/diagram-editor/diagram/diagram-node.d.ts +58 -0
  21. package/lib/diagram-editor/diagram/diagram-port.d.ts +36 -0
  22. package/lib/diagram-editor/diagram/diagram-property.d.ts +23 -2
  23. package/lib/diagram-editor/diagram/diagram-section.d.ts +45 -0
  24. package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +1 -0
  25. package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +1 -0
  26. package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +2 -2
  27. package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +8 -0
  28. package/lib/diagram-editor/diagram/layout/force-layout.d.ts +1 -0
  29. package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +1 -0
  30. package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +1 -0
  31. package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +1 -0
  32. package/lib/diagram-editor/diagram-editor.component.d.ts +4 -0
  33. package/lib/errors/diagram-error.d.ts +19 -0
  34. package/lib/errors/diagram-validator.d.ts +6 -1
  35. package/lib/errors/errors.component.d.ts +5 -0
  36. package/lib/interfaces/canvas.d.ts +48 -4
  37. package/lib/interfaces/diagram-buttons.d.ts +8 -0
  38. package/lib/interfaces/diagram-editor.d.ts +4 -0
  39. package/lib/interfaces/palette.d.ts +2 -0
  40. package/lib/interfaces/property-editor.d.ts +4 -0
  41. package/lib/object-editor/object-editor.component.d.ts +7 -1
  42. package/lib/palette/palette.component.d.ts +6 -0
  43. package/lib/property-editor/property-editor.component.d.ts +5 -0
  44. package/lib/services/canvas-provider.service.d.ts +17 -0
  45. package/lib/services/daga-configuration.service.d.ts +11 -0
  46. package/lib/text-list-editor/text-list-editor.component.d.ts +7 -0
  47. package/lib/text-map-editor/text-map-editor.component.d.ts +7 -0
  48. package/lib/util/canvas-util.d.ts +104 -0
  49. package/lib/util/events.d.ts +8 -4
  50. package/lib/util/grid.d.ts +47 -4
  51. package/lib/util/line.d.ts +44 -0
  52. package/lib/util/list-util.d.ts +14 -0
  53. package/lib/util/shape.d.ts +98 -0
  54. package/lib/util/svg-util.d.ts +77 -5
  55. package/package.json +1 -1
@@ -1,209 +1,253 @@
1
1
  import { Subject } from 'rxjs';
2
- import { ActionQueue, DiagramActions } from '../diagram-editor/diagram/diagram-action';
2
+ import { ActionQueue } from '../diagram-editor/diagram/diagram-action';
3
3
  import { DiagramConnectionType } from '../diagram-editor/diagram/diagram-connection';
4
4
  import { DiagramElement } from '../diagram-editor/diagram/diagram-element';
5
5
  import { DiagramModel } from '../diagram-editor/diagram/diagram-model';
6
6
  import { DiagramValidator } from '../errors/diagram-validator';
7
7
  import { Point } from '../util/canvas-util';
8
8
  import { DiagramEditor } from './diagram-editor';
9
+ import { UserActionConfig } from '../diagram-editor/diagram/diagram-config';
9
10
  /**
10
11
  * Provides the functionality for the visual representation of the elements of a model.
12
+ * @public
11
13
  */
12
14
  export interface Canvas {
13
15
  /**
14
16
  * Parent component of the diagram.
17
+ * @private
15
18
  */
16
19
  parentComponent: DiagramEditor;
17
20
  /**
18
21
  * Object that contains the data of the elements of the diagram.
22
+ * @public
19
23
  */
20
24
  model: DiagramModel;
21
25
  /**
22
26
  * Background color of the diagram.
27
+ * @public
23
28
  */
24
29
  color: string;
25
30
  /**
26
31
  * Distance between the grid points of the diagram.
32
+ * @public
27
33
  */
28
34
  gridSize: number;
29
35
  /**
30
36
  * If true, elements moved by the user should be placed on the closest grid point rather than the exact point where they were placed.
37
+ * @public
31
38
  */
32
39
  snapToGrid: boolean;
33
40
  /**
34
41
  * If true, new connections should have the type that makes most sense even if it's not the currently chosen type.
42
+ * @public
35
43
  */
36
44
  guessConnectionType: boolean;
37
45
  /**
38
46
  * When a new connection is made, it should have this type.
47
+ * @public
39
48
  */
40
49
  connectionType?: DiagramConnectionType;
41
50
  /**
42
51
  * Elements below the priority threshold shouldn't be displayed.
52
+ * @public
43
53
  */
44
54
  priorityThreshold?: number;
45
55
  /**
46
56
  * Possible values that the priority threshold can take.
57
+ * @public
47
58
  */
48
59
  priorityThresholds: number[];
49
60
  /**
50
61
  * Identifier of the current layout format used by the diagram.
62
+ * @public
51
63
  */
52
64
  layoutFormat?: string;
53
65
  /**
54
66
  * Mapping of what actions the user is allowed to perform. Absent values are assumed to be `true`.
67
+ * @public
55
68
  */
56
- userActions: {
57
- [key in DiagramActions]?: boolean;
58
- };
69
+ userActions: UserActionConfig;
59
70
  /**
60
71
  * The list of validators used to check for errors in this canvas.
72
+ * @private
61
73
  */
62
74
  validators: DiagramValidator[];
63
75
  /**
64
76
  * The queue of actions used to keep track of what actions can be undone or redone.
77
+ * @private
65
78
  */
66
79
  actionQueue: ActionQueue;
67
80
  /**
68
81
  * Subject for tracking when the canvas' view is initialized.
82
+ * @public
69
83
  */
70
84
  viewInitialized$: Subject<void>;
71
85
  /**
72
86
  * Subject for tracking when validators are added to the canvas.
87
+ * @public
73
88
  */
74
89
  validatorChanges$: Subject<void>;
75
90
  /**
76
91
  * Subject for tracking changes in the diagram.
77
92
  * Used to detect if there have been changes over a period of time.
93
+ * @public
78
94
  */
79
95
  diagramChanges$: Subject<number>;
80
96
  /**
81
97
  * Subject for tracking the presence of important changes in the diagram.
82
98
  * Used to detect if there are any changes that require an immediate reaction.
99
+ * @public
83
100
  */
84
101
  diagramImportantChanges$: Subject<void>;
85
102
  /**
86
103
  * Initializes the view of the diagram.
104
+ * @private
87
105
  */
88
106
  initView(appendTo: HTMLElement): void;
89
107
  /**
90
108
  * Increases the zoom level by the given factor.
109
+ * @public
91
110
  * @param zoom A factor of zoom.
92
111
  */
93
112
  zoomBy(zoom: number): void;
94
113
  /**
95
114
  * Changes the zoom level to a given level.
115
+ * @public
96
116
  * @param zoom A level of zoom.
97
117
  */
98
118
  zoomTo(zoom: number): void;
99
119
  /**
100
120
  * Translates the view by the given amount.
121
+ * @public
101
122
  * @param x A distance along the x axis.
102
123
  * @param y A distance along the y axis.
103
124
  */
104
125
  translateBy(x: number, y: number): void;
105
126
  /**
106
127
  * Translates the view to the given point.
128
+ * @public
107
129
  * @param x A coordinate along the x axis.
108
130
  * @param y A coordinate along the y axis.
109
131
  */
110
132
  translateTo(x: number, y: number): void;
111
133
  /**
112
134
  * Centers by zooming and translating the view such that every element fits in the view.
135
+ * @public
113
136
  */
114
137
  center(): void;
115
138
  /**
116
139
  * Get the closest grid point to the given point.
140
+ * @public
117
141
  * @param point A point.
118
142
  */
119
143
  getClosestGridPoint(point: Point): Point;
120
144
  /**
121
145
  * Get the location of the pointer in the given event relative to the canvas.
146
+ * @private
122
147
  * @param event A MouseEvent.
123
148
  */
124
149
  getPointerLocationRelativeToCanvas(event: MouseEvent): Point;
125
150
  /**
126
151
  * Get the location of the pointer in the given event relative to the body.
152
+ * @private
127
153
  * @param event A MouseEvent.
128
154
  */
129
155
  getPointerLocationRelativeToBody(event: MouseEvent): Point;
130
156
  /**
131
157
  * Adds a validator to the list of validators of the diagram.
158
+ * @public
132
159
  */
133
160
  addValidator(validator: DiagramValidator): void;
134
161
  /**
135
162
  * Removes a validator from the list of validators of the diagram.
163
+ * @public
136
164
  */
137
165
  removeValidator(validator: DiagramValidator): void;
138
166
  /**
139
167
  * Update the view of the canvas to show the current state of the model.
168
+ * @public
140
169
  */
141
170
  updateModelInView(): void;
142
171
  /**
143
172
  * Update the view of the canvas to show the current state of the nodes.
173
+ * @public
144
174
  */
145
175
  updateNodesInView(...ids: string[]): void;
146
176
  /**
147
177
  * Update the view of the canvas to show the current state of the sections.
178
+ * @public
148
179
  */
149
180
  updateSectionsInView(...ids: string[]): void;
150
181
  /**
151
182
  * Update the view of the canvas to show the current state of the ports.
183
+ * @public
152
184
  */
153
185
  updatePortsInView(...ids: string[]): void;
154
186
  /**
155
187
  * Update the view of the canvas to show the current state of the connections.
188
+ * @public
156
189
  */
157
190
  updateConnectionsInView(...ids: string[]): void;
158
191
  /**
159
192
  * Update the view of the canvas to show the current state of the fields.
193
+ * @public
160
194
  */
161
195
  updateFieldsInView(...ids: string[]): void;
162
196
  /**
163
197
  * Get the d3 Selection containing the view of all the elements in the canvas.
198
+ * @private
164
199
  */
165
200
  selectCanvasView(): d3.Selection<SVGGElement, unknown, null, unknown>;
166
201
  /**
167
202
  * Highlight the given diagram element in the canvas view and all the elements which depend on it.
168
203
  * Highlighting an element unhighlights the previously highlighted elements.
204
+ * @private
169
205
  * @param element A diagram element.
170
206
  */
171
207
  highlight(element: DiagramElement): void;
172
208
  /**
173
209
  * Unhighlights all diagram elements.
210
+ * @private
174
211
  */
175
212
  unhighlight(): void;
176
213
  /**
177
214
  * Checks if the given diagram element is in the current user selection.
215
+ * @private
178
216
  * @param selection A diagram element.
179
217
  */
180
218
  isInUserSelection(selection: DiagramElement): boolean;
181
219
  /**
182
220
  * Adds the given diagram element to the current user selection.
221
+ * @private
183
222
  * @param selection A diagram element.
184
223
  */
185
224
  addToUserSelection(selection: DiagramElement): void;
186
225
  /**
187
226
  * Removes the given diagram element from the current user selection.
227
+ * @private
188
228
  * @param selection A diagram element.
189
229
  */
190
230
  removeFromUserSelection(selection: DiagramElement): void;
191
231
  /**
192
232
  * Adds the given diagram element to the current user selection if it's not in the current user selection.
193
233
  * If it is part of the current user selection, removes it from the current user selection.
234
+ * @private
194
235
  * @param selection A diagram element.
195
236
  */
196
237
  toggleUserSelection(selection: DiagramElement): void;
197
238
  /**
198
239
  * Removes all elements from the current user selection.
240
+ * @private
199
241
  */
200
242
  clearUserSelection(): void;
201
243
  /**
202
244
  * Stops all unfinished user actions to ensure there are no unfinished actions before performing a different action.
245
+ * @public
203
246
  */
204
247
  cancelAllUserActions(): void;
205
248
  /**
206
249
  * Sets the diagram element whose ValueSet is being displayed in the value set editor.
250
+ * @private
207
251
  */
208
252
  setPropertyEditorSelection(selection?: DiagramElement): void;
209
253
  }
@@ -1,33 +1,41 @@
1
1
  /**
2
2
  * General canvas commands for zooming and filtering used by the buttons of the diagram's user interface.
3
+ * @private
3
4
  */
4
5
  export interface DiagramButtons {
5
6
  /**
6
7
  * Increase the zoom level of the diagram by this component's zoom rate.
8
+ * @private
7
9
  */
8
10
  zoomIn(): void;
9
11
  /**
10
12
  * Decrease the zoom level of the diagram by this component's zoom rate.
13
+ * @private
11
14
  */
12
15
  zoomOut(): void;
13
16
  /**
14
17
  * Center the view of the diagram.
18
+ * @private
15
19
  */
16
20
  center(): void;
17
21
  /**
18
22
  * Apply the diagram's current layout if applicable.
23
+ * @private
19
24
  */
20
25
  layout(): void;
21
26
  /**
22
27
  * Change the current priority threshold of the canvas, hide any nodes with a priority below the threshold and recalculate the diagram's layout.
28
+ * @private
23
29
  */
24
30
  filter(): void;
25
31
  /**
26
32
  * Undo the latest user change in the diagram.
33
+ * @private
27
34
  */
28
35
  undo(): void;
29
36
  /**
30
37
  * Redo the latest undone user change in the diagram.
38
+ * @private
31
39
  */
32
40
  redo(): void;
33
41
  }
@@ -3,18 +3,22 @@ import { Palette } from './palette';
3
3
  import { PropertyEditor } from './property-editor';
4
4
  /**
5
5
  * Exposes the components of the diagram editor.
6
+ * @private
6
7
  */
7
8
  export interface DiagramEditor {
8
9
  /**
9
10
  * Diagram buttons component of the diagram editor.
11
+ * @private
10
12
  */
11
13
  diagramButtons: DiagramButtons;
12
14
  /**
13
15
  * Palette component of the diagram editor.
16
+ * @private
14
17
  */
15
18
  palette: Palette;
16
19
  /**
17
20
  * Property editor component of the diagram editor.
21
+ * @private
18
22
  */
19
23
  propertyEditor: PropertyEditor;
20
24
  }
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Exposes the commands of the palette component.
3
+ * @private
3
4
  */
4
5
  export interface Palette {
5
6
  /**
6
7
  * Refresh the current items being displayed in the palette.
7
8
  * Used when it is necessary to update the contents of the palette but the state of the palette doesn't change.
9
+ * @private
8
10
  */
9
11
  refreshPalette(): void;
10
12
  }
@@ -1,18 +1,22 @@
1
1
  import { ValueSet } from '../diagram-editor/diagram/diagram-property';
2
2
  /**
3
3
  * Exposes the commands of the property editor component.
4
+ * @private
4
5
  */
5
6
  export interface PropertyEditor {
6
7
  /**
7
8
  * Title of the ValueSet displayed in the UI.
9
+ * @private
8
10
  */
9
11
  title?: string;
10
12
  /**
11
13
  * ValueSet being edited in this component by the user.
14
+ * @private
12
15
  */
13
16
  valueSet?: ValueSet;
14
17
  /**
15
18
  * Highlight the property given by the list of keys it can be found under.
19
+ * @private
16
20
  * @param propertyNames The keys under which a property can be found in the ValueSet being edited in this component.
17
21
  */
18
22
  highlightProperty(...propertyNames: string[]): void;
@@ -4,6 +4,12 @@ import { Property, Type, ValueSet } from '../diagram-editor/diagram/diagram-prop
4
4
  import { Canvas } from '../interfaces/canvas';
5
5
  import { CanvasProviderService } from '../services/canvas-provider.service';
6
6
  import * as i0 from "@angular/core";
7
+ /**
8
+ * Editor of a value set within a property editor.
9
+ * @see PropertyEditor
10
+ * @see ValueSet
11
+ * @private
12
+ */
7
13
  export declare class ObjectEditorComponent {
8
14
  private cdr;
9
15
  private canvasProvider;
@@ -12,7 +18,7 @@ export declare class ObjectEditorComponent {
12
18
  _valueSet?: ValueSet;
13
19
  get valueSet(): ValueSet | undefined;
14
20
  set valueSet(valueSet: ValueSet | undefined);
15
- /** How many object-editors are parents of this object-editor */
21
+ /** How many object-editors are parents of this object-editor. @private */
16
22
  depth: number;
17
23
  Type: typeof Type;
18
24
  booleanRadioItems: RadioItem[];
@@ -6,6 +6,12 @@ import { Palette } from '../interfaces/palette';
6
6
  import { CanvasProviderService } from '../services/canvas-provider.service';
7
7
  import { Corner } from '../util/svg-util';
8
8
  import * as i0 from "@angular/core";
9
+ /**
10
+ * Palette that the user can drag and drop nodes from.
11
+ * @see DiagramConfig
12
+ * @see DiagramNode
13
+ * @private
14
+ */
9
15
  export declare class PaletteComponent implements AfterContentInit, AfterViewInit, Palette {
10
16
  private canvasProvider;
11
17
  get canvas(): Canvas;
@@ -3,6 +3,11 @@ import { ValueSet } from '../diagram-editor/diagram/diagram-property';
3
3
  import { PropertyEditor } from '../interfaces/property-editor';
4
4
  import { Corner } from '../util/svg-util';
5
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Editor of the values of a value set.
8
+ * @see ValueSet
9
+ * @private
10
+ */
6
11
  export declare class PropertyEditorComponent implements PropertyEditor {
7
12
  private cdr;
8
13
  panel: ElementRef<HTMLDivElement>;
@@ -4,11 +4,28 @@ import { DiagramEditor } from '../interfaces/diagram-editor';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * A provider for the {@link Canvas} associated with a {@link DiagramComponent} context.
7
+ * @public
7
8
  */
8
9
  export declare class CanvasProviderService {
9
10
  private _canvas;
11
+ /**
12
+ * Initialize the diagram canvas object of this context.
13
+ * @private
14
+ * @param parentComponent A diagram editor.
15
+ * @param config A diagram configuration.
16
+ */
10
17
  initCanvas(parentComponent: DiagramEditor, config: DiagramConfig): void;
18
+ /**
19
+ * Attach the canvas of this context to an HTML Element to render it there.
20
+ * @private
21
+ * @param appendTo An HTML Element.
22
+ */
11
23
  initCanvasView(appendTo: HTMLElement): void;
24
+ /**
25
+ * Get the diagram canvas of this context.
26
+ * @public
27
+ * @returns A diagram canvas.
28
+ */
12
29
  getCanvas(): Canvas;
13
30
  static ɵfac: i0.ɵɵFactoryDeclaration<CanvasProviderService, never>;
14
31
  static ɵprov: i0.ɵɵInjectableDeclaration<CanvasProviderService>;
@@ -2,10 +2,21 @@ import { DiagramConfig } from '../diagram-editor/diagram/diagram-config';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * A provider for the {@link DiagramConfig} associated with a {@link DiagramComponent} context.
5
+ * @public
5
6
  */
6
7
  export declare class DagaConfigurationService {
7
8
  private _config;
9
+ /**
10
+ * Set the diagram configuration of this context.
11
+ * @private
12
+ * @param config A diagram configuration.
13
+ */
8
14
  init(config: DiagramConfig): void;
15
+ /**
16
+ * Get the diagram configuration of this context.
17
+ * @public
18
+ * @returns A diagram configuration.
19
+ */
9
20
  getConfig(): DiagramConfig;
10
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DagaConfigurationService, never>;
11
22
  static ɵprov: i0.ɵɵInjectableDeclaration<DagaConfigurationService>;
@@ -1,5 +1,12 @@
1
1
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * Editor of a property of text list type within a property editor.
5
+ * @see TextList
6
+ * @see PropertyEditor
7
+ * @see ValueSet
8
+ * @private
9
+ */
3
10
  export declare class TextListEditorComponent {
4
11
  private cdr;
5
12
  private _value;
@@ -1,5 +1,12 @@
1
1
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * Editor of a property of text map type within a property editor.
5
+ * @see TextMap
6
+ * @see PropertyEditor
7
+ * @see ValueSet
8
+ * @private
9
+ */
3
10
  export declare class TextMapEditorComponent {
4
11
  private cdr;
5
12
  private _value;
@@ -1,16 +1,120 @@
1
1
  import { Side } from './svg-util';
2
+ /**
3
+ * A point on a canvas defined as its coordinates along the x and y axes.
4
+ * @see DiagramCanvas
5
+ * @public
6
+ */
2
7
  export type Point = [number, number];
8
+ /**
9
+ * A line on a canvas defined as its start point and end point.
10
+ * @see DiagramCanvas
11
+ * @public
12
+ */
3
13
  export type Line = [Point, Point];
14
+ /**
15
+ * A rectangle on a canvas defined as the points of its opposite corners.
16
+ * @see DiagramCanvas
17
+ * @public
18
+ */
4
19
  export type Rectangle = [Point, Point];
20
+ /**
21
+ * Round the coordinates of the given point to the nearest whole number.
22
+ * @public
23
+ * @param point A point.
24
+ * @returns A new point with whole coordinates.
25
+ */
5
26
  export declare const roundPoint: (point: Point) => Point;
27
+ /**
28
+ * Checks if the given coordinate is in the range given by an starting coordinate and an ending coordinate.
29
+ * @public
30
+ * @param coordinate A coordinate to check its presence in the range.
31
+ * @param start A coordinate determining one of the extremes in the range.
32
+ * @param end A coordinate determine one of the extremes in the range.
33
+ * @returns `true` if the given coordinate is in the given range; `false` otherwise.
34
+ */
6
35
  export declare const between: (coordinate: number, start: number, end: number) => boolean;
36
+ /**
37
+ * Moves the given coordinate according to the given changes in coordinates.
38
+ * @public
39
+ * @param oldCoordinate A coordinate.
40
+ * @param oldCoordinates A range of coordinates.
41
+ * @param newCoordinates A range of coordinates.
42
+ * @returns A new coordinate.
43
+ */
7
44
  export declare const translateCoordinate: (oldCoordinate: number, oldCoordinates: [number, number], newCoordinates: [number, number]) => number;
45
+ /**
46
+ * Moves the coordinates of the given point according to the given changes in coordinates.
47
+ * @public
48
+ * @param oldPoint A point.
49
+ * @param oldCoordsX A range of coordinates along the x axis.
50
+ * @param oldCoordsY A range of coordinates along the y axis.
51
+ * @param newCoordsX A range of coordinates along the x axis.
52
+ * @param newCoordsY A range of coordinates along the y axis.
53
+ * @returns A new point.
54
+ */
8
55
  export declare const translatePoint: (oldPoint: Point, oldCoordsX: [number, number], oldCoordsY: [number, number], newCoordsX: [number, number], newCoordsY: [number, number]) => Point;
56
+ /**
57
+ * Calculates the result of moving the given point by the given distance in the given direction.
58
+ * @public
59
+ * @param point A point.
60
+ * @param direction A direction.
61
+ * @param distance A distance.
62
+ * @returns A new point which differs from the given point by the given distance in the given direction.
63
+ */
9
64
  export declare const movePoint: (point: Point, direction: Side, distance: number) => Point;
65
+ /**
66
+ * Checks whether two given points are the same point, that is, they have the same coordinates and are not NaN.
67
+ * @public
68
+ * @param point1 A point.
69
+ * @param point2 A point.
70
+ * @returns `true` if the two points have the same coordinates; `false` otherwise.
71
+ */
10
72
  export declare const equals: (point1: Point, point2: Point) => boolean;
73
+ /**
74
+ * Calculates the euclidean distance between two points.
75
+ * @public
76
+ * @param point1 A point.
77
+ * @param point2 A point.
78
+ * @returns The euclidean distance between the given points.
79
+ */
11
80
  export declare const distanceBetweenPoints: (point1: Point, point2: Point) => number;
81
+ /**
82
+ * Checks whether the given point is inside the given line.
83
+ * @public
84
+ * @param line A line.
85
+ * @param point A point.
86
+ * @returns `true` if the point is contained within the line; `false` otherwise.
87
+ */
12
88
  export declare const lineContainsPoint: (line: Line, point: Point) => boolean;
89
+ /**
90
+ * Checks whether the given point is inside the given rectaingle.
91
+ * @public
92
+ * @param rectangle A rectangle.
93
+ * @param point A point.
94
+ * @returns `true` if the point is contained within the rectangle; `false` otherwise.
95
+ */
13
96
  export declare const rectangleContainsPoint: (rectangle: Rectangle, point: Point) => boolean;
97
+ /**
98
+ * Checks whether the two given lines share at least one point.
99
+ * @public
100
+ * @param line1 A line.
101
+ * @param line2 A line.
102
+ * @returns `true` if the lines intersect; `false` otherwise.
103
+ */
14
104
  export declare const linesIntersect: (line1: Line, line2: Line) => boolean;
105
+ /**
106
+ * Checks whether the two given lines share at least one point and have the same slope.
107
+ * @public
108
+ * @param line1 A line.
109
+ * @param line2 A line.
110
+ * @returns `true` if the lines overlap; `false` otherwise.
111
+ */
15
112
  export declare const linesOverlap: (line1: Line, line2: Line) => boolean;
113
+ /**
114
+ * Checks whether the given line shares at least one point with the given rectangle.
115
+ * @public
116
+ * @param line A line.
117
+ * @param rectangle A rectangle.
118
+ * @returns `true` if the line intersects with the rectangle; `false` otherwise.
119
+ */
16
120
  export declare const lineIntersectsRectangle: (line: Line, rectangle: Rectangle) => boolean;
@@ -1,5 +1,6 @@
1
1
  /**
2
- * User events
2
+ * User events.
3
+ * @private
3
4
  */
4
5
  export declare enum Events {
5
6
  Blur = "blur",
@@ -13,7 +14,8 @@ export declare enum Events {
13
14
  MouseOver = "mouseover"
14
15
  }
15
16
  /**
16
- * Keys in keyboard events
17
+ * Keys in keyboard events.
18
+ * @private
17
19
  */
18
20
  export declare enum Keys {
19
21
  Alt = "Alt",
@@ -36,7 +38,8 @@ export declare enum Keys {
36
38
  Tab = "Tab"
37
39
  }
38
40
  /**
39
- * Types of events used by D3's drag functionality
41
+ * Types of events used by D3's drag functionality.
42
+ * @private
40
43
  */
41
44
  export declare enum DragEvents {
42
45
  Drag = "drag",
@@ -44,7 +47,8 @@ export declare enum DragEvents {
44
47
  End = "end"
45
48
  }
46
49
  /**
47
- * Types of events used by D3's zoom functionality
50
+ * Types of events used by D3's zoom functionality.
51
+ * @private
48
52
  */
49
53
  export declare enum ZoomEvents {
50
54
  Zoom = "zoom",