@metadev/daga 1.1.0 → 1.3.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/Changelog.md +29 -1
- package/README.md +1 -1
- package/assets/fonts/DMMono-Medium.ttf +0 -0
- package/assets/fonts/DMMono-Medium.woff +0 -0
- package/assets/fonts/DMMono-Medium.woff2 +0 -0
- package/assets/fonts/WonderUnitSans-Medium.ttf +0 -0
- package/assets/fonts/WonderUnitSans-Medium.woff +0 -0
- package/assets/fonts/WonderUnitSans-Medium.woff2 +0 -0
- package/assets/styles/_collapse-button.scss +37 -0
- package/assets/styles/_diagram-buttons.scss +132 -0
- package/assets/styles/_diagram.scss +15 -0
- package/assets/styles/_errors.scss +83 -0
- package/assets/styles/_palette.scss +12 -0
- package/assets/styles/_property-editor.scss +160 -0
- package/assets/styles/daga.scss +152 -0
- package/fesm2022/metadev-daga.mjs +1174 -279
- package/fesm2022/metadev-daga.mjs.map +1 -1
- package/index.d.ts +16 -7
- package/lib/collapse-button/collapse-button.component.d.ts +5 -0
- package/lib/diagram/diagram.component.d.ts +1 -0
- package/lib/diagram-buttons/diagram-buttons.component.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-model.d.ts +5 -0
- package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
- package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
- package/lib/diagram-editor/diagram/diagram-action.d.ts +77 -2
- package/lib/diagram-editor/diagram/diagram-canvas.d.ts +8 -1
- package/lib/diagram-editor/diagram/diagram-config.d.ts +26 -0
- package/lib/diagram-editor/diagram/diagram-connection.d.ts +75 -0
- package/lib/diagram-editor/diagram/diagram-element.d.ts +40 -3
- package/lib/diagram-editor/diagram/diagram-field.d.ts +64 -0
- package/lib/diagram-editor/diagram/diagram-model.d.ts +75 -2
- package/lib/diagram-editor/diagram/diagram-node.d.ts +59 -1
- package/lib/diagram-editor/diagram/diagram-port.d.ts +36 -0
- package/lib/diagram-editor/diagram/diagram-property.d.ts +23 -2
- package/lib/diagram-editor/diagram/diagram-section.d.ts +48 -1
- package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +2 -2
- package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +8 -0
- package/lib/diagram-editor/diagram/layout/force-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram-editor.component.d.ts +4 -0
- package/lib/errors/diagram-error.d.ts +19 -0
- package/lib/errors/diagram-validator.d.ts +6 -1
- package/lib/errors/errors.component.d.ts +5 -0
- package/lib/interfaces/canvas.d.ts +50 -0
- package/lib/interfaces/diagram-buttons.d.ts +8 -0
- package/lib/interfaces/diagram-editor.d.ts +4 -0
- package/lib/interfaces/palette.d.ts +2 -0
- package/lib/interfaces/property-editor.d.ts +4 -0
- package/lib/object-editor/object-editor.component.d.ts +8 -1
- package/lib/palette/palette.component.d.ts +6 -0
- package/lib/property-editor/property-editor.component.d.ts +5 -0
- package/lib/services/canvas-provider.service.d.ts +17 -0
- package/lib/services/daga-configuration.service.d.ts +11 -0
- package/lib/text-list-editor/text-list-editor.component.d.ts +7 -0
- package/lib/text-map-editor/text-map-editor.component.d.ts +7 -0
- package/lib/util/canvas-util.d.ts +104 -0
- package/lib/util/events.d.ts +8 -4
- package/lib/util/grid.d.ts +47 -4
- package/lib/util/line.d.ts +44 -0
- package/lib/util/list-util.d.ts +14 -0
- package/lib/util/shape.d.ts +98 -0
- package/lib/util/svg-util.d.ts +77 -5
- package/package.json +1 -1
- package/assets/styles/styles.scss +0 -181
|
@@ -9,6 +9,10 @@ import { CanvasProviderService } from '../services/canvas-provider.service';
|
|
|
9
9
|
import { DagaConfigurationService } from '../services/daga-configuration.service';
|
|
10
10
|
import { Corner } from '../util/svg-util';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
|
+
/**
|
|
13
|
+
* A diagram's user interface editor.
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
12
16
|
export declare class DiagramEditorComponent implements AfterViewInit, DiagramEditor, OnInit {
|
|
13
17
|
private configurationService;
|
|
14
18
|
private canvasProvider;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An error in a diagram detected by a diagram validator.
|
|
3
|
+
* @see DiagramValidator
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
1
6
|
export interface DiagramError {
|
|
7
|
+
/**
|
|
8
|
+
* Error message to be displayed to the user.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
2
11
|
message: string;
|
|
12
|
+
/**
|
|
13
|
+
* If applicable, id of the diagram element which contains this error.
|
|
14
|
+
* @see DiagramElement
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
3
17
|
elementId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* If applicable, list of keys under which to find the property which contains this error in the value set which contains this error.
|
|
20
|
+
* @see ValueSet
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
4
23
|
propertyNames?: string[];
|
|
5
24
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { DiagramModel } from '../diagram-editor/diagram/diagram-model';
|
|
2
2
|
import { DiagramError } from './diagram-error';
|
|
3
|
+
/**
|
|
4
|
+
* A validator that checks for specific types of errors in a diagram.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
3
7
|
export interface DiagramValidator {
|
|
4
8
|
/**
|
|
5
|
-
* Checks
|
|
9
|
+
* Checks a diagram model and returns the list of errors detected.
|
|
10
|
+
* @public
|
|
6
11
|
*/
|
|
7
12
|
validate(model: DiagramModel): DiagramError[];
|
|
8
13
|
}
|
|
@@ -5,6 +5,11 @@ import { CanvasProviderService } from '../services/canvas-provider.service';
|
|
|
5
5
|
import { Side } from '../util/svg-util';
|
|
6
6
|
import { DiagramError } from './diagram-error';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Displays the errors detected by a diagram's validators.
|
|
10
|
+
* @see DiagramValidator
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
8
13
|
export declare class ErrorsComponent implements AfterViewInit {
|
|
9
14
|
private canvasProvider;
|
|
10
15
|
get canvas(): Canvas;
|
|
@@ -6,198 +6,248 @@ 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;
|
|
65
|
+
/**
|
|
66
|
+
* Mapping of what actions the user is allowed to perform. Absent values are assumed to be `true`.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
userActions: UserActionConfig;
|
|
53
70
|
/**
|
|
54
71
|
* The list of validators used to check for errors in this canvas.
|
|
72
|
+
* @private
|
|
55
73
|
*/
|
|
56
74
|
validators: DiagramValidator[];
|
|
57
75
|
/**
|
|
58
76
|
* The queue of actions used to keep track of what actions can be undone or redone.
|
|
77
|
+
* @private
|
|
59
78
|
*/
|
|
60
79
|
actionQueue: ActionQueue;
|
|
61
80
|
/**
|
|
62
81
|
* Subject for tracking when the canvas' view is initialized.
|
|
82
|
+
* @public
|
|
63
83
|
*/
|
|
64
84
|
viewInitialized$: Subject<void>;
|
|
65
85
|
/**
|
|
66
86
|
* Subject for tracking when validators are added to the canvas.
|
|
87
|
+
* @public
|
|
67
88
|
*/
|
|
68
89
|
validatorChanges$: Subject<void>;
|
|
69
90
|
/**
|
|
70
91
|
* Subject for tracking changes in the diagram.
|
|
71
92
|
* Used to detect if there have been changes over a period of time.
|
|
93
|
+
* @public
|
|
72
94
|
*/
|
|
73
95
|
diagramChanges$: Subject<number>;
|
|
74
96
|
/**
|
|
75
97
|
* Subject for tracking the presence of important changes in the diagram.
|
|
76
98
|
* Used to detect if there are any changes that require an immediate reaction.
|
|
99
|
+
* @public
|
|
77
100
|
*/
|
|
78
101
|
diagramImportantChanges$: Subject<void>;
|
|
79
102
|
/**
|
|
80
103
|
* Initializes the view of the diagram.
|
|
104
|
+
* @private
|
|
81
105
|
*/
|
|
82
106
|
initView(appendTo: HTMLElement): void;
|
|
83
107
|
/**
|
|
84
108
|
* Increases the zoom level by the given factor.
|
|
109
|
+
* @public
|
|
85
110
|
* @param zoom A factor of zoom.
|
|
86
111
|
*/
|
|
87
112
|
zoomBy(zoom: number): void;
|
|
88
113
|
/**
|
|
89
114
|
* Changes the zoom level to a given level.
|
|
115
|
+
* @public
|
|
90
116
|
* @param zoom A level of zoom.
|
|
91
117
|
*/
|
|
92
118
|
zoomTo(zoom: number): void;
|
|
93
119
|
/**
|
|
94
120
|
* Translates the view by the given amount.
|
|
121
|
+
* @public
|
|
95
122
|
* @param x A distance along the x axis.
|
|
96
123
|
* @param y A distance along the y axis.
|
|
97
124
|
*/
|
|
98
125
|
translateBy(x: number, y: number): void;
|
|
99
126
|
/**
|
|
100
127
|
* Translates the view to the given point.
|
|
128
|
+
* @public
|
|
101
129
|
* @param x A coordinate along the x axis.
|
|
102
130
|
* @param y A coordinate along the y axis.
|
|
103
131
|
*/
|
|
104
132
|
translateTo(x: number, y: number): void;
|
|
105
133
|
/**
|
|
106
134
|
* Centers by zooming and translating the view such that every element fits in the view.
|
|
135
|
+
* @public
|
|
107
136
|
*/
|
|
108
137
|
center(): void;
|
|
109
138
|
/**
|
|
110
139
|
* Get the closest grid point to the given point.
|
|
140
|
+
* @public
|
|
111
141
|
* @param point A point.
|
|
112
142
|
*/
|
|
113
143
|
getClosestGridPoint(point: Point): Point;
|
|
114
144
|
/**
|
|
115
145
|
* Get the location of the pointer in the given event relative to the canvas.
|
|
146
|
+
* @private
|
|
116
147
|
* @param event A MouseEvent.
|
|
117
148
|
*/
|
|
118
149
|
getPointerLocationRelativeToCanvas(event: MouseEvent): Point;
|
|
119
150
|
/**
|
|
120
151
|
* Get the location of the pointer in the given event relative to the body.
|
|
152
|
+
* @private
|
|
121
153
|
* @param event A MouseEvent.
|
|
122
154
|
*/
|
|
123
155
|
getPointerLocationRelativeToBody(event: MouseEvent): Point;
|
|
124
156
|
/**
|
|
125
157
|
* Adds a validator to the list of validators of the diagram.
|
|
158
|
+
* @public
|
|
126
159
|
*/
|
|
127
160
|
addValidator(validator: DiagramValidator): void;
|
|
128
161
|
/**
|
|
129
162
|
* Removes a validator from the list of validators of the diagram.
|
|
163
|
+
* @public
|
|
130
164
|
*/
|
|
131
165
|
removeValidator(validator: DiagramValidator): void;
|
|
132
166
|
/**
|
|
133
167
|
* Update the view of the canvas to show the current state of the model.
|
|
168
|
+
* @public
|
|
134
169
|
*/
|
|
135
170
|
updateModelInView(): void;
|
|
136
171
|
/**
|
|
137
172
|
* Update the view of the canvas to show the current state of the nodes.
|
|
173
|
+
* @public
|
|
138
174
|
*/
|
|
139
175
|
updateNodesInView(...ids: string[]): void;
|
|
140
176
|
/**
|
|
141
177
|
* Update the view of the canvas to show the current state of the sections.
|
|
178
|
+
* @public
|
|
142
179
|
*/
|
|
143
180
|
updateSectionsInView(...ids: string[]): void;
|
|
144
181
|
/**
|
|
145
182
|
* Update the view of the canvas to show the current state of the ports.
|
|
183
|
+
* @public
|
|
146
184
|
*/
|
|
147
185
|
updatePortsInView(...ids: string[]): void;
|
|
148
186
|
/**
|
|
149
187
|
* Update the view of the canvas to show the current state of the connections.
|
|
188
|
+
* @public
|
|
150
189
|
*/
|
|
151
190
|
updateConnectionsInView(...ids: string[]): void;
|
|
152
191
|
/**
|
|
153
192
|
* Update the view of the canvas to show the current state of the fields.
|
|
193
|
+
* @public
|
|
154
194
|
*/
|
|
155
195
|
updateFieldsInView(...ids: string[]): void;
|
|
156
196
|
/**
|
|
157
197
|
* Get the d3 Selection containing the view of all the elements in the canvas.
|
|
198
|
+
* @private
|
|
158
199
|
*/
|
|
159
200
|
selectCanvasView(): d3.Selection<SVGGElement, unknown, null, unknown>;
|
|
160
201
|
/**
|
|
161
202
|
* Highlight the given diagram element in the canvas view and all the elements which depend on it.
|
|
162
203
|
* Highlighting an element unhighlights the previously highlighted elements.
|
|
204
|
+
* @private
|
|
163
205
|
* @param element A diagram element.
|
|
164
206
|
*/
|
|
165
207
|
highlight(element: DiagramElement): void;
|
|
166
208
|
/**
|
|
167
209
|
* Unhighlights all diagram elements.
|
|
210
|
+
* @private
|
|
168
211
|
*/
|
|
169
212
|
unhighlight(): void;
|
|
170
213
|
/**
|
|
171
214
|
* Checks if the given diagram element is in the current user selection.
|
|
215
|
+
* @private
|
|
172
216
|
* @param selection A diagram element.
|
|
173
217
|
*/
|
|
174
218
|
isInUserSelection(selection: DiagramElement): boolean;
|
|
175
219
|
/**
|
|
176
220
|
* Adds the given diagram element to the current user selection.
|
|
221
|
+
* @private
|
|
177
222
|
* @param selection A diagram element.
|
|
178
223
|
*/
|
|
179
224
|
addToUserSelection(selection: DiagramElement): void;
|
|
180
225
|
/**
|
|
181
226
|
* Removes the given diagram element from the current user selection.
|
|
227
|
+
* @private
|
|
182
228
|
* @param selection A diagram element.
|
|
183
229
|
*/
|
|
184
230
|
removeFromUserSelection(selection: DiagramElement): void;
|
|
185
231
|
/**
|
|
186
232
|
* Adds the given diagram element to the current user selection if it's not in the current user selection.
|
|
187
233
|
* If it is part of the current user selection, removes it from the current user selection.
|
|
234
|
+
* @private
|
|
188
235
|
* @param selection A diagram element.
|
|
189
236
|
*/
|
|
190
237
|
toggleUserSelection(selection: DiagramElement): void;
|
|
191
238
|
/**
|
|
192
239
|
* Removes all elements from the current user selection.
|
|
240
|
+
* @private
|
|
193
241
|
*/
|
|
194
242
|
clearUserSelection(): void;
|
|
195
243
|
/**
|
|
196
244
|
* Stops all unfinished user actions to ensure there are no unfinished actions before performing a different action.
|
|
245
|
+
* @public
|
|
197
246
|
*/
|
|
198
247
|
cancelAllUserActions(): void;
|
|
199
248
|
/**
|
|
200
249
|
* Sets the diagram element whose ValueSet is being displayed in the value set editor.
|
|
250
|
+
* @private
|
|
201
251
|
*/
|
|
202
252
|
setPropertyEditorSelection(selection?: DiagramElement): void;
|
|
203
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,14 +4,21 @@ 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;
|
|
10
16
|
get canvas(): Canvas;
|
|
17
|
+
get userCanEdit(): boolean;
|
|
11
18
|
_valueSet?: ValueSet;
|
|
12
19
|
get valueSet(): ValueSet | undefined;
|
|
13
20
|
set valueSet(valueSet: ValueSet | undefined);
|
|
14
|
-
/** How many object-editors are parents of this object-editor */
|
|
21
|
+
/** How many object-editors are parents of this object-editor. @private */
|
|
15
22
|
depth: number;
|
|
16
23
|
Type: typeof Type;
|
|
17
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;
|