@metadev/daga 1.5.6 → 2.0.2
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 +35 -1
- package/README.md +67 -30
- package/assets/daga-logo.svg +10 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +8085 -0
- package/index.cjs.mjs +2 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +7999 -0
- package/package.json +19 -37
- package/src/index.d.ts +49 -0
- package/src/lib/core.d.ts +1 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/canvas}/diagram-canvas.d.ts +69 -66
- package/src/lib/diagram/canvas/diagram-context-menu.d.ts +27 -0
- package/src/lib/diagram/canvas/diagram-user-highlight.d.ts +30 -0
- package/src/lib/diagram/canvas/diagram-user-selection.d.ts +74 -0
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-action.d.ts +36 -12
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-client.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-engine.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/collab/message-types.d.ts +3 -8
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-exporter.d.ts +6 -6
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-importer.d.ts +6 -4
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-model.d.ts +3 -3
- package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-exporter.d.ts +2 -2
- package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-importer.d.ts +2 -2
- package/{lib/diagram-editor → src/lib}/diagram/diagram-action.d.ts +75 -55
- package/{lib/diagram-editor → src/lib}/diagram/diagram-config.d.ts +139 -84
- package/{lib/diagram-editor → src/lib}/diagram/diagram-event.d.ts +3 -3
- package/{lib/diagram-editor → src/lib}/diagram/layout/adjacency-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-adjacency-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/diagram-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/force-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/horizontal-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/priority-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/tree-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/vertical-layout.d.ts +1 -1
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-connection.d.ts +4 -4
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-element.d.ts +7 -11
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-entity.d.ts +2 -2
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-field.d.ts +4 -4
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-model.d.ts +15 -15
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-node.d.ts +7 -7
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-property.d.ts +46 -31
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-section.d.ts +8 -8
- package/{lib → src/lib}/errors/diagram-validator.d.ts +1 -1
- package/{lib → src/lib}/interfaces/canvas.d.ts +79 -107
- package/{lib → src/lib}/interfaces/diagram-buttons.d.ts +8 -8
- package/{lib → src/lib}/interfaces/diagram-editor.d.ts +4 -11
- package/{lib → src/lib}/interfaces/palette.d.ts +2 -2
- package/{lib → src/lib}/interfaces/property-editor.d.ts +5 -5
- package/{lib → src/lib}/util/canvas-util.d.ts +20 -5
- package/src/lib/util/device-util.d.ts +5 -0
- package/{lib → src/lib}/util/events.d.ts +4 -4
- package/{lib → src/lib}/util/style.d.ts +1 -0
- package/src/lib/util/test-util.d.ts +11 -0
- 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/icon/action/drop-down-arrow.svg +0 -8
- package/assets/icon/action/drop-horizontal-left.svg +0 -14
- package/assets/icon/action/drop-horizontal-none.svg +0 -13
- package/assets/icon/action/drop-horizontal-right.svg +0 -14
- package/assets/icon/action/drop-vertical-down.svg +0 -14
- package/assets/icon/action/drop-vertical-none.svg +0 -13
- package/assets/icon/action/drop-vertical-up.svg +0 -14
- package/assets/icon/action/filter-clear.png +0 -0
- package/assets/icon/buttons/center-hover.svg +0 -10
- package/assets/icon/buttons/center.svg +0 -10
- package/assets/icon/buttons/ellipsis-hover.svg +0 -7
- package/assets/icon/buttons/ellipsis.svg +0 -7
- package/assets/icon/buttons/filter-off-hover.svg +0 -5
- package/assets/icon/buttons/filter-off.svg +0 -5
- package/assets/icon/buttons/filter-on-hover.svg +0 -5
- package/assets/icon/buttons/filter-on.svg +0 -5
- package/assets/icon/buttons/layout-hover.svg +0 -8
- package/assets/icon/buttons/layout.svg +0 -8
- package/assets/icon/buttons/redo-hover.svg +0 -5
- package/assets/icon/buttons/redo.svg +0 -5
- package/assets/icon/buttons/undo-hover.svg +0 -5
- package/assets/icon/buttons/undo.svg +0 -5
- package/assets/icon/buttons/zoom-in-hover.svg +0 -8
- package/assets/icon/buttons/zoom-in.svg +0 -8
- package/assets/icon/buttons/zoom-out-hover.svg +0 -7
- package/assets/icon/buttons/zoom-out.svg +0 -7
- package/assets/icon/context/copy.svg +0 -4
- package/assets/icon/context/cross.svg +0 -3
- package/assets/icon/context/cut.svg +0 -4
- package/assets/icon/context/delete.svg +0 -4
- package/assets/icon/context/paste.svg +0 -4
- package/assets/icon/property/add.svg +0 -23
- package/assets/icon/property/close.svg +0 -3
- package/assets/icon/property/ellipsis.svg +0 -5
- package/assets/icon/property/gear.svg +0 -3
- package/assets/icon/property/hide.svg +0 -10
- package/assets/icon/property/move.svg +0 -35
- package/assets/styles/_collapse-button.scss +0 -37
- package/assets/styles/_context-menu.scss +0 -32
- package/assets/styles/_diagram-buttons.scss +0 -166
- package/assets/styles/_diagram.scss +0 -15
- package/assets/styles/_errors.scss +0 -83
- package/assets/styles/_palette.scss +0 -20
- package/assets/styles/_property-editor.scss +0 -285
- package/assets/styles/daga.scss +0 -150
- package/fesm2022/metadev-daga.mjs +0 -10957
- package/fesm2022/metadev-daga.mjs.map +0 -1
- package/index.d.ts +0 -55
- package/lib/collapse-button/collapse-button.component.d.ts +0 -22
- package/lib/daga.module.d.ts +0 -18
- package/lib/diagram/diagram.component.d.ts +0 -44
- package/lib/diagram-buttons/diagram-buttons.component.d.ts +0 -44
- package/lib/diagram-editor/diagram-editor.component.d.ts +0 -38
- package/lib/errors/errors.component.d.ts +0 -26
- package/lib/palette/palette.component.d.ts +0 -39
- package/lib/property-editor/autocomplete/autocomplete.component.d.ts +0 -39
- package/lib/property-editor/object-editor/object-editor.component.d.ts +0 -30
- package/lib/property-editor/option-list-editor/option-list-editor.component.d.ts +0 -33
- package/lib/property-editor/property-editor.component.d.ts +0 -30
- package/lib/property-editor/property-settings/property-settings.component.d.ts +0 -35
- package/lib/property-editor/text-list-editor/text-list-editor.component.d.ts +0 -29
- package/lib/property-editor/text-map-editor/text-map-editor.component.d.ts +0 -36
- package/lib/services/canvas-provider.service.d.ts +0 -32
- package/lib/services/daga-configuration.service.d.ts +0 -23
- package/{lib/diagram-editor → src/lib}/diagram/collab/primitives.d.ts +0 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-decorator.d.ts +1 -1
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-object.d.ts +0 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-port.d.ts +2 -2
- package/{lib → src/lib}/errors/diagram-error.d.ts +3 -3
- package/{lib → src/lib}/util/grid.d.ts +0 -0
- package/{lib → src/lib}/util/line.d.ts +0 -0
- package/{lib → src/lib}/util/list-util.d.ts +0 -0
- package/{lib → src/lib}/util/shape.d.ts +10 -10
- /package/{lib → src/lib}/util/svg-util.d.ts +0 -0
- /package/{lib → src/lib}/util/text-util.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Point } from '
|
|
2
|
-
import { LineShape, LineStyle } from '
|
|
3
|
-
import { ClosedShape } from '
|
|
4
|
-
import { Corner, HorizontalAlign, Side, VerticalAlign } from '
|
|
1
|
+
import { Point } from '../util/canvas-util';
|
|
2
|
+
import { LineShape, LineStyle } from '../util/line';
|
|
3
|
+
import { ClosedShape } from '../util/shape';
|
|
4
|
+
import { Corner, HorizontalAlign, Side, VerticalAlign } from '../util/svg-util';
|
|
5
5
|
import { DiagramActions } from './diagram-action';
|
|
6
|
-
import { Property } from './diagram-property';
|
|
6
|
+
import { Property } from './model/diagram-property';
|
|
7
7
|
/**
|
|
8
8
|
* The configuration for a diagram.
|
|
9
9
|
* @public
|
|
@@ -20,40 +20,24 @@ export interface DiagramConfig {
|
|
|
20
20
|
*/
|
|
21
21
|
name?: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @default
|
|
25
|
-
*/
|
|
26
|
-
backgroundColor?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Distance between each point of the grid of this diagram in pixels. 0 or negative is interpreted as no grid.
|
|
29
|
-
* @default 0
|
|
30
|
-
*/
|
|
31
|
-
gridSize?: number;
|
|
32
|
-
/**
|
|
33
|
-
* When true, nodes moved by the user will be moved to the closest point where the top left corner matches a grid point.
|
|
34
|
-
* @default false
|
|
23
|
+
* Configuration regarding the canvas.
|
|
24
|
+
* @default {}
|
|
35
25
|
*/
|
|
36
|
-
|
|
26
|
+
canvas?: CanvasConfig;
|
|
37
27
|
/**
|
|
38
28
|
* When true, connections made by the user will have their type assumed based on the type of the source and target nodes.
|
|
39
29
|
* @default false
|
|
40
30
|
*/
|
|
41
|
-
|
|
31
|
+
inferConnectionType?: boolean;
|
|
42
32
|
/**
|
|
43
|
-
* Id of the type of connection that is selected
|
|
33
|
+
* Id of the type of connection that is initially selected for the user to draw when drawing connections. By default, no type is selected.
|
|
44
34
|
* @default undefined
|
|
45
35
|
*/
|
|
46
36
|
defaultConnection?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Possible values of the priority threshold that the user can toggle between to hide nodes whose priority value is below it.
|
|
49
|
-
* If it is possible to toggle the priority threshold via the filter button, it should have at least two values.
|
|
50
|
-
* @default []
|
|
51
|
-
*/
|
|
52
|
-
priorityThresholds?: number[];
|
|
53
37
|
/**
|
|
54
38
|
* Name of the layout format used to arrange the nodes of this diagram when pressing the layout button in the diagram buttons component.
|
|
55
|
-
* @see DiagramButtonsComponent
|
|
56
39
|
* @default undefined
|
|
40
|
+
* @see DiagramButtonsComponent
|
|
57
41
|
*/
|
|
58
42
|
layoutFormat?: string;
|
|
59
43
|
/**
|
|
@@ -67,32 +51,95 @@ export interface DiagramConfig {
|
|
|
67
51
|
*/
|
|
68
52
|
components?: ComponentsConfig;
|
|
69
53
|
/**
|
|
70
|
-
* Default attributes for each of the types of node of this diagram.
|
|
54
|
+
* Default attributes for each of the types of node of this diagram. By default, no attributes are set.
|
|
71
55
|
* @default undefined
|
|
72
56
|
*/
|
|
73
57
|
nodeTypeDefaults?: Partial<NodeTypeConfig>;
|
|
74
58
|
/**
|
|
75
|
-
* List of the types of node that can be used in this diagram.
|
|
59
|
+
* List of the types of node that can be used in this diagram. By default, no types are created.
|
|
76
60
|
* @default undefined
|
|
77
61
|
*/
|
|
78
62
|
nodeTypes?: NodeTypeConfig[];
|
|
79
63
|
/**
|
|
80
|
-
* Default attributes for each of the types of connection of this diagram.
|
|
64
|
+
* Default attributes for each of the types of connection of this diagram. By default, no attributes are set.
|
|
81
65
|
* @default undefined
|
|
82
66
|
*/
|
|
83
67
|
connectionTypeDefaults?: Partial<ConnectionTypeConfig>;
|
|
84
68
|
/**
|
|
85
|
-
* List of the types of connection that can be used in this diagram.
|
|
69
|
+
* List of the types of connection that can be used in this diagram. By default, no types are created.
|
|
86
70
|
* @default undefined
|
|
87
71
|
*/
|
|
88
72
|
connectionTypes?: ConnectionTypeConfig[];
|
|
89
73
|
/**
|
|
90
74
|
* Properties of this diagram that can be edited in the property editor component.
|
|
91
|
-
* @see PropertyEditorComponent
|
|
92
75
|
* @default []
|
|
76
|
+
* @see PropertyEditorComponent
|
|
93
77
|
*/
|
|
94
78
|
properties?: Property[];
|
|
95
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The configuration for the visual behavior of a diagram in the user interface.
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export interface CanvasConfig {
|
|
85
|
+
/**
|
|
86
|
+
* Configuration for the grid in the canvas.
|
|
87
|
+
* If left undefined, it is interpreted as disabling the grid,
|
|
88
|
+
* same as if the attribute `enabled` in its configuration was set to `false`.
|
|
89
|
+
*/
|
|
90
|
+
grid?: GridConfig;
|
|
91
|
+
/**
|
|
92
|
+
* Background color of this diagram.
|
|
93
|
+
* @default "#FFFFFF"
|
|
94
|
+
*/
|
|
95
|
+
backgroundColor?: string;
|
|
96
|
+
/**
|
|
97
|
+
* The factor by which the zoom level increases or decreases when the user users buttons or keys to zoom in or out. Should be above 1.
|
|
98
|
+
* @default 2
|
|
99
|
+
*/
|
|
100
|
+
zoomFactor?: number;
|
|
101
|
+
/**
|
|
102
|
+
* The rate by which the view of the canvas moves when the user users buttons or keys to pan at a default zoom level in diagram units. Should be above 1.
|
|
103
|
+
* @default 100
|
|
104
|
+
*/
|
|
105
|
+
panRate?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Possible values of the priority threshold that the user can toggle between to hide nodes whose priority value is below it.
|
|
108
|
+
* If it is possible to toggle the priority threshold via the filter button, it should have at least two values.
|
|
109
|
+
* @default []
|
|
110
|
+
*/
|
|
111
|
+
priorityThresholds?: number[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Configuration of the guide grid in the background of the diagram.
|
|
115
|
+
*/
|
|
116
|
+
export interface GridConfig {
|
|
117
|
+
/**
|
|
118
|
+
* Whether the grid is present in the diagram.
|
|
119
|
+
* @default true
|
|
120
|
+
*/
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Color of grid elements such as the points or axes.
|
|
124
|
+
* @default "rgba(0, 0, 0, 0.1)"
|
|
125
|
+
*/
|
|
126
|
+
color?: string;
|
|
127
|
+
/**
|
|
128
|
+
* When true, the user moving or stretching nodes will cause their corners to automatically snap to the closest grid point.
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
snap?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Distance between each point of the grid of this diagram in diagram units.
|
|
134
|
+
* @default 10
|
|
135
|
+
*/
|
|
136
|
+
spacing?: number;
|
|
137
|
+
/**
|
|
138
|
+
* In a range between 0 and 1, how thick the points of the grid are relative to the distance between them.
|
|
139
|
+
* @default 0.05
|
|
140
|
+
*/
|
|
141
|
+
thickness?: number;
|
|
142
|
+
}
|
|
96
143
|
/**
|
|
97
144
|
* Configuration for which user actions are allowed in a diagram.
|
|
98
145
|
* @public
|
|
@@ -107,32 +154,40 @@ export type UserActionConfig = {
|
|
|
107
154
|
export type ComponentsConfig = {
|
|
108
155
|
/**
|
|
109
156
|
* Configuration for the buttons component in the diagram.
|
|
157
|
+
* If left undefined, it is interpreted as disabling the buttons component,
|
|
158
|
+
* same as if the attribute `enabled` in its configuration was set to `false`.
|
|
110
159
|
*/
|
|
111
160
|
buttons?: ButtonsComponentConfig;
|
|
112
161
|
/**
|
|
113
162
|
* Configuration for the errors component in the diagram.
|
|
163
|
+
* If left undefined, it is interpreted as disabling the errors component,
|
|
164
|
+
* same as if the attribute `enabled` in its configuration was set to `false`.
|
|
114
165
|
*/
|
|
115
166
|
errors?: ErrorsComponentConfig;
|
|
116
167
|
/**
|
|
117
168
|
* Configuration for the palette component in the diagram.
|
|
169
|
+
* If left undefined, it is interpreted as disabling the palette component,
|
|
170
|
+
* same as if the attribute `enabled` in its configuration was set to `false`.
|
|
118
171
|
*/
|
|
119
172
|
palette?: PaletteComponentConfig;
|
|
120
173
|
/**
|
|
121
174
|
* Configuration for the property editor component in the diagram.
|
|
175
|
+
* If left undefined, it is interpreted as disabling the property editor component,
|
|
176
|
+
* same as if the attribute `enabled` in its configuration was set to `false`.
|
|
122
177
|
*/
|
|
123
178
|
propertyEditor?: PropertyEditorComponentConfig;
|
|
124
179
|
};
|
|
125
180
|
/**
|
|
126
181
|
* Configuration for the buttons component in a diagram.
|
|
127
|
-
* @see DiagramButtonsComponent
|
|
128
182
|
* @public
|
|
183
|
+
* @see DiagramButtonsComponent
|
|
129
184
|
*/
|
|
130
185
|
export interface ButtonsComponentConfig {
|
|
131
186
|
/**
|
|
132
187
|
* Whether this component is present in the diagram.
|
|
133
188
|
* @default true
|
|
134
189
|
*/
|
|
135
|
-
|
|
190
|
+
enabled?: boolean;
|
|
136
191
|
/**
|
|
137
192
|
* Location of this component in the screen.
|
|
138
193
|
* @default 'bottom-right'
|
|
@@ -144,54 +199,54 @@ export interface ButtonsComponentConfig {
|
|
|
144
199
|
*/
|
|
145
200
|
direction?: Side;
|
|
146
201
|
/**
|
|
147
|
-
* Whether to enable the
|
|
202
|
+
* Whether to enable the user action (undo, redo) buttons in this component.
|
|
148
203
|
* @default true
|
|
149
204
|
*/
|
|
205
|
+
enableAction?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Whether to enable the filter button in this component.
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
150
210
|
enableFilter?: boolean;
|
|
151
211
|
/**
|
|
152
212
|
* Whether to enable the layout button in this component.
|
|
153
|
-
* @default
|
|
213
|
+
* @default false
|
|
154
214
|
*/
|
|
155
215
|
enableLayout?: boolean;
|
|
156
216
|
/**
|
|
157
|
-
* Whether to enable the
|
|
217
|
+
* Whether to enable the user selection (copy, paste, cut, delete) buttons in this component.
|
|
158
218
|
* @default true
|
|
159
219
|
*/
|
|
160
|
-
|
|
220
|
+
enableSelection?: boolean;
|
|
161
221
|
/**
|
|
162
|
-
* Whether to enable the zoom
|
|
222
|
+
* Whether to enable the zoom buttons in this component.
|
|
163
223
|
* @default true
|
|
164
224
|
*/
|
|
165
225
|
enableZoom?: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* The rate by which the zoom level increases or decreses in this component.
|
|
168
|
-
* @default 2
|
|
169
|
-
*/
|
|
170
|
-
zoomRate?: number;
|
|
171
226
|
}
|
|
172
227
|
/**
|
|
173
228
|
* Configuration for the errors component in a diagram.
|
|
174
|
-
* @see ErrorsComponent
|
|
175
229
|
* @public
|
|
230
|
+
* @see ErrorsComponent
|
|
176
231
|
*/
|
|
177
232
|
export interface ErrorsComponentConfig {
|
|
178
233
|
/**
|
|
179
234
|
* Whether this component is present in the diagram.
|
|
180
235
|
* @default true
|
|
181
236
|
*/
|
|
182
|
-
|
|
237
|
+
enabled?: boolean;
|
|
183
238
|
}
|
|
184
239
|
/**
|
|
185
240
|
* Configuration for the palette component in a diagram.
|
|
186
|
-
* @see PaletteComponent
|
|
187
241
|
* @public
|
|
242
|
+
* @see PaletteComponent
|
|
188
243
|
*/
|
|
189
244
|
export interface PaletteComponentConfig {
|
|
190
245
|
/**
|
|
191
246
|
* Whether this component is present in the diagram.
|
|
192
247
|
* @default true
|
|
193
248
|
*/
|
|
194
|
-
|
|
249
|
+
enabled?: boolean;
|
|
195
250
|
/**
|
|
196
251
|
* Location of this component in the screen.
|
|
197
252
|
* @default 'top-left'
|
|
@@ -208,22 +263,22 @@ export interface PaletteComponentConfig {
|
|
|
208
263
|
*/
|
|
209
264
|
width?: string;
|
|
210
265
|
/**
|
|
211
|
-
* Configuration for the sections of this palette.
|
|
266
|
+
* Configuration for the sections of this palette. By default, no sections are created.
|
|
212
267
|
* @default undefined
|
|
213
268
|
*/
|
|
214
269
|
sections?: PaletteSectionConfig[];
|
|
215
270
|
}
|
|
216
271
|
/**
|
|
217
272
|
* Configuration for the property editor component in a diagram.
|
|
218
|
-
* @see PropertyEditorComponent
|
|
219
273
|
* @public
|
|
274
|
+
* @see PropertyEditorComponent
|
|
220
275
|
*/
|
|
221
276
|
export interface PropertyEditorComponentConfig {
|
|
222
277
|
/**
|
|
223
278
|
* Whether this component is present in the diagram.
|
|
224
279
|
* @default true
|
|
225
280
|
*/
|
|
226
|
-
|
|
281
|
+
enabled?: boolean;
|
|
227
282
|
/**
|
|
228
283
|
* Location of this component in the screen.
|
|
229
284
|
* @default 'top-right'
|
|
@@ -242,8 +297,8 @@ export interface PropertyEditorComponentConfig {
|
|
|
242
297
|
}
|
|
243
298
|
/**
|
|
244
299
|
* Configuration for a palette.
|
|
245
|
-
* @see PaletteComponent
|
|
246
300
|
* @public
|
|
301
|
+
* @see PaletteComponent
|
|
247
302
|
*/
|
|
248
303
|
export interface PaletteSectionConfig {
|
|
249
304
|
/**
|
|
@@ -263,8 +318,8 @@ export interface PaletteSectionConfig {
|
|
|
263
318
|
}
|
|
264
319
|
/**
|
|
265
320
|
* Configuration for a template of a node in a palette.
|
|
266
|
-
* @see PaletteComponent
|
|
267
321
|
* @public
|
|
322
|
+
* @see PaletteComponent
|
|
268
323
|
*/
|
|
269
324
|
export interface NodeTemplateConfig {
|
|
270
325
|
/**
|
|
@@ -292,8 +347,8 @@ export interface NodeTemplateConfig {
|
|
|
292
347
|
}
|
|
293
348
|
/**
|
|
294
349
|
* Configuration for a template of a connection in a palette.
|
|
295
|
-
* @see PaletteComponent
|
|
296
350
|
* @public
|
|
351
|
+
* @see PaletteComponent
|
|
297
352
|
*/
|
|
298
353
|
export interface ConnectionTemplateConfig {
|
|
299
354
|
/**
|
|
@@ -317,18 +372,18 @@ export interface ConnectionTemplateConfig {
|
|
|
317
372
|
*/
|
|
318
373
|
icon: string;
|
|
319
374
|
/**
|
|
320
|
-
* Width of this template in
|
|
375
|
+
* Width of this template in diagram units as it appears on the palette.
|
|
321
376
|
*/
|
|
322
377
|
width: number;
|
|
323
378
|
/**
|
|
324
|
-
* Height of this template in
|
|
379
|
+
* Height of this template in diagram units as it appears on the palette.
|
|
325
380
|
*/
|
|
326
381
|
height: number;
|
|
327
382
|
}
|
|
328
383
|
/**
|
|
329
384
|
* Configuration for a type of node.
|
|
330
|
-
* @see DiagramNodeType
|
|
331
385
|
* @public
|
|
386
|
+
* @see DiagramNodeType
|
|
332
387
|
*/
|
|
333
388
|
export interface NodeTypeConfig {
|
|
334
389
|
/**
|
|
@@ -340,22 +395,22 @@ export interface NodeTypeConfig {
|
|
|
340
395
|
*/
|
|
341
396
|
name?: string;
|
|
342
397
|
/**
|
|
343
|
-
* Default width of nodes of this type in
|
|
398
|
+
* Default width of nodes of this type in diagram units.
|
|
344
399
|
* @default 1
|
|
345
400
|
*/
|
|
346
401
|
defaultWidth?: number;
|
|
347
402
|
/**
|
|
348
|
-
* Default height of nodes of this type in
|
|
403
|
+
* Default height of nodes of this type in diagram units.
|
|
349
404
|
* @default 1
|
|
350
405
|
*/
|
|
351
406
|
defaultHeight?: number;
|
|
352
407
|
/**
|
|
353
|
-
* Minimum width of nodes of this type in
|
|
408
|
+
* Minimum width of nodes of this type in diagram units.
|
|
354
409
|
* @default 1
|
|
355
410
|
*/
|
|
356
411
|
minWidth?: number;
|
|
357
412
|
/**
|
|
358
|
-
* Minimum height of nodes of this type in
|
|
413
|
+
* Minimum height of nodes of this type in diagram units.
|
|
359
414
|
* @default 1
|
|
360
415
|
*/
|
|
361
416
|
minHeight?: number;
|
|
@@ -401,15 +456,15 @@ export interface NodeTypeConfig {
|
|
|
401
456
|
priority?: number;
|
|
402
457
|
/**
|
|
403
458
|
* Properties of nodes of this type that can be edited in the property editor component.
|
|
404
|
-
* @see PropertyEditorComponent
|
|
405
459
|
* @default []
|
|
460
|
+
* @see PropertyEditorComponent
|
|
406
461
|
*/
|
|
407
462
|
properties?: Property[];
|
|
408
463
|
}
|
|
409
464
|
/**
|
|
410
465
|
* Configuration for a field that is part of another element.
|
|
411
|
-
* @see DiagramField
|
|
412
466
|
* @public
|
|
467
|
+
* @see DiagramField
|
|
413
468
|
*/
|
|
414
469
|
export interface FieldConfig {
|
|
415
470
|
/**
|
|
@@ -418,24 +473,24 @@ export interface FieldConfig {
|
|
|
418
473
|
*/
|
|
419
474
|
editable?: boolean;
|
|
420
475
|
/**
|
|
421
|
-
* The size of the font of this field in
|
|
476
|
+
* The size of the font of this field in diagram units.
|
|
422
477
|
* @default 0
|
|
423
478
|
*/
|
|
424
479
|
fontSize?: number;
|
|
425
480
|
/**
|
|
426
|
-
* The margin around the field in
|
|
481
|
+
* The margin around the field in diagram units. May be a single value or an array, in which case the value is interpreted in the same way as in CSS margin.
|
|
427
482
|
* @default 0
|
|
428
483
|
*/
|
|
429
484
|
margin?: number | number[];
|
|
430
485
|
/**
|
|
431
|
-
* The padding around the field in
|
|
486
|
+
* The padding around the field in diagram units. May be a single value or an array, in which case the value is interpreted in the same way as in CSS padding.
|
|
432
487
|
* @default 0
|
|
433
488
|
*/
|
|
434
489
|
padding?: number | number[];
|
|
435
490
|
/**
|
|
436
491
|
* The font family of the text of this field.
|
|
437
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/font-family |font-family}
|
|
438
492
|
* @default null
|
|
493
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/font-family |font-family}
|
|
439
494
|
*/
|
|
440
495
|
fontFamily?: string | null;
|
|
441
496
|
/**
|
|
@@ -467,8 +522,8 @@ export interface FieldConfig {
|
|
|
467
522
|
}
|
|
468
523
|
/**
|
|
469
524
|
* Configuration for a port that is part of another element.
|
|
470
|
-
* @see DiagramPort
|
|
471
525
|
* @public
|
|
526
|
+
* @see DiagramPort
|
|
472
527
|
*/
|
|
473
528
|
export interface PortConfig {
|
|
474
529
|
/**
|
|
@@ -487,28 +542,28 @@ export interface PortConfig {
|
|
|
487
542
|
}
|
|
488
543
|
/**
|
|
489
544
|
* Configuration for the grid of sections of a node.
|
|
490
|
-
* @see DiagramSection
|
|
491
545
|
* @public
|
|
546
|
+
* @see DiagramSection
|
|
492
547
|
*/
|
|
493
548
|
export interface SectionGridConfig {
|
|
494
549
|
/**
|
|
495
|
-
* Default widths of each column of sections of this grid in
|
|
550
|
+
* Default widths of each column of sections of this grid in diagram units.
|
|
496
551
|
*/
|
|
497
552
|
defaultWidths?: number[];
|
|
498
553
|
/**
|
|
499
|
-
* Default heights of each row of sections of this grid in
|
|
554
|
+
* Default heights of each row of sections of this grid in diagram units.
|
|
500
555
|
*/
|
|
501
556
|
defaultHeights?: number[];
|
|
502
557
|
/**
|
|
503
|
-
* Minimum widths of each column of sections of this grid in
|
|
558
|
+
* Minimum widths of each column of sections of this grid in diagram units.
|
|
504
559
|
*/
|
|
505
560
|
minWidths?: number[];
|
|
506
561
|
/**
|
|
507
|
-
* Minimum heights of each row of sections of this grid in
|
|
562
|
+
* Minimum heights of each row of sections of this grid in diagram units.
|
|
508
563
|
*/
|
|
509
564
|
minHeights?: number[];
|
|
510
565
|
/**
|
|
511
|
-
* The margin left around the sections of this grid in
|
|
566
|
+
* The margin left around the sections of this grid in diagram units.
|
|
512
567
|
* @default 0
|
|
513
568
|
*/
|
|
514
569
|
margin?: number;
|
|
@@ -520,8 +575,8 @@ export interface SectionGridConfig {
|
|
|
520
575
|
}
|
|
521
576
|
/**
|
|
522
577
|
* Configuration for a section of a node.
|
|
523
|
-
* @see DiagramSection
|
|
524
578
|
* @public
|
|
579
|
+
* @see DiagramSection
|
|
525
580
|
*/
|
|
526
581
|
export interface SectionConfig {
|
|
527
582
|
/**
|
|
@@ -603,19 +658,19 @@ export interface NodeStretchableImageLook {
|
|
|
603
658
|
*/
|
|
604
659
|
lookType: 'stretchable-image-look';
|
|
605
660
|
/**
|
|
606
|
-
* Width taken up by the images at the left of nodes using this look in
|
|
661
|
+
* Width taken up by the images at the left of nodes using this look in diagram units.
|
|
607
662
|
*/
|
|
608
663
|
leftMargin: number;
|
|
609
664
|
/**
|
|
610
|
-
* Width taken up by the images at the right of nodes using this look in
|
|
665
|
+
* Width taken up by the images at the right of nodes using this look in diagram units.
|
|
611
666
|
*/
|
|
612
667
|
rightMargin: number;
|
|
613
668
|
/**
|
|
614
|
-
* Width taken up by the images at the top of nodes using this look in
|
|
669
|
+
* Width taken up by the images at the top of nodes using this look in diagram units.
|
|
615
670
|
*/
|
|
616
671
|
topMargin: number;
|
|
617
672
|
/**
|
|
618
|
-
* Width taken up by the images at the bottom of nodes using this look in
|
|
673
|
+
* Width taken up by the images at the bottom of nodes using this look in diagram units.
|
|
619
674
|
*/
|
|
620
675
|
bottomMargin: number;
|
|
621
676
|
/**
|
|
@@ -693,8 +748,8 @@ export interface NodeStretchableImageLook {
|
|
|
693
748
|
}
|
|
694
749
|
/**
|
|
695
750
|
* Configuration for a type of connection.
|
|
696
|
-
* @see DiagramConnectionType
|
|
697
751
|
* @public
|
|
752
|
+
* @see DiagramConnectionType
|
|
698
753
|
*/
|
|
699
754
|
export interface ConnectionTypeConfig {
|
|
700
755
|
/**
|
|
@@ -716,7 +771,7 @@ export interface ConnectionTypeConfig {
|
|
|
716
771
|
*/
|
|
717
772
|
selectedColor?: string;
|
|
718
773
|
/**
|
|
719
|
-
* Width of the line of connections of this type in
|
|
774
|
+
* Width of the line of connections of this type in diagram units.
|
|
720
775
|
* @default 1
|
|
721
776
|
*/
|
|
722
777
|
width?: number;
|
|
@@ -756,8 +811,8 @@ export interface ConnectionTypeConfig {
|
|
|
756
811
|
endTypes?: string[];
|
|
757
812
|
/**
|
|
758
813
|
* Properties of connections of this type that can be edited in the property editor component.
|
|
759
|
-
* @see PropertyEditorComponent
|
|
760
814
|
* @default []
|
|
815
|
+
* @see PropertyEditorComponent
|
|
761
816
|
*/
|
|
762
817
|
properties?: Property[];
|
|
763
818
|
}
|
|
@@ -775,13 +830,13 @@ export interface ConnectionMarkerLook {
|
|
|
775
830
|
*/
|
|
776
831
|
selectedImage: string;
|
|
777
832
|
/**
|
|
778
|
-
* The width of the marker in
|
|
833
|
+
* The width of the marker in diagram units.
|
|
779
834
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker |marker}
|
|
780
835
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/markerWidth |markerWidth}
|
|
781
836
|
*/
|
|
782
837
|
markerWidth: number;
|
|
783
838
|
/**
|
|
784
|
-
* The height of the marker in
|
|
839
|
+
* The height of the marker in diagram units.
|
|
785
840
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker |marker}
|
|
786
841
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/markerHeight |markerHeight}
|
|
787
842
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Point } from '
|
|
2
|
-
import { Events } from '
|
|
3
|
-
import { DiagramElement } from './diagram-element';
|
|
1
|
+
import { Point } from '../util/canvas-util';
|
|
2
|
+
import { Events } from '../util/events';
|
|
3
|
+
import { DiagramElement } from './model/diagram-element';
|
|
4
4
|
/**
|
|
5
5
|
* Represents an action taken by the user on the diagram.
|
|
6
6
|
* @public
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagramModel } from '../diagram-model';
|
|
1
|
+
import { DiagramModel } from '../model/diagram-model';
|
|
2
2
|
import { DiagramLayout } from './diagram-layout';
|
|
3
3
|
/**
|
|
4
4
|
* A layout which places adjacent nodes close by, placing nodes in order according to breadth first search.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagramModel } from '../diagram-model';
|
|
1
|
+
import { DiagramModel } from '../model/diagram-model';
|
|
2
2
|
import { DiagramLayout } from './diagram-layout';
|
|
3
3
|
/**
|
|
4
4
|
* A layout which arranges the nodes by a breadth first search system according to their distance to the first node in the list.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagramModel } from '../diagram-model';
|
|
1
|
+
import { DiagramModel } from '../model/diagram-model';
|
|
2
2
|
import { DiagramLayout } from './diagram-layout';
|
|
3
3
|
/**
|
|
4
4
|
* A layout which arranges the nodes in trees from left to right by depth relative to the nodes with most priority.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { LineShape, LineStyle } from '../../util/line';
|
|
3
3
|
import { Side } from '../../util/svg-util';
|
|
4
|
-
import { ConnectionMarkerLook, ConnectionTypeConfig, FieldConfig } from '
|
|
4
|
+
import { ConnectionMarkerLook, ConnectionTypeConfig, FieldConfig } from '../diagram-config';
|
|
5
5
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
6
6
|
import { DiagramEntity, DiagramEntitySet } from './diagram-entity';
|
|
7
7
|
import { DiagramModel } from './diagram-model';
|
|
@@ -9,8 +9,8 @@ import { DiagramPort } from './diagram-port';
|
|
|
9
9
|
import { PropertySet, ValueSet } from './diagram-property';
|
|
10
10
|
/**
|
|
11
11
|
* Default values of the parameters of a diagram connection.
|
|
12
|
-
* @see DiagramConnection
|
|
13
12
|
* @private
|
|
13
|
+
* @see DiagramConnection
|
|
14
14
|
*/
|
|
15
15
|
export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
|
|
16
16
|
name: string;
|
|
@@ -44,8 +44,8 @@ export declare const CAN_CONNECTIONS_SHARE_PORTS = true;
|
|
|
44
44
|
export declare const CAN_TIGHTEN_CONNECTIONS = true;
|
|
45
45
|
/**
|
|
46
46
|
* A connection type, which holds properties that connections of this type share in common.
|
|
47
|
-
* @see ConnectionTypeConfig
|
|
48
47
|
* @public
|
|
48
|
+
* @see ConnectionTypeConfig
|
|
49
49
|
*/
|
|
50
50
|
export declare class DiagramConnectionType implements DiagramEntity {
|
|
51
51
|
id: string;
|
|
@@ -67,8 +67,8 @@ export declare class DiagramConnectionType implements DiagramEntity {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* A connection which goes from one port to another.
|
|
70
|
-
* @see DiagramPort
|
|
71
70
|
* @public
|
|
71
|
+
* @see DiagramPort
|
|
72
72
|
*/
|
|
73
73
|
export declare class DiagramConnection extends DiagramElement {
|
|
74
74
|
type: DiagramConnectionType;
|