@metadev/daga 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/Changelog.md +9 -0
  2. package/LICENSE.md +13 -0
  3. package/README.md +30 -0
  4. package/assets/config/generic-diagram.json +94 -0
  5. package/assets/icon/action/drop-down-arrow.svg +8 -0
  6. package/assets/icon/action/drop-horizontal-left.svg +14 -0
  7. package/assets/icon/action/drop-horizontal-none.svg +13 -0
  8. package/assets/icon/action/drop-horizontal-right.svg +14 -0
  9. package/assets/icon/action/drop-vertical-down.svg +14 -0
  10. package/assets/icon/action/drop-vertical-none.svg +13 -0
  11. package/assets/icon/action/drop-vertical-up.svg +14 -0
  12. package/assets/icon/action/filter-clear.png +0 -0
  13. package/assets/icon/buttons/center-hover.svg +10 -0
  14. package/assets/icon/buttons/center.svg +10 -0
  15. package/assets/icon/buttons/ellipsis-hover.svg +7 -0
  16. package/assets/icon/buttons/ellipsis.svg +7 -0
  17. package/assets/icon/buttons/filter-off-hover.svg +5 -0
  18. package/assets/icon/buttons/filter-off.svg +5 -0
  19. package/assets/icon/buttons/filter-on-hover.svg +5 -0
  20. package/assets/icon/buttons/filter-on.svg +5 -0
  21. package/assets/icon/buttons/layout-hover.svg +8 -0
  22. package/assets/icon/buttons/layout.svg +8 -0
  23. package/assets/icon/buttons/redo-hover.svg +5 -0
  24. package/assets/icon/buttons/redo.svg +5 -0
  25. package/assets/icon/buttons/undo-hover.svg +5 -0
  26. package/assets/icon/buttons/undo.svg +5 -0
  27. package/assets/icon/buttons/zoom-in-hover.svg +8 -0
  28. package/assets/icon/buttons/zoom-in.svg +8 -0
  29. package/assets/icon/buttons/zoom-out-hover.svg +7 -0
  30. package/assets/icon/buttons/zoom-out.svg +7 -0
  31. package/assets/icon/connection/arrow.svg +23 -0
  32. package/assets/icon/connection/empty-arrow.svg +19 -0
  33. package/assets/icon/connection/empty-diamond.svg +20 -0
  34. package/assets/icon/connection/filled-arrow.svg +19 -0
  35. package/assets/icon/connection/filled-diamond.svg +20 -0
  36. package/assets/icon/connection/line.svg +9 -0
  37. package/assets/icon/property/add.svg +3 -0
  38. package/assets/icon/property/close.svg +3 -0
  39. package/assets/icon/property/ellipsis.svg +5 -0
  40. package/assets/icon/property/hide.svg +10 -0
  41. package/assets/styles/styles.scss +181 -0
  42. package/fesm2022/metadev-daga.mjs +6480 -0
  43. package/fesm2022/metadev-daga.mjs.map +1 -0
  44. package/index.d.ts +39 -0
  45. package/lib/collapse-button/collapse-button.component.d.ts +17 -0
  46. package/lib/daga.module.d.ts +19 -0
  47. package/lib/diagram/diagram.component.d.ts +18 -0
  48. package/lib/diagram-buttons/diagram-buttons.component.d.ts +29 -0
  49. package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +6 -0
  50. package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +6 -0
  51. package/lib/diagram-editor/diagram/converters/daga-model.d.ts +59 -0
  52. package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
  53. package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
  54. package/lib/diagram-editor/diagram/diagram-action.d.ts +137 -0
  55. package/lib/diagram-editor/diagram/diagram-canvas.d.ts +99 -0
  56. package/lib/diagram-editor/diagram/diagram-config.d.ts +617 -0
  57. package/lib/diagram-editor/diagram/diagram-connection.d.ts +64 -0
  58. package/lib/diagram-editor/diagram/diagram-element.d.ts +21 -0
  59. package/lib/diagram-editor/diagram/diagram-field.d.ts +37 -0
  60. package/lib/diagram-editor/diagram/diagram-model.d.ts +64 -0
  61. package/lib/diagram-editor/diagram/diagram-node.d.ts +68 -0
  62. package/lib/diagram-editor/diagram/diagram-port.d.ts +27 -0
  63. package/lib/diagram-editor/diagram/diagram-property.d.ts +141 -0
  64. package/lib/diagram-editor/diagram/diagram-section.d.ts +36 -0
  65. package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +8 -0
  66. package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +8 -0
  67. package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +9 -0
  68. package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +10 -0
  69. package/lib/diagram-editor/diagram/layout/force-layout.d.ts +8 -0
  70. package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +8 -0
  71. package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +8 -0
  72. package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +8 -0
  73. package/lib/diagram-editor/diagram-editor.component.d.ts +27 -0
  74. package/lib/errors/diagram-error.d.ts +5 -0
  75. package/lib/errors/diagram-validator.d.ts +8 -0
  76. package/lib/errors/errors.component.d.ts +21 -0
  77. package/lib/interfaces/canvas.d.ts +203 -0
  78. package/lib/interfaces/diagram-buttons.d.ts +33 -0
  79. package/lib/interfaces/diagram-editor.d.ts +20 -0
  80. package/lib/interfaces/palette.d.ts +10 -0
  81. package/lib/interfaces/property-editor.d.ts +19 -0
  82. package/lib/object-editor/object-editor.component.d.ts +25 -0
  83. package/lib/palette/palette.component.d.ts +31 -0
  84. package/lib/property-editor/property-editor.component.d.ts +18 -0
  85. package/lib/services/canvas-provider.service.d.ts +15 -0
  86. package/lib/services/daga-configuration.service.d.ts +12 -0
  87. package/lib/text-list-editor/text-list-editor.component.d.ts +20 -0
  88. package/lib/text-map-editor/text-map-editor.component.d.ts +29 -0
  89. package/lib/util/canvas-util.d.ts +16 -0
  90. package/lib/util/events.d.ts +53 -0
  91. package/lib/util/grid.d.ts +19 -0
  92. package/lib/util/line.d.ts +15 -0
  93. package/lib/util/list-util.d.ts +2 -0
  94. package/lib/util/shape.d.ts +23 -0
  95. package/lib/util/svg-util.d.ts +22 -0
  96. package/package.json +55 -0
