@finos/legend-extension-dsl-diagram 1.0.27 → 1.0.30
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/DiagramRenderer.d.ts +4 -1
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +63 -63
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.d.ts.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.js +3 -1
- package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
- package/lib/components/studio/DiagramEditor.d.ts.map +1 -1
- package/lib/components/studio/DiagramEditor.js +10 -9
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts +2 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +11 -0
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts +34 -0
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts.map +1 -0
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js +94 -0
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js.map +1 -0
- package/lib/helpers/DiagramHelper.d.ts +16 -1
- package/lib/helpers/DiagramHelper.d.ts.map +1 -1
- package/lib/helpers/DiagramHelper.js +90 -3
- package/lib/helpers/DiagramHelper.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js +0 -4
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts +0 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js +0 -20
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts +0 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.js +1 -10
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.d.ts +0 -12
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js +1 -56
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts +0 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js +0 -7
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts +0 -4
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js +0 -7
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts +6 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js +6 -14
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts +24 -23
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js +57 -129
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.d.ts +0 -8
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js +0 -19
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts +3 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js +3 -3
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js +2 -2
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js.map +1 -1
- package/lib/package.json +4 -4
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts +57 -0
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts.map +1 -0
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js +94 -0
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js.map +1 -0
- package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
- package/lib/stores/studio/DiagramEditorState.js +13 -10
- package/lib/stores/studio/DiagramEditorState.js.map +1 -1
- package/package.json +11 -11
- package/src/DiagramRenderer.ts +136 -72
- package/src/components/studio/ClassDiagramPreview.tsx +3 -1
- package/src/components/studio/DiagramEditor.tsx +17 -11
- package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +17 -0
- package/src/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.ts +153 -0
- package/src/helpers/DiagramHelper.ts +126 -4
- package/src/index.ts +1 -4
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.ts +0 -6
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.ts +0 -23
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.ts +0 -13
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.ts +1 -64
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.ts +0 -11
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.ts +0 -17
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.ts +6 -16
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts +71 -169
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts +0 -21
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts +3 -3
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts +6 -3
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts +4 -4
- package/src/stores/studio/DSLDiagram_GraphModifierHelper.ts +164 -0
- package/src/stores/studio/DiagramEditorState.ts +28 -9
- package/tsconfig.json +2 -0
package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js
CHANGED
@@ -13,60 +13,53 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import { RelationShipEdgeView as RelationshipEdgeView } from './DSLDiagram_RelationshipEdgeView';
|
16
|
+
import { hashArray } from '@finos/legend-shared';
|
17
|
+
import { RelationshipEdgeView } from './DSLDiagram_RelationshipEdgeView';
|
19
18
|
import { Point } from './geometry/DSLDiagram_Point';
|
20
|
-
import { Vector } from './geometry/DSLDiagram_Vector';
|
21
19
|
import { ClassViewExplicitReference } from './DSLDiagram_ClassViewReference';
|
22
20
|
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
23
|
-
/**
|
24
|
-
* For a path, only counts the points which lie outside of the 2 class views
|
25
|
-
*/
|
26
|
-
export const manageInsidePointsDynamically = (path, from, to) => {
|
27
|
-
if (!path.length) {
|
28
|
-
return [];
|
29
|
-
}
|
30
|
-
let start = 0;
|
31
|
-
let startPoint = path[start];
|
32
|
-
while (start < path.length - 1 && from.contains(startPoint.x, startPoint.y)) {
|
33
|
-
start++;
|
34
|
-
startPoint = path[start];
|
35
|
-
}
|
36
|
-
let end = path.length - 1;
|
37
|
-
let endPoint = path[end];
|
38
|
-
while (end > 0 && to.contains(endPoint.x, endPoint.y)) {
|
39
|
-
end--;
|
40
|
-
endPoint = path[end];
|
41
|
-
}
|
42
|
-
return path.slice(start - 1, end + 2);
|
43
|
-
};
|
44
21
|
export class RelationshipView {
|
45
22
|
owner;
|
46
23
|
from;
|
47
24
|
to;
|
48
|
-
|
49
|
-
|
25
|
+
/**
|
26
|
+
* NOTE: Unlike in the protocol model, we don't store the end points in the path but only store the
|
27
|
+
* offsets of that point from the center of the end/start classviews. The main purpose here is to
|
28
|
+
* make less error. We don't need to bother maintaining these points in the path. They are
|
29
|
+
* auto-managed. Even if an erroneous path is set (e.g. an empty list of points), this logic
|
30
|
+
* that we have will rectify that and create a sensible path.
|
31
|
+
*
|
32
|
+
* In exchange, this logic is a little complicated, we have tried to document as much about it as we could
|
33
|
+
* but the logic is not straight forward. Perhaps, we could simplify this in the future.
|
34
|
+
*/
|
50
35
|
path = [];
|
51
36
|
constructor(owner, from, to) {
|
52
|
-
makeObservable(this, {
|
53
|
-
path: observable,
|
54
|
-
setPath: action,
|
55
|
-
changePoint: action,
|
56
|
-
fullPath: computed,
|
57
|
-
});
|
58
37
|
this.owner = owner;
|
59
38
|
this.from = new RelationshipEdgeView(ClassViewExplicitReference.create(from));
|
60
39
|
this.to = new RelationshipEdgeView(ClassViewExplicitReference.create(to));
|
61
40
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
41
|
+
/**
|
42
|
+
* Calculate the end points of the edge using offset, otherwise, use the center
|
43
|
+
*/
|
44
|
+
computeEdgeEndpoint(edgeView, allowChange = true) {
|
45
|
+
const box = edgeView.classView.value;
|
46
|
+
const center = edgeView.classView.value.center();
|
47
|
+
const newX = center.x + (edgeView.offsetX ?? 0);
|
48
|
+
const newY = center.y + (edgeView.offsetY ?? 0);
|
49
|
+
if (box.contains(newX, newY)) {
|
50
|
+
return new Point(newX, newY);
|
51
|
+
}
|
52
|
+
if (allowChange) {
|
53
|
+
edgeView.offsetX = 0;
|
54
|
+
edgeView.offsetY = 0;
|
55
|
+
}
|
56
|
+
return new Point(center.x, center.y);
|
67
57
|
}
|
68
58
|
/**
|
69
|
-
* Compute the full path for
|
59
|
+
* Compute the full path for the relationship view (including the ends even if these
|
60
|
+
* ends lie inside of the classviews)
|
61
|
+
*
|
62
|
+
* Notice here that the end points are recomputed every time, as such
|
70
63
|
* `path` only stores point that matters to the edge but are not end points
|
71
64
|
*/
|
72
65
|
buildFullPath(allowChange = true) {
|
@@ -77,108 +70,43 @@ export class RelationshipView {
|
|
77
70
|
];
|
78
71
|
}
|
79
72
|
/**
|
80
|
-
*
|
73
|
+
* For a path, only keep **at most** 1 point at each end that lies inside the class view.
|
74
|
+
* If there is no inside points, none of kept, so the path only contains outside points.
|
81
75
|
*/
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
/**
|
86
|
-
* Flatten the path if the angle is wide enough
|
87
|
-
* Also `swallow` points in path which lie inside of the rectangle of a view
|
88
|
-
*/
|
89
|
-
possiblyFlattenPath() {
|
90
|
-
const fullPath = this.buildFullPath();
|
91
|
-
// NOTE: this method here will `swallow` up points inside of the boxes
|
92
|
-
const newPath = manageInsidePointsDynamically(fullPath, this.from.classView.value, this.to.classView.value);
|
93
|
-
// recompute the offset point from center inside of `from` and `to` classviews.
|
94
|
-
// for each, we first check if `manageInsidePointsDynamically` removes any points from the full path
|
95
|
-
// if it does we will update the offset
|
96
|
-
if (newPath[0] !== fullPath[0]) {
|
97
|
-
const center = this.from.classView.value.center();
|
98
|
-
this.from.setOffsetX(newPath[0].x - center.x);
|
99
|
-
this.from.setOffsetY(newPath[0].y - center.y);
|
76
|
+
static pruneUnnecessaryInsidePoints = (path, from, to) => {
|
77
|
+
if (!path.length) {
|
78
|
+
return [];
|
100
79
|
}
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
80
|
+
let start = 0;
|
81
|
+
let startPoint = path[start];
|
82
|
+
while (start < path.length - 1 &&
|
83
|
+
from.contains(startPoint.x, startPoint.y)) {
|
84
|
+
start++;
|
85
|
+
startPoint = path[start];
|
105
86
|
}
|
106
|
-
//
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
if (Math.abs(angle - 180) > 5) {
|
114
|
-
result.push(newPath[i + 1]);
|
115
|
-
}
|
87
|
+
// NOTE: due to the usage path, we could make sure `end > start`, but maybe this
|
88
|
+
// is an improvement to be done
|
89
|
+
let end = path.length - 1;
|
90
|
+
let endPoint = path[end];
|
91
|
+
while (end > 0 && to.contains(endPoint.x, endPoint.y)) {
|
92
|
+
end--;
|
93
|
+
endPoint = path[end];
|
116
94
|
}
|
117
|
-
//
|
118
|
-
|
119
|
-
}
|
95
|
+
// NOTE: slice upper bound is exclusive, hence the +2 instead of +1
|
96
|
+
return path.slice(start - 1, end + 2);
|
97
|
+
};
|
120
98
|
/**
|
121
|
-
*
|
122
|
-
* (within a threshold of proximity) from the coordinate and put this in the path array
|
123
|
-
* so it doesn't look too weird
|
124
|
-
*/
|
125
|
-
findOrBuildPoint(x, y, zoom, allowChange = true) {
|
126
|
-
for (const pt of this.path) {
|
127
|
-
if (Math.sqrt((x - pt.x) * (x - pt.x) + (y - pt.y) * (y - pt.y)) <
|
128
|
-
10 / zoom) {
|
129
|
-
return pt;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
const fullPath = this.buildFullPath(allowChange);
|
133
|
-
const newPath = [];
|
134
|
-
let point;
|
135
|
-
for (let i = 0; i < fullPath.length - 1; i++) {
|
136
|
-
const a = fullPath[i];
|
137
|
-
const b = fullPath[i + 1];
|
138
|
-
const n = new Vector(a.x, a.y).normal(new Vector(b.x, b.y)).norm();
|
139
|
-
const v = Vector.fromPoints(a, new Point(x, y));
|
140
|
-
if (Math.abs(n.dotProduct(v)) < 5 / zoom) {
|
141
|
-
const lx = (a.x < b.x ? a.x : b.x) - 5 / zoom;
|
142
|
-
const hx = (a.x < b.x ? b.x : a.x) + 5 / zoom;
|
143
|
-
const ly = (a.y < b.y ? a.y : b.y) - 5 / zoom;
|
144
|
-
const hy = (a.y < b.y ? b.y : a.y) + 5 / zoom;
|
145
|
-
if (lx <= x && x <= hx && ly <= y && y <= hy) {
|
146
|
-
point = new Point(x, y);
|
147
|
-
newPath.push(point);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
if (i < fullPath.length - 2) {
|
151
|
-
newPath.push(fullPath[i + 1]);
|
152
|
-
}
|
153
|
-
}
|
154
|
-
if (point && allowChange) {
|
155
|
-
this.setPath(newPath);
|
156
|
-
}
|
157
|
-
return point;
|
158
|
-
}
|
159
|
-
/**
|
160
|
-
* Calculate the end points of the edge using offset, otherwise, use the center
|
99
|
+
* This method will compute the full path from the offset within class view for serialization and persistence purpose
|
161
100
|
*/
|
162
|
-
|
163
|
-
|
164
|
-
const center = edgeView.classView.value.center();
|
165
|
-
const newX = center.x + (edgeView.offsetX ?? 0);
|
166
|
-
const newY = center.y + (edgeView.offsetY ?? 0);
|
167
|
-
if (box.contains(newX, newY)) {
|
168
|
-
return new Point(newX, newY);
|
169
|
-
}
|
170
|
-
if (allowChange) {
|
171
|
-
edgeView.setOffsetX(0);
|
172
|
-
edgeView.setOffsetY(0);
|
173
|
-
}
|
174
|
-
return new Point(center.x, center.y);
|
101
|
+
get pathForSerialization() {
|
102
|
+
return RelationshipView.pruneUnnecessaryInsidePoints(this.buildFullPath(), this.from.classView.value, this.to.classView.value);
|
175
103
|
}
|
176
104
|
get hashCode() {
|
177
105
|
return hashArray([
|
178
106
|
DIAGRAM_HASH_STRUCTURE.RELATIONSHIP_VIEW,
|
179
107
|
this.from.classView.value.id,
|
180
108
|
this.to.classView.value.id,
|
181
|
-
hashArray(this.
|
109
|
+
hashArray(this.pathForSerialization),
|
182
110
|
]);
|
183
111
|
}
|
184
112
|
}
|
package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_RelationshipView.js","sourceRoot":"","sources":["../../../../../../src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"DSLDiagram_RelationshipView.js","sourceRoot":"","sources":["../../../../../../src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,OAAO,gBAAgB;IAC3B,KAAK,CAAU;IACf,IAAI,CAAuB;IAC3B,EAAE,CAAuB;IACzB;;;;;;;;;OASG;IACH,IAAI,GAAY,EAAE,CAAC;IAEnB,YAAY,KAAc,EAAE,IAAe,EAAE,EAAa;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAoB,CAClC,0BAA0B,CAAC,MAAM,CAAC,IAAI,CAAC,CACxC,CAAC;QACF,IAAI,CAAC,EAAE,GAAG,IAAI,oBAAoB,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACK,mBAAmB,CACzB,QAA8B,EAC9B,WAAW,GAAG,IAAI;QAElB,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;QACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC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AU,CAAC;QAElC,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;YACrD,GAAG,EAAE,CAAC;YACN,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAU,CAAC;SAC/B;QAED,mEAAmE;QACnE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF;;OAEG;IACH,IAAI,oBAAoB;QACtB,OAAO,gBAAgB,CAAC,4BAA4B,CAClD,IAAI,CAAC,aAAa,EAAE,EACpB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EACzB,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CACxB,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,SAAS,CAAC;YACf,sBAAsB,CAAC,iBAAiB;YACxC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YAC5B,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YAC1B,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACrC,CAAC,CAAC;IACL,CAAC"}
|
@@ -21,14 +21,6 @@ export declare class PositionedRectangle implements Hashable {
|
|
21
21
|
rectangle: Rectangle;
|
22
22
|
dummyObservable: {};
|
23
23
|
constructor(position: Point, rectangle: Rectangle);
|
24
|
-
setRectangle(value: Rectangle): void;
|
25
|
-
setPosition(value: Point): void;
|
26
|
-
/**
|
27
|
-
* NOTE: Having `position` and `rectangle` as observables compromises the performance of diagram
|
28
|
-
* so we want to have a way to refresh the hash for change detection to pick up new hash when we resize
|
29
|
-
* the class view box or move it.
|
30
|
-
*/
|
31
|
-
forceRefreshHash(): void;
|
32
24
|
edgePoint: () => Point;
|
33
25
|
center: () => Point;
|
34
26
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_PositionedRectangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
1
|
+
{"version":3,"file":"DSLDiagram_PositionedRectangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,qBAAa,mBAAoB,YAAW,QAAQ;IAClD,QAAQ,EAAE,KAAK,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,KAAM;gBAET,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAKjD,SAAS,QAAO,KAAK,CAIjB;IACJ,MAAM,QAAO,KAAK,CAId;IAEJ;;OAEG;IACH,yBAAyB,IAAI,mBAAmB;IAUhD,WAAW,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO;IAmBnD,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO;IAUvC,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,mBAAmB;IAiB3D,IAAI,QAAQ,IAAI,MAAM,CAOrB;CACF"}
|
@@ -13,7 +13,6 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { observable, action, makeObservable } from 'mobx';
|
17
16
|
import { hashArray } from '@finos/legend-shared';
|
18
17
|
import { Point } from './DSLDiagram_Point';
|
19
18
|
import { Rectangle } from './DSLDiagram_Rectangle';
|
@@ -23,27 +22,9 @@ export class PositionedRectangle {
|
|
23
22
|
rectangle;
|
24
23
|
dummyObservable = {};
|
25
24
|
constructor(position, rectangle) {
|
26
|
-
makeObservable(this, {
|
27
|
-
dummyObservable: observable,
|
28
|
-
forceRefreshHash: action,
|
29
|
-
});
|
30
25
|
this.position = position;
|
31
26
|
this.rectangle = rectangle;
|
32
27
|
}
|
33
|
-
setRectangle(value) {
|
34
|
-
this.rectangle = value;
|
35
|
-
}
|
36
|
-
setPosition(value) {
|
37
|
-
this.position = value;
|
38
|
-
}
|
39
|
-
/**
|
40
|
-
* NOTE: Having `position` and `rectangle` as observables compromises the performance of diagram
|
41
|
-
* so we want to have a way to refresh the hash for change detection to pick up new hash when we resize
|
42
|
-
* the class view box or move it.
|
43
|
-
*/
|
44
|
-
forceRefreshHash() {
|
45
|
-
this.dummyObservable = {};
|
46
|
-
}
|
47
28
|
edgePoint = () => new Point(this.position.x + this.rectangle.width, this.position.y + this.rectangle.height);
|
48
29
|
center = () => new Point(this.position.x + this.rectangle.width / 2, this.position.y + this.rectangle.height / 2);
|
49
30
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_PositionedRectangle.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"DSLDiagram_PositionedRectangle.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,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AAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC/D,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAC1D,CAAC;SACH;QACD,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5B,MAAM,GAAG,IAAI,mBAAmB,CAC9B,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,EAChE,IAAI,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAC1D,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,QAAQ;QACV,IAAI,CAAC,eAAe,CAAC,CAAC,qDAAqD;QAC3E,OAAO,SAAS,CAAC;YACf,sBAAsB,CAAC,oBAAoB;YAC3C,IAAI,CAAC,QAAQ;YACb,IAAI,CAAC,SAAS;SACf,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts
CHANGED
@@ -15,11 +15,11 @@
|
|
15
15
|
*/
|
16
16
|
import type { Point } from './DSLDiagram_Point';
|
17
17
|
export declare class Vector {
|
18
|
-
x: number;
|
19
|
-
y: number;
|
18
|
+
readonly x: number;
|
19
|
+
readonly y: number;
|
20
20
|
constructor(x: number, y: number);
|
21
21
|
static fromPoints(a: Point, b: Point): Vector;
|
22
|
-
|
22
|
+
unit(): Vector;
|
23
23
|
normal(other: Vector): Vector;
|
24
24
|
dotProduct(other: Vector): number;
|
25
25
|
}
|
package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_Vector.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,qBAAa,MAAM;IACjB,CAAC,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"DSLDiagram_Vector.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,qBAAa,MAAM;IACjB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;gBAEP,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAKhC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM;IAI7C,IAAI,IAAI,MAAM;IAKd,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI7B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAGlC"}
|
package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_Vector.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,MAAM;
|
1
|
+
{"version":3,"file":"DSLDiagram_Vector.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,MAAM;IACR,CAAC,CAAS;IACV,CAAC,CAAS;IAEnB,YAAY,CAAS,EAAE,CAAS;QAC9B,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,CAAQ,EAAE,CAAQ;QAClC,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"V1_DSLDiagram_GraphBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,mCAAmC,EACnC,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+EAA+E,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,iFAAiF,CAAC;AAG5G,OAAO,EAAE,YAAY,EAAE,MAAM,oFAAoF,CAAC;AAClH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0FAA0F,CAAC;AAC9H,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAGpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oEAAoE,CAAC;AAC1G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;
|
1
|
+
{"version":3,"file":"V1_DSLDiagram_GraphBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,mCAAmC,EACnC,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+EAA+E,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,iFAAiF,CAAC;AAG5G,OAAO,EAAE,YAAY,EAAE,MAAM,oFAAoF,CAAC;AAClH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0FAA0F,CAAC;AAC9H,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAGpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oEAAoE,CAAC;AAC1G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;AAwBtH,eAAO,MAAM,iBAAiB,cACjB,YAAY,WACd,sBAAsB,WACtB,OAAO,KACf,SA4BF,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBACjB,eAAe,WACpB,sBAAsB,WACtB,OAAO,KACf,YAwBF,CAAC;AAEF,eAAO,MAAM,0BAA0B,uBACjB,qBAAqB,WAChC,OAAO,KACf,kBAqBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,SACtB,MAAM,WACH,sBAAsB,KAC9B,oCAAoC,OAAO,CAG3C,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js
CHANGED
@@ -20,7 +20,7 @@ import { Point } from '../../../../../metamodels/pure/packageableElements/diagra
|
|
20
20
|
import { Rectangle } from '../../../../../metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
|
21
21
|
import { PropertyView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
22
22
|
import { GeneralizationView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
23
|
-
import { getClassView } from '../../../../../../helpers/DiagramHelper';
|
23
|
+
import { getClassView, _relationshipView_simplifyPath, } from '../../../../../../helpers/DiagramHelper';
|
24
24
|
const buildPoint = (point) => {
|
25
25
|
const x = guaranteeNonNullable(point.x, `Point 'x' coordinate is missing`);
|
26
26
|
const y = guaranteeNonNullable(point.y, `Point 'y' coordinate is missing`);
|
@@ -52,7 +52,7 @@ export const V1_buildPropertyView = (propertyView, context, diagram) => {
|
|
52
52
|
const property = context.resolveOwnedProperty(propertyView.property);
|
53
53
|
const view = new PropertyView(diagram, property, sourceClassView, targetClassView);
|
54
54
|
view.path = propertyView.line.points.map((point) => buildPoint(point));
|
55
|
-
view
|
55
|
+
_relationshipView_simplifyPath(view); // transform the line because we store only 2 end points that are inside points and we will calculate the offset
|
56
56
|
return view;
|
57
57
|
};
|
58
58
|
export const V1_buildGeneralizationView = (generalizationView, diagram) => {
|
@@ -61,7 +61,7 @@ export const V1_buildGeneralizationView = (generalizationView, diagram) => {
|
|
61
61
|
const targetClassView = guaranteeNonNullable(getClassView(diagram, guaranteeNonNullable(generalizationView.targetView)), `Generalization view 'targetView' field is missing`);
|
62
62
|
const view = new GeneralizationView(diagram, sourceClassView, targetClassView);
|
63
63
|
view.path = generalizationView.line.points.map((point) => buildPoint(point));
|
64
|
-
view
|
64
|
+
_relationshipView_simplifyPath(view); // transform the line because we store only 2 end points that are inside points and we will calculate the offset
|
65
65
|
return view;
|
66
66
|
};
|
67
67
|
export const V1_resolveDiagram = (path, context) => context.createImplicitPackageableElementReference(path, (_path) => getDiagram(_path, context.graph));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"V1_DSLDiagram_GraphBuilderHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAK1F,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,iFAAiF,CAAC;AAC5G,OAAO,EAAE,KAAK,EAAE,MAAM,sFAAsF,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,0FAA0F,CAAC;AACrH,OAAO,EAAE,YAAY,EAAE,MAAM,oFAAoF,CAAC;AAClH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0FAA0F,CAAC;AAM9H,OAAO,
|
1
|
+
{"version":3,"file":"V1_DSLDiagram_GraphBuilderHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAK1F,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC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 +37,7 @@ const createPoint = (x, y) => {
|
|
37
37
|
const transformPropertyView = (element) => {
|
38
38
|
const view = new V1_PropertyView();
|
39
39
|
const line = new V1_Line();
|
40
|
-
line.points = element.
|
40
|
+
line.points = element.pathForSerialization;
|
41
41
|
view.line = line;
|
42
42
|
view.property = V1_transformPropertyReference(element.property);
|
43
43
|
view.sourceView = relationshipEdgeViewTransformer(element.from);
|
@@ -47,7 +47,7 @@ const transformPropertyView = (element) => {
|
|
47
47
|
const transformGenerationView = (element) => {
|
48
48
|
const view = new V1_GeneralizationView();
|
49
49
|
const line = new V1_Line();
|
50
|
-
line.points = element.
|
50
|
+
line.points = element.pathForSerialization;
|
51
51
|
view.line = line;
|
52
52
|
view.sourceView = relationshipEdgeViewTransformer(element.from);
|
53
53
|
view.targetView = relationshipEdgeViewTransformer(element.to);
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"V1_DSLDiagram_TransformerHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAE,QAAQ,EAAE,MAAM,sEAAsE,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,+DAA+D,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,qEAAqE,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,0EAA0E,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,oEAAoE,CAAC;AACrG,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,+BAA+B,GAAG,CAAC,KAA2B,EAAU,EAAE,CAC9E,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;AAE3B,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,KAAa,EAAgB,EAAE;IACtE,MAAM,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;IACrC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;IAC1B,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACxB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,CAAS,EAAY,EAAE;IACrD,MAAM,KAAK,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC7B,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IACZ,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IACZ,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,OAAqB,EAAmB,EAAE;IACvE,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,
|
1
|
+
{"version":3,"file":"V1_DSLDiagram_TransformerHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAE,QAAQ,EAAE,MAAM,sEAAsE,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,+DAA+D,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,qEAAqE,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,0EAA0E,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,UAAU,EAAE,CAAC;IACjC,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChE,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAC3D,uBAAuB,CACxB,CAAC;IACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACzE,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
package/lib/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-extension-dsl-diagram",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.30",
|
4
4
|
"description": "Legend extension for Diagram DSL",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"clean:cache": "rimraf \"build\"",
|
32
32
|
"clean:lib": "rimraf \"lib\"",
|
33
33
|
"dev": "npm-run-all --parallel dev:sass dev:ts",
|
34
|
-
"dev:sass": "sass style
|
34
|
+
"dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
|
35
35
|
"dev:ts": "tsc --watch --preserveWatchOutput",
|
36
36
|
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
|
37
37
|
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"mobx": "6.5.0",
|
51
51
|
"mobx-react-lite": "3.3.0",
|
52
52
|
"react": "17.0.2",
|
53
|
-
"react-dnd": "15.1.
|
53
|
+
"react-dnd": "15.1.2",
|
54
54
|
"react-dom": "17.0.2",
|
55
55
|
"react-resize-detector": "7.0.0",
|
56
56
|
"serializr": "2.0.5"
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"jest-canvas-mock": "2.3.1",
|
65
65
|
"npm-run-all": "4.1.5",
|
66
66
|
"rimraf": "3.0.2",
|
67
|
-
"sass": "1.
|
67
|
+
"sass": "1.50.0",
|
68
68
|
"typescript": "4.6.3"
|
69
69
|
},
|
70
70
|
"peerDependencies": {
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import type { AssociationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView';
|
17
|
+
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
18
|
+
import type { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
19
|
+
import type { GeneralizationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
20
|
+
import type { PropertyView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
21
|
+
import type { RelationshipEdgeView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView';
|
22
|
+
import type { RelationshipView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
|
23
|
+
import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
24
|
+
import type { PositionedRectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle';
|
25
|
+
import type { Rectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
|
26
|
+
export declare const diagram_setClassViews: (diagram: Diagram, val: ClassView[]) => void;
|
27
|
+
export declare const diagram_addClassView: (diagram: Diagram, val: ClassView) => void;
|
28
|
+
export declare const diagram_deleteClassView: (diagram: Diagram, val: ClassView) => void;
|
29
|
+
export declare const diagram_setAssociationViews: (diagram: Diagram, val: AssociationView[]) => void;
|
30
|
+
export declare const diagram_deleteAssociationView: (diagram: Diagram, val: AssociationView) => void;
|
31
|
+
export declare const diagram_setGeneralizationViews: (diagram: Diagram, val: GeneralizationView[]) => void;
|
32
|
+
export declare const diagram_addGeneralizationView: (diagram: Diagram, val: GeneralizationView) => void;
|
33
|
+
export declare const diagram_deleteGeneralizationView: (diagram: Diagram, val: GeneralizationView) => void;
|
34
|
+
export declare const diagram_setPropertyViews: (diagram: Diagram, val: PropertyView[]) => void;
|
35
|
+
export declare const diagram_addPropertyView: (diagram: Diagram, val: PropertyView) => void;
|
36
|
+
export declare const diagram_deletePropertyView: (diagram: Diagram, val: PropertyView) => void;
|
37
|
+
export declare const classView_setHideProperties: (cv: ClassView, val: boolean) => void;
|
38
|
+
export declare const classView_setHideStereotypes: (cv: ClassView, val: boolean) => void;
|
39
|
+
export declare const classView_setHideTaggedValues: (cv: ClassView, val: boolean) => void;
|
40
|
+
export declare const relationshipEdgeView_setOffsetX: (r: RelationshipEdgeView, val: number) => void;
|
41
|
+
export declare const relationshipEdgeView_setOffsetY: (r: RelationshipEdgeView, val: number) => void;
|
42
|
+
export declare const relationshipView_changePoint: (v: RelationshipView, val: Point, newVal: Point) => void;
|
43
|
+
export declare const relationshipView_simplifyPath: (relationshipView: RelationshipView) => void;
|
44
|
+
export declare const findOrBuildPoint: (relationshipView: RelationshipView, x: number, y: number, zoom: number, allowChange: boolean) => Point | undefined;
|
45
|
+
export declare const relationshipView_setPath: (relationshipView: RelationshipView, val: Point[]) => void;
|
46
|
+
export declare const positionedRectangle_setRectangle: (pR: PositionedRectangle, value: Rectangle) => void;
|
47
|
+
export declare const positionedRectangle_setPosition: (pR: PositionedRectangle, value: Point) => void;
|
48
|
+
/**
|
49
|
+
* NOTE: Having `position` and `rectangle` as observables compromises the performance of diagram
|
50
|
+
* so we want to have a way to refresh the hash for change detection to pick up new hash when we resize
|
51
|
+
* the class view box or move it.
|
52
|
+
*
|
53
|
+
* We should re-consider the usefulness of this method, maybe it's more worthwhile to recompute hash
|
54
|
+
* for the whole diagram instead?
|
55
|
+
*/
|
56
|
+
export declare const positionedRectangle_forceRefreshHash: (pR: PositionedRectangle) => void;
|
57
|
+
//# sourceMappingURL=DSLDiagram_GraphModifierHelper.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DSLDiagram_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DSLDiagram_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+EAA+E,CAAC;AAC/G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6EAA6E,CAAC;AAC3G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wFAAwF,CAAC;AAMjI,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kFAAkF,CAAC;AACrH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0FAA0F,CAAC;AACrI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sFAAsF,CAAC;AAC7H,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oFAAoF,CAAC;AAChH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kGAAkG,CAAC;AAC5I,OAAO,KAAK,EAAE,SAAS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