@metadev/daga 1.3.1 → 1.4.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 (38) hide show
  1. package/Changelog.md +31 -0
  2. package/assets/styles/_diagram-buttons.scss +71 -37
  3. package/assets/styles/_palette.scss +12 -4
  4. package/assets/styles/_property-editor.scss +0 -3
  5. package/assets/styles/daga.scss +9 -5
  6. package/fesm2022/metadev-daga.mjs +3069 -2588
  7. package/fesm2022/metadev-daga.mjs.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/lib/diagram/diagram.component.d.ts +28 -3
  10. package/lib/diagram-buttons/diagram-buttons.component.d.ts +14 -3
  11. package/lib/diagram-editor/diagram/converters/daga-model.d.ts +5 -0
  12. package/lib/diagram-editor/diagram/diagram-action.d.ts +61 -10
  13. package/lib/diagram-editor/diagram/diagram-canvas.d.ts +26 -7
  14. package/lib/diagram-editor/diagram/diagram-config.d.ts +199 -41
  15. package/lib/diagram-editor/diagram/diagram-connection.d.ts +1 -0
  16. package/lib/diagram-editor/diagram/diagram-element.d.ts +10 -0
  17. package/lib/diagram-editor/diagram/diagram-field.d.ts +11 -4
  18. package/lib/diagram-editor/diagram/diagram-model.d.ts +0 -16
  19. package/lib/diagram-editor/diagram/diagram-node.d.ts +5 -4
  20. package/lib/diagram-editor/diagram/diagram-port.d.ts +1 -0
  21. package/lib/diagram-editor/diagram/diagram-section.d.ts +40 -8
  22. package/lib/diagram-editor/diagram-editor.component.d.ts +2 -1
  23. package/lib/interfaces/canvas.d.ts +48 -17
  24. package/lib/palette/palette.component.d.ts +8 -6
  25. package/lib/property-editor/property-editor.component.d.ts +9 -4
  26. package/lib/services/canvas-provider.service.d.ts +1 -1
  27. package/lib/services/daga-configuration.service.d.ts +1 -1
  28. package/lib/util/events.d.ts +5 -1
  29. package/lib/util/style.d.ts +13 -0
  30. package/lib/util/text-util.d.ts +2 -0
  31. package/package.json +1 -1
  32. package/assets/config/generic-diagram.json +0 -94
  33. package/assets/icon/connection/arrow.svg +0 -23
  34. package/assets/icon/connection/empty-arrow.svg +0 -19
  35. package/assets/icon/connection/empty-diamond.svg +0 -20
  36. package/assets/icon/connection/filled-arrow.svg +0 -19
  37. package/assets/icon/connection/filled-diamond.svg +0 -20
  38. package/assets/icon/connection/line.svg +0 -9
@@ -1,7 +1,7 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { LineShape, LineStyle } from '../../util/line';
3
3
  import { ClosedShape } from '../../util/shape';
4
- import { HorizontalAlign, Side, VerticalAlign } from '../../util/svg-util';
4
+ import { Corner, HorizontalAlign, Side, VerticalAlign } from '../../util/svg-util';
5
5
  import { DiagramActions } from './diagram-action';
6
6
  import { Property } from './diagram-property';
7
7
  /**
@@ -23,7 +23,7 @@ export interface DiagramConfig {
23
23
  * Background color of this diagram.
24
24
  * @default "#FFFFFF"
25
25
  */
26
- color?: string;
26
+ backgroundColor?: string;
27
27
  /**
28
28
  * Distance between each point of the grid of this diagram in pixels. 0 or negative is interpreted as no grid.
29
29
  * @default 0
@@ -44,13 +44,9 @@ export interface DiagramConfig {
44
44
  * @default undefined
45
45
  */
46
46
  defaultConnection?: string;
47
- /**
48
- * Initial threshold value used to hide nodes whose priority value is below it.
49
- * @default undefined
50
- */
51
- defaultPriorityThreshold?: number;
52
47
  /**
53
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.
54
50
  * @default []
55
51
  */
56
52
  priorityThresholds?: number[];