@@ -0,0 +1,37 @@
1
+ import { Point } from '../../util/canvas-util';
2
+ import { HorizontalAlign, VerticalAlign } from '../../util/svg-util';
3
+ import { DiagramElement } from './diagram-element';
4
+ import { DiagramModel } from './diagram-model';
5
+ import { DiagramNode } from './diagram-node';
6
+ export declare const DIAGRAM_FIELD_DEFAULTS: {
7
+ editable: boolean;
8
+ fontSize: number;
9
+ margin: number;
10
+ padding: number;
11
+ fontFamily: null;
12
+ color: string;
13
+ selectedColor: string;
14
+ horizontalAlign: HorizontalAlign;
15
+ verticalAlign: VerticalAlign;
16
+ };
17
+ export declare class DiagramField extends DiagramElement {
18
+ rootElement?: DiagramElement;
19
+ coords: Point;
20
+ width: number;
21
+ height: number;
22
+ fontSize: number;
23
+ fontFamily: string | null;
24
+ color: string;
25
+ selectedColor: string;
26
+ horizontalAlign: HorizontalAlign;
27
+ verticalAlign: VerticalAlign;
28
+ private _text;
29
+ defaultText: string;
30
+ get text(): string;
31
+ set text(value: string);
32
+ editable: boolean;
33
+ constructor(model: DiagramModel, rootElement: DiagramElement | 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);
34
+ updateInView(): void;
35
+ move(coords: Point): void;
36
+ getClosestNode(): DiagramNode | undefined;
37
+ }
@@ -0,0 +1,64 @@
1
+ import { Canvas } from '../../interfaces/canvas';
2
+ import { Point } from '../../util/canvas-util';
3
+ import { HorizontalAlign, Side, VerticalAlign } from '../../util/svg-util';
4
+ import { DiagramConnection, DiagramConnectionType } from './diagram-connection';
5
+ import { DiagramElement } from './diagram-element';
6
+ import { DiagramField } from './diagram-field';
7
+ import { DiagramNode, DiagramNodeType } from './diagram-node';
8
+ import { DiagramPort } from './diagram-port';
9
+ import { Property, ValueSet } from './diagram-property';
10
+ import { DiagramSection } from './diagram-section';
11
+ export declare class DiagramModel {
12
+ canvas?: Canvas;
13
+ renderToCanvas: boolean;
14
+ nodeTypes: DiagramNodeType[];
15
+ connectionTypes: DiagramConnectionType[];
16
+ nodes: DiagramNode[];
17
+ sections: DiagramSection[];
18
+ ports: DiagramPort[];
19
+ connections: DiagramConnection[];
20
+ fields: DiagramField[];
21
+ id: string | undefined;
22
+ name: string;
23
+ description?: string;
24
+ type: string;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ valueSet: ValueSet;
28
+ get layoutFormat(): string | undefined;
29
+ set layoutFormat(value: string | undefined);
30
+ constructor(canvas: Canvas | undefined, id: string | undefined, name: string, description: string | undefined, type: string, properties?: Property[]);
31
+ enableRenderToCanvas(): void;
32
+ disableRenderToCanvas(): void;
33
+ /**
34
+ * Deletes everything in this diagram.
35
+ */
36
+ clear(): void;
37
+ getElement(id: string): DiagramElement | undefined;
38
+ deleteElement(element: DiagramElement): void;
39
+ getNodeType(name: string): DiagramNodeType | undefined;
40
+ getConnectionType(name: string): DiagramConnectionType | undefined;
41
+ getNode(id: string): DiagramNode | undefined;
42
+ getNodes(threshold?: number): DiagramNode[];
43
+ getNodesOfType(type: string): DiagramNode[];
44
+ addNode(type: DiagramNodeType, coords: Point, id?: string | undefined, sectionIds?: (string | undefined)[], sectionPortIds?: (string | undefined)[][], sectionPortLabelIds?: (string | undefined)[][], portIds?: (string | undefined)[], portLabelIds?: (string | undefined)[], labelId?: string | undefined): DiagramNode;
45
+ deleteNode(node: DiagramNode): void;
46
+ hasNodeOfType(type: string): boolean;
47
+ getSection(id: string): DiagramSection | undefined;
48
+ getSections(threshold?: number): DiagramSection[];
49
+ addSection(node: DiagramNode, coords: Point, width: number, height: number, id?: string | undefined, portIds?: (string | undefined)[], portLabelIds?: (string | undefined)[]): DiagramSection;
50
+ deleteSection(section: DiagramSection): void;
51
+ getPort(id: string): DiagramPort | undefined;
52
+ getPorts(threshold?: number): DiagramPort[];
53
+ addPort(rootElement: DiagramElement | undefined, coords: Point, direction: Side, id?: string | undefined): DiagramPort;
54
+ deletePort(port: DiagramPort): void;
55
+ getConnection(id: string): DiagramConnection | undefined;
56
+ getConnections(threshold?: number): DiagramConnection[];
57
+ getConnectionsOfType(type: string): DiagramConnection[];
58
+ addConnection(type: DiagramConnectionType, start?: DiagramPort, end?: DiagramPort, id?: string | undefined): DiagramConnection;
59
+ deleteConnection(connection: DiagramConnection): void;
60
+ getField(id: string): DiagramField | undefined;
61
+ getFields(threshold?: number): DiagramField[];
62
+ addField(rootElement: DiagramElement | 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;
63
+ deleteField(field: DiagramField): void;
64
+ }
@@ -0,0 +1,68 @@
1
+ import { Point } from '../../util/canvas-util';
2
+ import { Side } from '../../util/svg-util';
3
+ import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionConfig } from './diagram-config';
4
+ import { DiagramConnection } from './diagram-connection';
5
+ import { DiagramElement } from './diagram-element';
6
+ import { DiagramField } from './diagram-field';
7
+ import { DiagramModel } from './diagram-model';
8
+ import { DiagramPort } from './diagram-port';
9
+ import { PropertySet, ValueSet } from './diagram-property';
10
+ import { DiagramSection } from './diagram-section';
11
+ export declare const DIAGRAM_LOOK_DEFAULTS: NodeShapedLook;
12
+ export declare const DIAGRAM_NODE_TYPE_DEFAULTS: {
13
+ name: string;
14
+ defaultWidth: number;
15
+ defaultHeight: number;
16
+ minWidth: number;
17
+ minHeight: number;
18
+ resizableX: boolean;
19
+ resizableY: boolean;
20
+ label: null;
21
+ ports: never[];
22
+ sections: null;
23
+ look: NodeShapedLook;
24
+ isUnique: boolean;
25
+ priority: number;
26
+ properties: never[];
27
+ };
28
+ export declare class DiagramNodeType {
29
+ id: string;
30
+ name: string;
31
+ defaultWidth: number;
32
+ defaultHeight: number;
33
+ minWidth: number;
34
+ minHeight: number;
35
+ resizableX: boolean;
36
+ resizableY: boolean;
37
+ label: FieldConfig | null;
38
+ ports: PortConfig[];
39
+ sections: SectionConfig | null;
40
+ look: NodeShapedLook | NodeImageLook | NodeStretchableImageLook;
41
+ isUnique: boolean;
42
+ priority: number;
43
+ propertySet: PropertySet;
44
+ constructor(options: NodeTypeConfig);
45
+ }
46
+ export declare class DiagramNode extends DiagramElement {
47
+ type: DiagramNodeType;
48
+ valueSet: ValueSet;
49
+ originalData: unknown;
50
+ label?: DiagramField;
51
+ sections: DiagramSection[];
52
+ ports: DiagramPort[];
53
+ coords: Point;
54
+ width: number;
55
+ height: number;
56
+ get name(): string;
57
+ set name(name: string);
58
+ constructor(model: DiagramModel, type: DiagramNodeType, coords?: Point, id?: string);
59
+ updateInView(): void;
60
+ getClosestPortToPoint(coords: Point): DiagramPort | undefined;
61
+ getIncomingConnections(): DiagramConnection[];
62
+ getOutgoingConnections(): DiagramConnection[];
63
+ getConnections(): DiagramConnection[];
64
+ getAdjacentNodes(): DiagramNode[];
65
+ move(coords: Point): void;
66
+ stretch(direction: Side, distance: number): void;
67
+ stretchSections(direction: Side, distance: number, point: Point): void;
68
+ }
@@ -0,0 +1,27 @@
1
+ import { Point } from '../../util/canvas-util';
2
+ import { Side } from '../../util/svg-util';
3
+ import { DiagramConnection } from './diagram-connection';
4
+ import { DiagramElement } from './diagram-element';
5
+ import { DiagramField } from './diagram-field';
6
+ import { DiagramModel } from './diagram-model';
7
+ import { DiagramNode } from './diagram-node';
8
+ export declare const DIAGRAM_PORT_DEFAULTS: {
9
+ radius: number;
10
+ highlightedColor: string;
11
+ selectedColor: string;
12
+ };
13
+ export declare class DiagramPort extends DiagramElement {
14
+ rootElement?: DiagramElement;
15
+ label?: DiagramField;
16
+ direction: Side;
17
+ coords: Point;
18
+ outgoingConnections: DiagramConnection[];
19
+ incomingConnections: DiagramConnection[];
20
+ constructor(model: DiagramModel, rootElement: DiagramElement | undefined, coords: Point, direction: Side, id?: string);
21
+ updateInView(): void;
22
+ startConnection(connection: DiagramConnection): void;
23
+ finishConnection(connection: DiagramConnection): void;
24
+ getNode(): DiagramNode | undefined;
25
+ move(coords: Point): void;
26
+ distanceTo(coords: Point): number;
27
+ }
@@ -0,0 +1,141 @@
1
+ import { DataSource } from '@metadev/lux';
2
+ export declare class Property {
3
+ /**
4
+ * The name of this property. Used to distinguish this property from others.
5
+ */
6
+ name: string;
7
+ /**
8
+ * The type of this property, which indicates the possible values that this property can have.
9
+ */
10
+ type: Type;
11
+ /**
12
+ * The default value of this property.
13
+ */
14
+ defaultValue: unknown;
15
+ /**
16
+ * Whether this property should always appear in the property editor component.
17
+ * @see PropertyEditorComponent
18
+ */
19
+ basic: boolean;
20
+ /**
21
+ * Whether the value of this property can be edited.
22
+ */
23
+ editable: boolean;
24
+ /**
25
+ * Which attribute of the parent component the value of this property is linked to. Null if none.
26
+ */
27
+ rootAttribute: string[] | string | null;
28
+ /**
29
+ * The list of possible values if the value of the property is chosen from a set of possible values. Undefined otherwise.
30
+ * @default undefined
31
+ */
32
+ options?: DataSource<string, string>;
33
+ /**
34
+ * The list of properties that are part of this property if the type of this property is 'object'.
35
+ */
36
+ properties?: Property[];
37
+ constructor(name: string, type: Type, defaultValue: unknown, basic: boolean, editable: boolean, rootAttribute: string[] | string | null);
38
+ }
39
+ export declare enum Type {
40
+ /**
41
+ * A type whose value must be a boolean.
42
+ */
43
+ Boolean = "boolean",
44
+ /**
45
+ * A type whose value must be a string representing a valid HTML color code.
46
+ */
47
+ Color = "color",
48
+ /**
49
+ * A type whose value must be a date.
50
+ */
51
+ Date = "date",
52
+ /**
53
+ * A type whose value must be a number.
54
+ */
55
+ Number = "number",
56
+ /**
57
+ * A type whose value must be an object.
58
+ */
59
+ Object = "object",
60
+ /**
61
+ * A type whose value must be one of a set of options.
62
+ */
63
+ Option = "option",
64
+ /**
65
+ * A type whose value must be a list of values picked from a set of options.
66
+ */
67
+ OptionList = "option-list",
68
+ /**
69
+ * A type whose value must be a string without newline characters.
70
+ */
71
+ Text = "text",
72
+ /**
73
+ * A type whose value must be a string with newline characters.
74
+ */
75
+ TextArea = "text-area",
76
+ /**
77
+ * A type whose value must be a list of strings.
78
+ */
79
+ TextList = "text-list",
80
+ /**
81
+ * A type whose value must be a map with string keys and values.
82
+ */
83
+ TextMap = "text-map",
84
+ /**
85
+ * A type whose value must be a time of day.
86
+ */
87
+ Time = "time",
88
+ /**
89
+ * A type whose value must be a valid URL.
90
+ */
91
+ Url = "url"
92
+ }
93
+ export declare class PropertySet {
94
+ propertyMap: {
95
+ [key: string]: Property;
96
+ };
97
+ propertyList: Property[];
98
+ constructor(properties?: Property[]);
99
+ getProperty(key: string): Property;
100
+ hasProperties(): boolean;
101
+ }
102
+ export declare class ValueSet {
103
+ rootElement: {
104
+ [key: string]: unknown;
105
+ };
106
+ propertySet: PropertySet;
107
+ displayedProperties: Property[];
108
+ hiddenProperties: Property[];
109
+ values: {
110
+ [key: string]: unknown;
111
+ };
112
+ valueSets: {
113
+ [key: string]: ValueSet;
114
+ };
115
+ constructor(propertySet: PropertySet, rootElement: unknown);
116
+ getRootElementValue(rootAttribute: string[] | string | null): unknown;
117
+ setRootElementValue(rootAttribute: string[] | string | null, value: unknown): void;
118
+ getValue(key: string): any;
119
+ getValues(): {
120
+ [key: string]: unknown;
121
+ };
122
+ hasValue(key: string): boolean;
123
+ hasSetValue(key: string): boolean;
124
+ hasAnySetValue(): boolean;
125
+ hasAnySetValueExcept(keys: string[]): boolean;
126
+ setValue(key: string, value: unknown): void;
127
+ setValues(values: {
128
+ [key: string]: unknown;
129
+ }): void;
130
+ hasValues(): boolean;
131
+ resetValues(): void;
132
+ displayProperty(property: Property): void;
133
+ hideProperty(property: Property): void;
134
+ /**
135
+ * Constructs a ValueSet with its corresponding PropertySet representing the values of the object.
136
+ */
137
+ constructSubValueSet(key: string): ValueSet;
138
+ getSubValueSet(key: string): ValueSet;
139
+ }
140
+ export declare const empty: (a: unknown) => boolean;
141
+ export declare const equals: (a: unknown, b: unknown) => boolean;
@@ -0,0 +1,36 @@
1
+ import { Point } from '../../util/canvas-util';
2
+ import { Side } from '../../util/svg-util';
3
+ import { DiagramConnection } from './diagram-connection';
4
+ import { DiagramElement } from './diagram-element';
5
+ import { DiagramField } from './diagram-field';
6
+ import { DiagramModel } from './diagram-model';
7
+ import { DiagramNode } from './diagram-node';
8
+ import { DiagramPort } from './diagram-port';
9
+ export declare const DIAGRAM_SECTION_DEFAULTS: {
10
+ sectionsX: number;
11
+ sectionsY: number;
12
+ minWidth: number;
13
+ minHeight: number;
14
+ margin: number;
15
+ label: null;
16
+ ports: never[];
17
+ look: import("./diagram-config").NodeShapedLook;
18
+ };
19
+ export declare class DiagramSection extends DiagramElement {
20
+ node?: DiagramNode;
21
+ label?: DiagramField;
22
+ ports: DiagramPort[];
23
+ coords: Point;
24
+ width: number;
25
+ height: number;
26
+ get name(): string;
27
+ set name(name: string);
28
+ constructor(model: DiagramModel, node: DiagramNode | undefined, coords: Point, width: number, height: number, id?: string);
29
+ updateInView(): void;
30
+ getClosestPortToPoint(coords: Point): DiagramPort | undefined;
31
+ getIncomingConnections(): DiagramConnection[];
32
+ getOutgoingConnections(): DiagramConnection[];
33
+ getConnections(): DiagramConnection[];
34
+ move(coords: Point): void;
35
+ stretch(direction: Side, distance: number): void;
36
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which places adjacent nodes close by, placing nodes in order according to depth first search.
5
+ */
6
+ export declare class AdjacencyLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which places adjacent nodes close by, placing nodes in order according to breadth first search.
5
+ */
6
+ export declare class BreadthAdjacencyLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which arranges the nodes by a breadth first search system,
5
+ * according to their distance to the first node in the list.
6
+ */
7
+ export declare class BreadthLayout implements DiagramLayout {
8
+ apply(model: DiagramModel): DiagramModel;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ export interface DiagramLayout {
3
+ /**
4
+ * Rearranges the diagram elements of the given model according to a layout algorithm.
5
+ */
6
+ apply(model: DiagramModel): DiagramModel;
7
+ }
8
+ export declare const layouts: {
9
+ [key: string]: DiagramLayout;
10
+ };
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which attracts connected nodes and repels unconnected nodes.
5
+ */
6
+ export declare class ForceLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which arranges all the nodes in a horizontal line.
5
+ */
6
+ export declare class HorizontalLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which arranges the nodes by their priority first.
5
+ */
6
+ export declare class PriorityLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DiagramLayout } from './diagram-layout';
3
+ /**
4
+ * A layout which arranges all the nodes in a vertical line.
5
+ */
6
+ export declare class VerticalLayout implements DiagramLayout {
7
+ apply(model: DiagramModel): DiagramModel;
8
+ }
@@ -0,0 +1,27 @@
1
+ import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
2
+ import { DiagramButtonsComponent } from '../diagram-buttons/diagram-buttons.component';
3
+ import { DiagramConfig } from '../diagram-editor/diagram/diagram-config';
4
+ import { Canvas } from '../interfaces/canvas';
5
+ import { DiagramEditor } from '../interfaces/diagram-editor';
6
+ import { PaletteComponent } from '../palette/palette.component';
7
+ import { PropertyEditorComponent } from '../property-editor/property-editor.component';
8
+ import { CanvasProviderService } from '../services/canvas-provider.service';
9
+ import { DagaConfigurationService } from '../services/daga-configuration.service';
10
+ import { Corner } from '../util/svg-util';
11
+ import * as i0 from "@angular/core";
12
+ export declare class DiagramEditorComponent implements AfterViewInit, DiagramEditor, OnInit {
13
+ private configurationService;
14
+ private canvasProvider;
15
+ appendTo: ElementRef<HTMLDivElement>;
16
+ diagramButtons: DiagramButtonsComponent;
17
+ palette: PaletteComponent;
18
+ propertyEditor: PropertyEditorComponent;
19
+ get config(): DiagramConfig;
20
+ get canvas(): Canvas;
21
+ Corner: typeof Corner;
22
+ constructor(configurationService: DagaConfigurationService, canvasProvider: CanvasProviderService);
23
+ ngOnInit(): void;
24
+ ngAfterViewInit(): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiagramEditorComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramEditorComponent, "daga-diagram-editor", never, {}, {}, never, never, true, never>;
27
+ }
@@ -0,0 +1,5 @@
1
+ export interface DiagramError {
2
+ message: string;
3
+ elementId?: string;
4
+ propertyNames?: string[];
5
+ }
@@ -0,0 +1,8 @@
1
+ import { DiagramModel } from '../diagram-editor/diagram/diagram-model';
2
+ import { DiagramError } from './diagram-error';
3
+ export interface DiagramValidator {
4
+ /**
5
+ * Checks the model and returns any list of errors the diagram has.
6
+ */
7
+ validate(model: DiagramModel): DiagramError[];
8
+ }
@@ -0,0 +1,21 @@
1
+ import { AfterViewInit, ElementRef } from '@angular/core';
2
+ import * as d3 from 'd3';
3
+ import { Canvas } from '../interfaces/canvas';
4
+ import { CanvasProviderService } from '../services/canvas-provider.service';
5
+ import { Side } from '../util/svg-util';
6
+ import { DiagramError } from './diagram-error';
7
+ import * as i0 from "@angular/core";
8
+ export declare class ErrorsComponent implements AfterViewInit {
9
+ private canvasProvider;
10
+ get canvas(): Canvas;
11
+ errorsContainer: ElementRef<HTMLDivElement>;
12
+ errors: DiagramError[];
13
+ Side: typeof Side;
14
+ constructor(canvasProvider: CanvasProviderService);
15
+ ngAfterViewInit(): void;
16
+ selectPanel(): d3.Selection<d3.BaseType, unknown, null, unknown>;
17
+ validate(): void;
18
+ showError(error: DiagramError): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorsComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<ErrorsComponent, "daga-errors", never, {}, {}, never, never, true, never>;
21
+ }