@@ -66,11 +62,10 @@ export interface DiagramConfig {
66
62
  */
67
63
  userActions?: UserActionConfig;
68
64
  /**
69
- * Configuration for the palettes of this diagram. Each configuration provided will configure one palette, which will be displayed as one of the tabs in the palette component.
70
- * @see PaletteComponent
71
- * @default undefined
65
+ * Mapping of components to a boolean indicating whether those components are enabled.
66
+ * @default {}
72
67
  */
73
- palettes?: PaletteConfig[];
68
+ components?: ComponentsConfig;
74
69
  /**
75
70
  * Default attributes for each of the types of node of this diagram.
76
71
  * @default undefined
@@ -105,12 +100,152 @@ export interface DiagramConfig {
105
100
  export type UserActionConfig = {
106
101
  [key in DiagramActions]?: boolean;
107
102
  };
103
+ /**
104
+ * Configuration for the components of the diagram.
105
+ * @public
106
+ */
107
+ export type ComponentsConfig = {
108
+ /**
109
+ * Configuration for the buttons component in the diagram.
110
+ */
111
+ buttons?: ButtonsComponentConfig;
112
+ /**
113
+ * Configuration for the errors component in the diagram.
114
+ */
115
+ errors?: ErrorsComponentConfig;
116
+ /**
117
+ * Configuration for the palette component in the diagram.
118
+ */
119
+ palette?: PaletteComponentConfig;
120
+ /**
121
+ * Configuration for the property editor component in the diagram.
122
+ */
123
+ propertyEditor?: PropertyEditorComponentConfig;
124
+ };
125
+ /**
126
+ * Configuration for the buttons component in a diagram.
127
+ * @see DiagramButtonsComponent
128
+ * @public
129
+ */
130
+ export interface ButtonsComponentConfig {
131
+ /**
132
+ * Whether this component is present in the diagram.
133
+ * @default true
134
+ */
135
+ exists?: boolean;
136
+ /**
137
+ * Location of this component in the screen.
138
+ * @default 'bottom-right'
139
+ */
140
+ location?: Corner;
141
+ /**
142
+ * Direction that this component extends towards.
143
+ * @default 'top'
144
+ */
145
+ direction?: Side;
146
+ /**
147
+ * Whether to enable the filter button in this component.
148
+ * @default true
149
+ */
150
+ enableFilter?: boolean;
151
+ /**
152
+ * Whether to enable the layout button in this component.
153
+ * @default true
154
+ */
155
+ enableLayout?: boolean;
156
+ /**
157
+ * Whether to enable the undo and redo buttons in this component.
158
+ * @default true
159
+ */
160
+ enableUndoRedo?: boolean;
161
+ /**
162
+ * Whether to enable the zoom button in this component.
163
+ * @default true
164
+ */
165
+ 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
+ }
172
+ /**
173
+ * Configuration for the errors component in a diagram.
174
+ * @see ErrorsComponent
175
+ * @public
176
+ */
177
+ export interface ErrorsComponentConfig {
178
+ /**
179
+ * Whether this component is present in the diagram.
180
+ * @default true
181
+ */
182
+ exists?: boolean;
183
+ }
184
+ /**
185
+ * Configuration for the palette component in a diagram.
186
+ * @see PaletteComponent
187
+ * @public
188
+ */
189
+ export interface PaletteComponentConfig {
190
+ /**
191
+ * Whether this component is present in the diagram.
192
+ * @default true
193
+ */
194
+ exists?: boolean;
195
+ /**
196
+ * Location of this component in the screen.
197
+ * @default 'top-left'
198
+ */
199
+ location?: Corner;
200
+ /**
201
+ * Direction that this component extends towards.
202
+ * @default 'bottom'
203
+ */
204
+ direction?: Side;
205
+ /**
206
+ * Dimension of this component in the direction perpendicular to the direction that it extends towards.
207
+ * @default '12rem'
208
+ */
209
+ width?: string;
210
+ /**
211
+ * Configuration for the sections of this palette.
212
+ * @default undefined
213
+ */
214
+ sections?: PaletteSectionConfig[];
215
+ }
216
+ /**
217
+ * Configuration for the property editor component in a diagram.
218
+ * @see PropertyEditorComponent
219
+ * @public
220
+ */
221
+ export interface PropertyEditorComponentConfig {
222
+ /**
223
+ * Whether this component is present in the diagram.
224
+ * @default true
225
+ */
226
+ exists?: boolean;
227
+ /**
228
+ * Location of this component in the screen.
229
+ * @default 'top-right'
230
+ */
231
+ location?: Corner;
232
+ /**
233
+ * Direction that this component extends towards.
234
+ * @default 'bottom'
235
+ */
236
+ direction?: Side;
237
+ /**
238
+ * Dimension of this component in the direction perpendicular to the direction that it extends towards.
239
+ * @default '24rem'
240
+ */
241
+ width?: string;
242
+ }
108
243
  /**
109
244
  * Configuration for a palette.
110
245
  * @see PaletteComponent
111
246
  * @public
112
247
  */
113
- export interface PaletteConfig {
248
+ export interface PaletteSectionConfig {
114
249
  /**
115
250
  * Name of this palette. Displayed in the tab of this palette in the palette component. Can be left undefined if this is the only palette.
116
251
  */
@@ -143,7 +278,11 @@ export interface NodeTemplateConfig {
143
278
  /**
144
279
  * Label of this template as it appears on the palette and label that will be given to nodes created from this template.
145
280
  */
146
- label: string;
281
+ label?: string;
282
+ /**
283
+ * Look of the label of this template as it appears on the palette. By default, the label of the type of node is used.
284
+ */
285
+ labelLook?: FieldConfig | null;
147
286
  /**
148
287
  * Default values of the properties of nodes created from this template.
149
288
  */
@@ -172,7 +311,7 @@ export interface ConnectionTemplateConfig {
172
311
  /**
173
312
  * Background color of this template as it appears on the palette.
174
313
  */
175
- color: string;
314
+ backgroundColor: string;
176
315
  /**
177
316
  * File path of the background image of this template as it appears on the palette.
178
317
  */
@@ -202,22 +341,22 @@ export interface NodeTypeConfig {
202
341
  name?: string;
203
342
  /**
204
343
  * Default width of nodes of this type in pixels.
205
- * @default 0
344
+ * @default 1
206
345
  */
207
346
  defaultWidth?: number;
208
347
  /**
209
348
  * Default height of nodes of this type in pixels.
210
- * @default 0
349
+ * @default 1
211
350
  */
212
351
  defaultHeight?: number;
213
352
  /**
214
353
  * Minimum width of nodes of this type in pixels.
215
- * @default 0
354
+ * @default 1
216
355
  */
217
356
  minWidth?: number;
218
357
  /**
219
358
  * Minimum height of nodes of this type in pixels.
220
- * @default 0
359
+ * @default 1
221
360
  */
222
361
  minHeight?: number;
223
362
  /**
@@ -235,19 +374,19 @@ export interface NodeTypeConfig {
235
374
  * @default null
236
375
  */
237
376
  label?: FieldConfig | null;
377
+ /**
378
+ * Configuration for the sections of nodes of this type or null if nodes of this type have no sections.
379
+ * @default null
380
+ */
381
+ sectionGrid?: SectionGridConfig | null;
238
382
  /**
239
383
  * Configuration of the ports of nodes of this type.
240
384
  * @default []
241
385
  */
242
386
  ports?: PortConfig[];
243
- /**
244
- * Configuration for the sections of this diagram if applicable.
245
- * @default null
246
- */
247
- sections?: SectionConfig | null;
248
387
  /**
249
388
  * Configuration of the look of nodes of this type as it should appear to the user.
250
- * @default {lookType: 'shaped-look', shape: ClosedShape.Rectangle, color: '#FFFFFF', borderColor: '#000000', selectedColor: '#FFFFFF', selectedBorderColor: '#000000'}
389
+ * @default {lookType: 'shaped-look', shape: ClosedShape.Rectangle, fillColor: '#FFFFFF', borderColor: '#000000', selectedFillColor: '#FFFFFF', selectedBorderColor: '#000000'}
251
390
  */
252
391
  look?: NodeShapedLook | NodeImageLook | NodeStretchableImageLook;
253
392
  /**
@@ -319,6 +458,12 @@ export interface FieldConfig {
319
458
  * @default 'center'
320
459
  */
321
460
  verticalAlign?: VerticalAlign;
461
+ /**
462
+ * Whether this field and its root element should be resized automatically if the size of the text increases.
463
+ * Setting this to true should also entail setting reasonable `minWidth` and `minHeight` values for the configuration of any nodes or sections that contain this field.
464
+ * @default false
465
+ */
466
+ fit?: boolean;
322
467
  }
323
468
  /**
324
469
  * Configuration for a port that is part of another element.
@@ -341,36 +486,44 @@ export interface PortConfig {
341
486
  label?: FieldConfig | null;
342
487
  }
343
488
  /**
344
- * Configuration for the sections of a node.
489
+ * Configuration for the grid of sections of a node.
345
490
  * @see DiagramSection
346
491
  * @public
347
492
  */
348
- export interface SectionConfig {
493
+ export interface SectionGridConfig {
349
494
  /**
350
- * The number of sections this node can accomodate along the x axis.
351
- * @default 1
495
+ * Default widths of each column of sections of this grid in pixels.
352
496
  */
353
- sectionsX?: number;
497
+ defaultWidths?: number[];
354
498
  /**
355
- * The number of sections this node can accomodate along the y axis.
356
- * @default 1
499
+ * Default heights of each row of sections of this grid in pixels.
357
500
  */
358
- sectionsY?: number;
501
+ defaultHeights?: number[];
359
502
  /**
360
- * Minimum width of sections of this node in pixels.
361
- * @default 0
503
+ * Minimum widths of each column of sections of this grid in pixels.
362
504
  */
363
- minWidth?: number;
505
+ minWidths?: number[];
364
506
  /**
365
- * Minimum height of sections of this node in pixels.
366
- * @default 0
507
+ * Minimum heights of each row of sections of this grid in pixels.
367
508
  */
368
- minHeight?: number;
509
+ minHeights?: number[];
369
510
  /**
370
- * The margin left around sections in pixels.
511
+ * The margin left around the sections of this grid in pixels.
371
512
  * @default 0
372
513
  */
373
514
  margin?: number;
515
+ /**
516
+ * Configuration for the sections of this grid.
517
+ * @default [[]]
518
+ */
519
+ sections: SectionConfig[][];
520
+ }
521
+ /**
522
+ * Configuration for a section of a node.
523
+ * @see DiagramSection
524
+ * @public
525
+ */
526
+ export interface SectionConfig {
374
527
  /**
375
528
  * Configuration for the label of the sections.
376
529
  * @default null
@@ -386,6 +539,11 @@ export interface SectionConfig {
386
539
  * @default {lookType: 'shaped-look', shape: ClosedShape.Rectangle, color: '#FFFFFF', borderColor: '#000000', selectedColor: '#FFFFFF', selectedBorderColor: '#000000'}
387
540
  */
388
541
  look?: NodeShapedLook | NodeImageLook | NodeStretchableImageLook;
542
+ /**
543
+ * The priority of this section when filtering out sections below a given threshold.
544
+ * @default 0
545
+ */
546
+ priority?: number;
389
547
  }
390
548
  /**
391
549
  * Configuration for the look of a node given by shape and color.
@@ -403,7 +561,7 @@ export interface NodeShapedLook {
403
561
  /**
404
562
  * Background color of nodes using this look.
405
563
  */
406
- color: string;
564
+ fillColor: string;
407
565
  /**
408
566
  * Border color of nodes using this look.
409
567
  */
@@ -411,7 +569,7 @@ export interface NodeShapedLook {
411
569
  /**
412
570
  * Background color of nodes using this look when selected.
413
571
  */
414
- selectedColor: string;
572
+ selectedFillColor: string;
415
573
  /**
416
574
  * Border color of nodes using this look when selected.
417
575
  */
@@ -136,6 +136,7 @@ export declare class DiagramConnection extends DiagramElement {
136
136
  setStart(start?: DiagramPort): void;
137
137
  setEnd(end?: DiagramPort): void;
138
138
  tighten(): void;
139
+ getPriority(): number;
139
140
  }
140
141
  export declare class DiagramConnectionSet extends DiagramEntitySet<DiagramConnection> {
141
142
  private model;
@@ -1,5 +1,10 @@
1
1
  import * as d3 from 'd3';
2
2
  import { DiagramModel } from './diagram-model';
3
+ /**
4
+ * Default priority value for diagram elements.
5
+ * @private
6
+ */
7
+ export declare const DEFAULT_PRIORITY = 0;
3
8
  /**
4
9
  * Represents an object which exists as part of a diagram model.
5
10
  * @public
@@ -37,6 +42,11 @@ export declare abstract class DiagramElement implements DiagramEntity {
37
42
  */
38
43
  selected: boolean;
39
44
  constructor(model: DiagramModel, id: string);
45
+ /**
46
+ * Get the priority of this element to calculate whether it should be filtered out in the view or not.
47
+ * @public
48
+ */
49
+ abstract getPriority(): number;
40
50
  /**
41
51
  * Update the view of the canvas to show the current state of this element.
42
52
  * @public
@@ -15,11 +15,12 @@ export declare const DIAGRAM_FIELD_DEFAULTS: {
15
15
  fontSize: number;
16
16
  margin: number;
17
17
  padding: number;
18
- fontFamily: null;
18
+ fontFamily: string;
19
19
  color: string;
20
20
  selectedColor: string;
21
21
  horizontalAlign: HorizontalAlign;
22
22
  verticalAlign: VerticalAlign;
23
+ fit: boolean;
23
24
  };
24
25
  /**
25
26
  * A field which displays text and is part of a diagram element.
@@ -96,15 +97,21 @@ export declare class DiagramField extends DiagramElement {
96
97
  * @public
97
98
  */
98
99
  editable: boolean;
99
- constructor(model: DiagramModel, rootElement: DiagramNode | DiagramSection | DiagramPort | undefined, coords: Point, width: number, height: number, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, id?: string);
100
+ /**
101
+ * Whether this field's size can adapt to the size of the text.
102
+ * @public
103
+ */
104
+ fit: boolean;
105
+ constructor(model: DiagramModel, rootElement: DiagramNode | DiagramSection | DiagramPort | undefined, coords: Point, width: number, height: number, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, fit: boolean, id?: string);
106
+ select(): d3.Selection<SVGGElement, unknown, null, unknown> | undefined;
100
107
  updateInView(): void;
101
108
  move(coords: Point): void;
102
- getClosestNode(): DiagramNode | undefined;
109
+ getPriority(): number;
103
110
  }
104
111
  export declare class DiagramFieldSet extends DiagramEntitySet<DiagramField> {
105
112
  private model;
106
113
  constructor(model: DiagramModel);
107
- new(rootElement: DiagramNode | DiagramSection | DiagramPort | undefined, coords: Point, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, width: number, height: number, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, id?: string | undefined): DiagramField;
114
+ new(rootElement: DiagramNode | DiagramSection | DiagramPort | undefined, coords: Point, fontSize: number, fontFamily: string | null, color: string, selectedColor: string, width: number, height: number, horizontalAlign: HorizontalAlign, verticalAlign: VerticalAlign, text: string, editable: boolean, fit: boolean, id?: string | undefined): DiagramField;
108
115
  remove(id: string): void;
109
116
  filter(threshold?: number): DiagramField[];
110
117
  find(threshold?: number): DiagramField | undefined;
@@ -15,11 +15,6 @@ export declare class DiagramModel {
15
15
  * @private
16
16
  */
17
17
  canvas?: Canvas;
18
- /**
19
- * Whether changes to this model are updated in the canvas in real time.
20
- * @private
21
- */
22
- renderToCanvas: boolean;
23
18
  /**
24
19
  * Nodes of this model.
25
20
  * @see DiagramNode
@@ -86,17 +81,6 @@ export declare class DiagramModel {
86
81
  */
87
82
  valueSet: ValueSet;
88
83
  constructor(canvas: Canvas | undefined, id: string | undefined, name: string, description: string | undefined, type: string, properties?: Property[]);
89
- /**
90
- * Enables rendering to canvas in real time and updates the view of this model in the canvas.
91
- * @public
92
- */
93
- enableRenderToCanvas(): void;
94
- /**
95
- * Disables rendering to canvas in real time.
96
- * Used to perform batches of changes to the model without the computational cost of rendering each change to the canvas individually.
97
- * @public
98
- */
99
- disableRenderToCanvas(): void;
100
84
  /**
101
85
  * Deletes everything in this diagram.
102
86
  * @public
@@ -1,6 +1,6 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { Side } from '../../util/svg-util';
3
- import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionConfig } from './diagram-config';
3
+ import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionGridConfig } from './diagram-config';
4
4
  import { DiagramConnection } from './diagram-connection';
5
5
  import { DiagramElement, DiagramEntity, DiagramEntitySet } from './diagram-element';
6
6
  import { DiagramField } from './diagram-field';
@@ -29,7 +29,7 @@ export declare const DIAGRAM_NODE_TYPE_DEFAULTS: {
29
29
  resizableY: boolean;
30
30
  label: null;
31
31
  ports: never[];
32
- sections: null;
32
+ sectionGrid: null;
33
33
  look: NodeShapedLook;
34
34
  isUnique: boolean;
35
35
  priority: number;
@@ -51,7 +51,7 @@ export declare class DiagramNodeType implements DiagramEntity {
51
51
  resizableY: boolean;
52
52
  label: FieldConfig | null;
53
53
  ports: PortConfig[];
54
- sections: SectionConfig | null;
54
+ sectionGrid: SectionGridConfig | null;
55
55
  look: NodeShapedLook | NodeImageLook | NodeStretchableImageLook;
56
56
  isUnique: boolean;
57
57
  priority: number;
@@ -115,6 +115,7 @@ export declare class DiagramNode extends DiagramElement {
115
115
  set name(name: string);
116
116
  constructor(model: DiagramModel, type: DiagramNodeType, coords?: Point, id?: string);
117
117
  updateInView(): void;
118
+ getPriority(): number;
118
119
  getClosestPortToPoint(coords: Point): DiagramPort | undefined;
119
120
  getIncomingConnections(): DiagramConnection[];
120
121
  getOutgoingConnections(): DiagramConnection[];
@@ -122,7 +123,7 @@ export declare class DiagramNode extends DiagramElement {
122
123
  getAdjacentNodes(): DiagramNode[];
123
124
  move(coords: Point): void;
124
125
  stretch(direction: Side, distance: number): void;
125
- stretchSections(direction: Side, distance: number, point: Point): void;
126
+ stretchSections(direction: Side, distance: number, indexX: number, indexY: number): void;
126
127
  }
127
128
  export declare class DiagramNodeSet extends DiagramEntitySet<DiagramNode> {
128
129
  private model;
@@ -59,6 +59,7 @@ export declare class DiagramPort extends DiagramElement {
59
59
  startConnection(connection: DiagramConnection): void;
60
60
  finishConnection(connection: DiagramConnection): void;
61
61
  getNode(): DiagramNode | undefined;
62
+ getPriority(): number;
62
63
  move(coords: Point): void;
63
64
  distanceTo(coords: Point): number;
64
65
  }
@@ -1,6 +1,6 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { Side } from '../../util/svg-util';
3
- import { NodeShapedLook } from './diagram-config';
3
+ import { NodeShapedLook, SectionConfig } from './diagram-config';
4
4
  import { DiagramConnection } from './diagram-connection';
5
5
  import { DiagramElement, DiagramEntitySet } from './diagram-element';
6
6
  import { DiagramField } from './diagram-field';
@@ -19,15 +19,35 @@ export declare const DIAGRAM_SECTION_LOOK_DEFAULTS: NodeShapedLook;
19
19
  * @private
20
20
  */
21
21
  export declare const DIAGRAM_SECTION_DEFAULTS: {
22
- sectionsX: number;
23
- sectionsY: number;
24
- minWidth: number;
25
- minHeight: number;
26
- margin: number;
27
22
  label: null;
28
23
  ports: never[];
29
24
  look: NodeShapedLook;
25
+ priority: number;
30
26
  };
27
+ /**
28
+ * Default value of the default width of a diagram section.
29
+ * @see DiagramSection
30
+ * @private
31
+ */
32
+ export declare const DIAGRAM_SECTION_DEFAULT_WIDTH = 1;
33
+ /**
34
+ * Default value of the default height of a diagram section.
35
+ * @see DiagramSection
36
+ * @private
37
+ */
38
+ export declare const DIAGRAM_SECTION_DEFAULT_HEIGHT = 1;
39
+ /**
40
+ * Default value of the minimum width of a diagram section.
41
+ * @see DiagramSection
42
+ * @private
43
+ */
44
+ export declare const DIAGRAM_SECTION_MIN_WIDTH = 1;
45
+ /**
46
+ * Default value of the minimum height of a diagram section.
47
+ * @see DiagramSection
48
+ * @private
49
+ */
50
+ export declare const DIAGRAM_SECTION_MIN_HEIGHT = 1;
31
51
  /**
32
52
  * A section of a node which can have connections and display a property of the node.
33
53
  * @see DiagramConnection
@@ -41,6 +61,14 @@ export declare class DiagramSection extends DiagramElement {
41
61
  * @public
42
62
  */
43
63
  node?: DiagramNode;
64
+ /**
65
+ * X index of this section in the parent node's section array.
66
+ */
67
+ indexXInNode: number;
68
+ /**
69
+ * Y index of this section in the parent node's section array.
70
+ */
71
+ indexYInNode: number;
44
72
  /**
45
73
  * Label of this section.
46
74
  * @public
@@ -72,8 +100,12 @@ export declare class DiagramSection extends DiagramElement {
72
100
  */
73
101
  get name(): string;
74
102
  set name(name: string);
75
- constructor(model: DiagramModel, node: DiagramNode | undefined, coords: Point, width: number, height: number, id?: string);
103
+ constructor(model: DiagramModel, node: DiagramNode | undefined, indexXInNode: number, indexYInNode: number, coords: Point, width: number, height: number, id?: string);
76
104
  updateInView(): void;
105
+ getConfig(): SectionConfig | undefined;
106
+ getMinWidth(): number;
107
+ getMinHeight(): number;
108
+ getPriority(): number;
77
109
  getClosestPortToPoint(coords: Point): DiagramPort | undefined;
78
110
  getIncomingConnections(): DiagramConnection[];
79
111
  getOutgoingConnections(): DiagramConnection[];
@@ -84,7 +116,7 @@ export declare class DiagramSection extends DiagramElement {
84
116
  export declare class DiagramSectionSet extends DiagramEntitySet<DiagramSection> {
85
117
  private model;
86
118
  constructor(model: DiagramModel);
87
- new(node: DiagramNode, coords: Point, width: number, height: number, id?: string | undefined, portIds?: (string | undefined)[], portLabelIds?: (string | undefined)[]): DiagramSection;
119
+ new(node: DiagramNode, indexXInNode: number, indexYInNode: number, coords: Point, width: number, height: number, id?: string | undefined, portIds?: (string | undefined)[], portLabelIds?: (string | undefined)[]): DiagramSection;
88
120
  remove(id: string): void;
89
121
  filter(threshold?: number): DiagramSection[];
90
122
  find(threshold?: number): DiagramSection | undefined;
@@ -7,7 +7,7 @@ import { PaletteComponent } from '../palette/palette.component';
7
7
  import { PropertyEditorComponent } from '../property-editor/property-editor.component';
8
8
  import { CanvasProviderService } from '../services/canvas-provider.service';
9
9
  import { DagaConfigurationService } from '../services/daga-configuration.service';
10
- import { Corner } from '../util/svg-util';
10
+ import { Corner, Side } from '../util/svg-util';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
13
13
  * A diagram's user interface editor.
@@ -23,6 +23,7 @@ export declare class DiagramEditorComponent implements AfterViewInit, DiagramEdi
23
23
  get config(): DiagramConfig;
24
24
  get canvas(): Canvas;
25
25
  Corner: typeof Corner;
26
+ Side: typeof Side;
26
27
  constructor(configurationService: DagaConfigurationService, canvasProvider: CanvasProviderService);
27
28
  ngOnInit(): void;
28
29
  ngAfterViewInit(): void;