@finos/legend-extension-dsl-diagram 2.0.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/DSLDiagram_Extension.d.ts +0 -2
- package/lib/DSLDiagram_Extension.d.ts.map +1 -1
- package/lib/DSLDiagram_Extension.js +8 -9
- package/lib/DSLDiagram_Extension.js.map +1 -1
- package/lib/DiagramRenderer.d.ts +8 -8
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +26 -30
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.js +2 -2
- package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioDocumentation.d.ts +4 -14
- package/lib/components/studio/DSLDiagram_LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioDocumentation.js +8 -6
- package/lib/components/studio/DSLDiagram_LegendStudioDocumentation.js.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js +10 -10
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.d.ts +3 -3
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.d.ts.map +1 -1
- package/lib/components/studio/DSLDiagram_TestID.js +1 -1
- package/lib/components/studio/DSLDiagram_TestID.js.map +1 -1
- package/lib/components/studio/DiagramEditor.js +5 -5
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.d.ts +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.d.ts.map +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.js +3 -3
- package/lib/components/studio/InheritanceDiagramRenderer.js.map +1 -1
- package/lib/graph/DSLDiagram_PureGraphPlugin.js +2 -2
- package/lib/graph/DSLDiagram_PureGraphPlugin.js.map +1 -1
- package/lib/graphManager/DSLDiagram_GraphManagerHelper.d.ts +1 -1
- package/lib/graphManager/DSLDiagram_GraphManagerHelper.d.ts.map +1 -1
- package/lib/graphManager/DSLDiagram_GraphManagerHelper.js +1 -1
- package/lib/graphManager/DSLDiagram_GraphManagerHelper.js.map +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +2 -2
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts +9 -9
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js +1 -1
- package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js.map +1 -1
- package/lib/helpers/{DiagramHelper.d.ts → DSLDiagram_Helper.d.ts} +28 -6
- package/lib/helpers/DSLDiagram_Helper.d.ts.map +1 -0
- package/lib/helpers/{DiagramHelper.js → DSLDiagram_Helper.js} +56 -9
- package/lib/helpers/{DiagramHelper.js.map → DSLDiagram_Helper.js.map} +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +18 -18
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -18
- package/lib/index.js.map +1 -1
- package/lib/models/DSLDiagram_ModelUtils.js +1 -1
- package/lib/models/DSLDiagram_ModelUtils.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.d.ts +3 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js +4 -4
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.d.ts +4 -4
- 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 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.d.ts +3 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.js +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts +4 -4
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js +3 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts +4 -4
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js +16 -8
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.d.ts +0 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js +1 -7
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.d.ts +3 -9
- 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 +11 -22
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js.map +1 -1
- package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js +6 -6
- package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.js +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.d.ts +3 -3
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.d.ts +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.js +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyHolderView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyHolderView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyHolderView.js +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyHolderView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.js +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_RelationshipView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_RelationshipView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_RelationshipView.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_RelationshipView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Line.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Line.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_PositionedRectangle.d.ts +2 -2
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_PositionedRectangle.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_PositionedRectangle.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_PositionedRectangle.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.d.ts +7 -7
- 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 +7 -7
- 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.d.ts +2 -2
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js +7 -7
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.d.ts +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.js +7 -7
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.js.map +1 -1
- package/lib/package.json +10 -9
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts +10 -10
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js +8 -8
- package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js.map +1 -1
- package/lib/stores/studio/DiagramEditorState.d.ts +4 -4
- package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
- package/lib/stores/studio/DiagramEditorState.js +3 -3
- package/lib/stores/studio/DiagramEditorState.js.map +1 -1
- package/package.json +17 -16
- package/src/DSLDiagram_Extension.ts +8 -11
- package/src/DiagramRenderer.ts +39 -36
- package/src/components/studio/ClassDiagramPreview.tsx +2 -2
- package/src/components/studio/DSLDiagram_LegendStudioDocumentation.ts +13 -6
- package/src/components/studio/DSLDiagram_LegendStudioPlugin.tsx +14 -13
- package/src/components/studio/DSLDiagram_LegendStudioPlugin_Extension.tsx +2 -2
- package/src/components/studio/DiagramEditor.tsx +6 -6
- package/src/components/studio/InheritanceDiagramRenderer.ts +3 -3
- package/src/graph/DSLDiagram_PureGraphPlugin.ts +2 -2
- package/src/graphManager/DSLDiagram_GraphManagerHelper.ts +1 -1
- package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +2 -2
- package/src/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.ts +10 -10
- package/src/helpers/{DiagramHelper.ts → DSLDiagram_Helper.ts} +102 -11
- package/src/index.ts +21 -18
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.ts +4 -4
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.ts +5 -5
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.ts +2 -2
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.ts +5 -5
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.ts +2 -2
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.ts +4 -4
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.ts +2 -2
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.ts +5 -4
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts +18 -10
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.ts +1 -9
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts +12 -42
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.ts +1 -1
- package/src/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.ts +6 -6
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.ts +2 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.ts +4 -4
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.ts +3 -3
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyHolderView.ts +2 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.ts +2 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_RelationshipView.ts +2 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Line.ts +1 -1
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.ts +1 -1
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_PositionedRectangle.ts +3 -3
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.ts +1 -1
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts +13 -13
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts +12 -12
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.ts +7 -7
- package/src/stores/studio/DSLDiagram_GraphModifierHelper.ts +20 -18
- package/src/stores/studio/DiagramEditorState.ts +5 -5
- package/tsconfig.json +4 -10
- package/tsconfig.package.json +1 -4
- package/lib/helpers/DiagramHelper.d.ts.map +0 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts +0 -26
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts.map +0 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js +0 -37
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js.map +0 -1
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts +0 -44
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts
CHANGED
@@ -15,12 +15,12 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { RelationshipEdgeView } from './DSLDiagram_RelationshipEdgeView';
|
19
|
-
import { Point } from './geometry/DSLDiagram_Point';
|
20
|
-
import type { ClassView } from './DSLDiagram_ClassView';
|
21
|
-
import type { Diagram } from './DSLDiagram_Diagram';
|
22
|
-
import { ClassViewExplicitReference } from './DSLDiagram_ClassViewReference';
|
23
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { RelationshipEdgeView } from './DSLDiagram_RelationshipEdgeView.js';
|
19
|
+
import { Point } from './geometry/DSLDiagram_Point.js';
|
20
|
+
import type { ClassView } from './DSLDiagram_ClassView.js';
|
21
|
+
import type { Diagram } from './DSLDiagram_Diagram.js';
|
22
|
+
import { ClassViewExplicitReference } from './DSLDiagram_ClassViewReference.js';
|
23
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
24
24
|
|
25
25
|
export class RelationshipView implements Hashable {
|
26
26
|
readonly _OWNER: Diagram;
|
@@ -47,6 +47,8 @@ export class RelationshipView implements Hashable {
|
|
47
47
|
this.to = new RelationshipEdgeView(ClassViewExplicitReference.create(to));
|
48
48
|
}
|
49
49
|
|
50
|
+
// TODO: to be simplified out of metamodel
|
51
|
+
// we will move these when we move hashing out of metamodel
|
50
52
|
/**
|
51
53
|
* Calculate the end points of the edge using offset, otherwise, use the center
|
52
54
|
*/
|
@@ -56,18 +58,20 @@ export class RelationshipView implements Hashable {
|
|
56
58
|
): Point {
|
57
59
|
const box = edgeView.classView.value;
|
58
60
|
const center = edgeView.classView.value.center();
|
59
|
-
const newX = center.x + (edgeView.
|
60
|
-
const newY = center.y + (edgeView.
|
61
|
+
const newX = center.x + (edgeView._offsetX ?? 0);
|
62
|
+
const newY = center.y + (edgeView._offsetY ?? 0);
|
61
63
|
if (box.contains(newX, newY)) {
|
62
64
|
return new Point(newX, newY);
|
63
65
|
}
|
64
66
|
if (allowChange) {
|
65
|
-
edgeView.
|
66
|
-
edgeView.
|
67
|
+
edgeView._offsetX = 0;
|
68
|
+
edgeView._offsetY = 0;
|
67
69
|
}
|
68
70
|
return new Point(center.x, center.y);
|
69
71
|
}
|
70
72
|
|
73
|
+
// TODO: to be simplified out of metamodel
|
74
|
+
// we will move these when we move hashing out of metamodel
|
71
75
|
/**
|
72
76
|
* Compute the full path for the relationship view (including the ends even if these
|
73
77
|
* ends lie inside of the classviews)
|
@@ -83,6 +87,8 @@ export class RelationshipView implements Hashable {
|
|
83
87
|
];
|
84
88
|
}
|
85
89
|
|
90
|
+
// TODO: to be simplified out of metamodel
|
91
|
+
// we will move these when we move hashing out of metamodel
|
86
92
|
/**
|
87
93
|
* For a path, only keep **at most** 1 point at each end that lies inside the class view.
|
88
94
|
* If there is no inside points, none of kept, so the path only contains outside points.
|
@@ -122,6 +128,8 @@ export class RelationshipView implements Hashable {
|
|
122
128
|
return path.slice(start - 1, end + 2);
|
123
129
|
};
|
124
130
|
|
131
|
+
// TODO: to be simplified out of metamodel
|
132
|
+
// we will move these when we move hashing out of metamodel
|
125
133
|
/**
|
126
134
|
* This method will compute the full path from the offset within class view for serialization and persistence purpose
|
127
135
|
*/
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils.js';
|
19
19
|
|
20
20
|
export class Point implements Hashable {
|
21
21
|
readonly x: number;
|
@@ -26,14 +26,6 @@ export class Point implements Hashable {
|
|
26
26
|
this.y = y;
|
27
27
|
}
|
28
28
|
|
29
|
-
rotateX(angle: number): number {
|
30
|
-
return this.x * Math.cos(angle) - this.y * Math.sin(angle);
|
31
|
-
}
|
32
|
-
|
33
|
-
rotateY(angle: number): number {
|
34
|
-
return this.x * Math.sin(angle) + this.y * Math.cos(angle);
|
35
|
-
}
|
36
|
-
|
37
29
|
get hashCode(): string {
|
38
30
|
return hashArray([
|
39
31
|
DIAGRAM_HASH_STRUCTURE.POINT,
|
@@ -15,63 +15,31 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { Point } from './DSLDiagram_Point';
|
19
|
-
import { Rectangle } from './DSLDiagram_Rectangle';
|
20
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { Point } from './DSLDiagram_Point.js';
|
19
|
+
import { Rectangle } from './DSLDiagram_Rectangle.js';
|
20
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils.js';
|
21
21
|
|
22
22
|
export class PositionedRectangle implements Hashable {
|
23
|
+
_dummyObservable = {};
|
24
|
+
|
23
25
|
position: Point;
|
24
26
|
rectangle: Rectangle;
|
25
|
-
dummyObservable = {};
|
26
27
|
|
27
28
|
constructor(position: Point, rectangle: Rectangle) {
|
28
29
|
this.position = position;
|
29
30
|
this.rectangle = rectangle;
|
30
31
|
}
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
this.position.x + this.rectangle.width,
|
35
|
-
this.position.y + this.rectangle.height,
|
36
|
-
);
|
33
|
+
// TODO: to be simplified out of metamodel
|
34
|
+
// to be moved out when we move hashing out
|
37
35
|
center = (): Point =>
|
38
36
|
new Point(
|
39
37
|
this.position.x + this.rectangle.width / 2,
|
40
38
|
this.position.y + this.rectangle.height / 2,
|
41
39
|
);
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
*/
|
46
|
-
buildBottomRightCornerBox(): PositionedRectangle {
|
47
|
-
const cornerX = this.position.x + this.rectangle.width;
|
48
|
-
const cornerY = this.position.y + this.rectangle.height;
|
49
|
-
const boxSize = 10;
|
50
|
-
return new PositionedRectangle(
|
51
|
-
new Point(cornerX - boxSize / 2, cornerY - boxSize / 2),
|
52
|
-
new Rectangle(boxSize, boxSize),
|
53
|
-
);
|
54
|
-
}
|
55
|
-
|
56
|
-
boxContains(otherBox: PositionedRectangle): boolean {
|
57
|
-
otherBox = this.normalizeBox(otherBox);
|
58
|
-
return (
|
59
|
-
this.contains(otherBox.position.x, otherBox.position.y) ||
|
60
|
-
this.contains(
|
61
|
-
otherBox.position.x + otherBox.rectangle.width,
|
62
|
-
otherBox.position.y,
|
63
|
-
) ||
|
64
|
-
this.contains(
|
65
|
-
otherBox.position.x,
|
66
|
-
otherBox.position.y + otherBox.rectangle.height,
|
67
|
-
) ||
|
68
|
-
this.contains(
|
69
|
-
otherBox.position.x + otherBox.rectangle.width,
|
70
|
-
otherBox.position.y + otherBox.rectangle.height,
|
71
|
-
)
|
72
|
-
);
|
73
|
-
}
|
74
|
-
|
41
|
+
// TODO: to be simplified out of metamodel
|
42
|
+
// to be moved out when we move hashing out
|
75
43
|
contains(x: number, y: number): boolean {
|
76
44
|
const box = this.normalizeBox(this);
|
77
45
|
return (
|
@@ -82,6 +50,8 @@ export class PositionedRectangle implements Hashable {
|
|
82
50
|
);
|
83
51
|
}
|
84
52
|
|
53
|
+
// TODO: to be simplified out of metamodel
|
54
|
+
// to be moved out when we move hashing out
|
85
55
|
normalizeBox(box: PositionedRectangle): PositionedRectangle {
|
86
56
|
let newBox = box;
|
87
57
|
if (box.rectangle.width < 0) {
|
@@ -100,7 +70,7 @@ export class PositionedRectangle implements Hashable {
|
|
100
70
|
}
|
101
71
|
|
102
72
|
get hashCode(): string {
|
103
|
-
this.
|
73
|
+
this._dummyObservable; // manually trigger class-view hash code recomputation
|
104
74
|
return hashArray([
|
105
75
|
DIAGRAM_HASH_STRUCTURE.POSITIONED_RECTANGLE,
|
106
76
|
this.position,
|
package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.ts
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils.js';
|
19
19
|
|
20
20
|
export class Rectangle implements Hashable {
|
21
21
|
readonly width: number;
|
@@ -15,13 +15,13 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import packageJson from '../../../../package.json';
|
18
|
-
import { V1_Diagram } from './v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram';
|
18
|
+
import { V1_Diagram } from './v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.js';
|
19
19
|
import { type PlainObject, assertType } from '@finos/legend-shared';
|
20
20
|
import { deserialize, serialize } from 'serializr';
|
21
21
|
import {
|
22
22
|
V1_diagramModelSchema,
|
23
23
|
V1_DIAGRAM_ELEMENT_PROTOCOL_TYPE,
|
24
|
-
} from './v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper';
|
24
|
+
} from './v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.js';
|
25
25
|
import {
|
26
26
|
type PackageableElement,
|
27
27
|
type V1_ElementProtocolClassifierPathGetter,
|
@@ -35,14 +35,14 @@ import {
|
|
35
35
|
V1_ElementBuilder,
|
36
36
|
V1_buildFullPath,
|
37
37
|
} from '@finos/legend-graph';
|
38
|
-
import { V1_transformDiagram } from './v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper';
|
39
|
-
import { Diagram } from '../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
40
|
-
import { getOwnDiagram } from '../../../graphManager/DSLDiagram_GraphManagerHelper';
|
38
|
+
import { V1_transformDiagram } from './v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js';
|
39
|
+
import { Diagram } from '../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
40
|
+
import { getOwnDiagram } from '../../../graphManager/DSLDiagram_GraphManagerHelper.js';
|
41
41
|
import {
|
42
42
|
V1_buildClassView,
|
43
43
|
V1_buildGeneralizationView,
|
44
44
|
V1_buildPropertyView,
|
45
|
-
} from './v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper';
|
45
|
+
} from './v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js';
|
46
46
|
|
47
47
|
const DIAGRAM_ELEMENT_CLASSIFIER_PATH =
|
48
48
|
'meta::pure::metamodel::diagram::Diagram';
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.ts
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { V1_PositionedRectangle } from './geometry/V1_DSLDiagram_PositionedRectangle';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { V1_PositionedRectangle } from './geometry/V1_DSLDiagram_PositionedRectangle.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
|
21
21
|
export class V1_ClassView extends V1_PositionedRectangle implements Hashable {
|
22
22
|
id!: string;
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.ts
CHANGED
@@ -15,14 +15,14 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import type { V1_ClassView } from './V1_DSLDiagram_ClassView';
|
19
|
-
import type { V1_PropertyView } from './V1_DSLDiagram_PropertyView';
|
20
|
-
import type { V1_GeneralizationView } from './V1_DSLDiagram_GeneralizationView';
|
18
|
+
import type { V1_ClassView } from './V1_DSLDiagram_ClassView.js';
|
19
|
+
import type { V1_PropertyView } from './V1_DSLDiagram_PropertyView.js';
|
20
|
+
import type { V1_GeneralizationView } from './V1_DSLDiagram_GeneralizationView.js';
|
21
21
|
import {
|
22
22
|
type V1_PackageableElementVisitor,
|
23
23
|
V1_PackageableElement,
|
24
24
|
} from '@finos/legend-graph';
|
25
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
25
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
26
26
|
|
27
27
|
export class V1_Diagram extends V1_PackageableElement implements Hashable {
|
28
28
|
classViews: V1_ClassView[] = [];
|
@@ -15,9 +15,9 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { V1_RelationshipView } from './V1_DSLDiagram_RelationshipView';
|
19
|
-
import type { V1_Line } from './geometry/V1_DSLDiagram_Line';
|
20
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { V1_RelationshipView } from './V1_DSLDiagram_RelationshipView.js';
|
19
|
+
import type { V1_Line } from './geometry/V1_DSLDiagram_Line.js';
|
20
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
21
21
|
|
22
22
|
export class V1_GeneralizationView
|
23
23
|
extends V1_RelationshipView
|
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { V1_RelationshipView } from './V1_DSLDiagram_RelationshipView';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { V1_RelationshipView } from './V1_DSLDiagram_RelationshipView.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
import type { V1_PropertyPointer } from '@finos/legend-graph';
|
21
21
|
|
22
22
|
export class V1_PropertyHolderView
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_PropertyView.ts
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { V1_PropertyHolderView } from './V1_DSLDiagram_PropertyHolderView';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { V1_PropertyHolderView } from './V1_DSLDiagram_PropertyHolderView.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
import type { V1_PropertyPointer } from '@finos/legend-graph';
|
21
21
|
|
22
22
|
export class V1_PropertyView extends V1_PropertyHolderView implements Hashable {
|
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import type { V1_Line } from './geometry/V1_DSLDiagram_Line';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import type { V1_Line } from './geometry/V1_DSLDiagram_Line.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
|
21
21
|
export class V1_RelationshipView implements Hashable {
|
22
22
|
sourceView!: string;
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils.js';
|
19
19
|
|
20
20
|
export class V1_Point implements Hashable {
|
21
21
|
x!: number;
|
@@ -15,9 +15,9 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import type { V1_Point } from './V1_DSLDiagram_Point';
|
19
|
-
import type { V1_Rectangle } from './V1_DSLDiagram_Rectangle';
|
20
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import type { V1_Point } from './V1_DSLDiagram_Point.js';
|
19
|
+
import type { V1_Rectangle } from './V1_DSLDiagram_Rectangle.js';
|
20
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils.js';
|
21
21
|
|
22
22
|
export class V1_PositionedRectangle implements Hashable {
|
23
23
|
rectangle!: V1_Rectangle;
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils.js';
|
19
19
|
|
20
20
|
export class V1_Rectangle implements Hashable {
|
21
21
|
width!: number;
|
package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { getDiagram } from '../../../../../../graphManager/DSLDiagram_GraphManagerHelper';
|
17
|
+
import { getDiagram } from '../../../../../../graphManager/DSLDiagram_GraphManagerHelper.js';
|
18
18
|
import type {
|
19
19
|
PackageableElementImplicitReference,
|
20
20
|
V1_GraphBuilderContext,
|
@@ -24,21 +24,21 @@ import {
|
|
24
24
|
assertNonNullable,
|
25
25
|
guaranteeNonNullable,
|
26
26
|
} from '@finos/legend-shared';
|
27
|
-
import type { Diagram } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
28
|
-
import { ClassView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
29
|
-
import { Point } from '../../../../../metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
30
|
-
import { Rectangle } from '../../../../../metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
|
31
|
-
import { PropertyView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
32
|
-
import { GeneralizationView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
33
|
-
import type { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView';
|
34
|
-
import type { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point';
|
35
|
-
import type { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle';
|
36
|
-
import type { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView';
|
37
|
-
import type { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView';
|
27
|
+
import type { Diagram } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
28
|
+
import { ClassView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
29
|
+
import { Point } from '../../../../../metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js';
|
30
|
+
import { Rectangle } from '../../../../../metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js';
|
31
|
+
import { PropertyView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js';
|
32
|
+
import { GeneralizationView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js';
|
33
|
+
import type { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView.js';
|
34
|
+
import type { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.js';
|
35
|
+
import type { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.js';
|
36
|
+
import type { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView.js';
|
37
|
+
import type { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.js';
|
38
38
|
import {
|
39
39
|
getClassView,
|
40
40
|
_relationshipView_simplifyPath,
|
41
|
-
} from '../../../../../../helpers/
|
41
|
+
} from '../../../../../../helpers/DSLDiagram_Helper.js';
|
42
42
|
|
43
43
|
const buildPoint = (point: V1_Point): Point => {
|
44
44
|
const x = guaranteeNonNullable(point.x, `Point 'x' coordinate is missing`);
|
package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts
CHANGED
@@ -14,18 +14,18 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import type { ClassView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
18
|
-
import type { Diagram } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
19
|
-
import type { GeneralizationView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
20
|
-
import type { PropertyView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
21
|
-
import type { RelationshipEdgeView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView';
|
22
|
-
import { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point';
|
23
|
-
import { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView';
|
24
|
-
import { V1_Diagram } from '../../model/packageableElements/diagram/V1_DSLDiagram_Diagram';
|
25
|
-
import { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView';
|
26
|
-
import { V1_Line } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Line';
|
27
|
-
import { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle';
|
28
|
-
import { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView';
|
17
|
+
import type { ClassView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
18
|
+
import type { Diagram } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
19
|
+
import type { GeneralizationView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js';
|
20
|
+
import type { PropertyView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js';
|
21
|
+
import type { RelationshipEdgeView } from '../../../../../metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js';
|
22
|
+
import { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.js';
|
23
|
+
import { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView.js';
|
24
|
+
import { V1_Diagram } from '../../model/packageableElements/diagram/V1_DSLDiagram_Diagram.js';
|
25
|
+
import { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.js';
|
26
|
+
import { V1_Line } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Line.js';
|
27
|
+
import { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.js';
|
28
|
+
import { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView.js';
|
29
29
|
import {
|
30
30
|
V1_initPackageableElement,
|
31
31
|
V1_transformElementReference,
|
package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper.ts
CHANGED
@@ -19,13 +19,13 @@ import {
|
|
19
19
|
usingConstantValueSchema,
|
20
20
|
usingModelSchema,
|
21
21
|
} from '@finos/legend-shared';
|
22
|
-
import { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView';
|
23
|
-
import { V1_Diagram } from '../../model/packageableElements/diagram/V1_DSLDiagram_Diagram';
|
24
|
-
import { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point';
|
25
|
-
import { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle';
|
26
|
-
import { V1_Line } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Line';
|
27
|
-
import { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView';
|
28
|
-
import { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView';
|
22
|
+
import { V1_ClassView } from '../../model/packageableElements/diagram/V1_DSLDiagram_ClassView.js';
|
23
|
+
import { V1_Diagram } from '../../model/packageableElements/diagram/V1_DSLDiagram_Diagram.js';
|
24
|
+
import { V1_Point } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Point.js';
|
25
|
+
import { V1_Rectangle } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Rectangle.js';
|
26
|
+
import { V1_Line } from '../../model/packageableElements/diagram/geometry/V1_DSLDiagram_Line.js';
|
27
|
+
import { V1_PropertyView } from '../../model/packageableElements/diagram/V1_DSLDiagram_PropertyView.js';
|
28
|
+
import { V1_GeneralizationView } from '../../model/packageableElements/diagram/V1_DSLDiagram_GeneralizationView.js';
|
29
29
|
import { V1_propertyPointerModelSchema } from '@finos/legend-graph';
|
30
30
|
|
31
31
|
export const V1_DIAGRAM_ELEMENT_PROTOCOL_TYPE = 'diagram';
|
@@ -16,27 +16,27 @@
|
|
16
16
|
|
17
17
|
import { addUniqueEntry, changeEntry, deleteEntry } from '@finos/legend-shared';
|
18
18
|
import { action } from 'mobx';
|
19
|
-
import type { AssociationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView';
|
20
|
-
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
21
|
-
import type { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
22
|
-
import type { GeneralizationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
19
|
+
import type { AssociationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js';
|
20
|
+
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
21
|
+
import type { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
22
|
+
import type { GeneralizationView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js';
|
23
23
|
import {
|
24
24
|
_findOrBuildPoint,
|
25
25
|
_relationshipView_simplifyPath,
|
26
26
|
_relationshipView_setPath,
|
27
|
-
} from '../../helpers/
|
28
|
-
import type { PropertyView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
29
|
-
import type { RelationshipEdgeView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView';
|
30
|
-
import type { RelationshipView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
|
31
|
-
import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
32
|
-
import type { PositionedRectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle';
|
33
|
-
import type { Rectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
|
27
|
+
} from '../../helpers/DSLDiagram_Helper.js';
|
28
|
+
import type { PropertyView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js';
|
29
|
+
import type { RelationshipEdgeView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js';
|
30
|
+
import type { RelationshipView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js';
|
31
|
+
import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js';
|
32
|
+
import type { PositionedRectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js';
|
33
|
+
import type { Rectangle } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js';
|
34
34
|
import {
|
35
35
|
observe_AssociationView,
|
36
36
|
observe_ClassView,
|
37
37
|
observe_GeneralizationView,
|
38
38
|
observe_PropertyView,
|
39
|
-
} from '../../graphManager/action/changeDetection/DSLDiagram_ObserverHelper';
|
39
|
+
} from '../../graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js';
|
40
40
|
|
41
41
|
export const diagram_setClassViews = action(
|
42
42
|
(diagram: Diagram, val: ClassView[]): void => {
|
@@ -114,21 +114,22 @@ export const classView_setHideTaggedValues = action(
|
|
114
114
|
);
|
115
115
|
export const relationshipEdgeView_setOffsetX = action(
|
116
116
|
(r: RelationshipEdgeView, val: number): void => {
|
117
|
-
r.
|
117
|
+
r._offsetX = val;
|
118
118
|
},
|
119
119
|
);
|
120
120
|
export const relationshipEdgeView_setOffsetY = action(
|
121
121
|
(r: RelationshipEdgeView, val: number): void => {
|
122
|
-
r.
|
122
|
+
r._offsetY = val;
|
123
123
|
},
|
124
124
|
);
|
125
125
|
|
126
|
-
// To optimize performance we will not observe point (path)
|
126
|
+
// NOTE: To optimize performance, for now, we will not observe point (path)
|
127
127
|
export const relationshipView_changePoint = action(
|
128
128
|
(v: RelationshipView, val: Point, newVal: Point): void => {
|
129
129
|
changeEntry(v.path, val, newVal);
|
130
130
|
},
|
131
131
|
);
|
132
|
+
|
132
133
|
export const relationshipView_simplifyPath = action(
|
133
134
|
_relationshipView_simplifyPath,
|
134
135
|
);
|
@@ -136,19 +137,20 @@ export const relationshipView_simplifyPath = action(
|
|
136
137
|
export const findOrBuildPoint = action(_findOrBuildPoint);
|
137
138
|
export const relationshipView_setPath = action(_relationshipView_setPath);
|
138
139
|
|
139
|
-
// To optimize performance we will not observe rectangle
|
140
|
+
// NOTE: To optimize performance, for now, we will not observe rectangle
|
140
141
|
export const positionedRectangle_setRectangle = action(
|
141
142
|
(pR: PositionedRectangle, value: Rectangle): void => {
|
142
143
|
pR.rectangle = value;
|
143
144
|
},
|
144
145
|
);
|
145
146
|
|
146
|
-
// To optimize performance we will not observe point (path)
|
147
|
+
// NOTE: To optimize performance, for now, we will not observe point (path)
|
147
148
|
export const positionedRectangle_setPosition = action(
|
148
149
|
(pR: PositionedRectangle, value: Point): void => {
|
149
150
|
pR.position = value;
|
150
151
|
},
|
151
152
|
);
|
153
|
+
|
152
154
|
/**
|
153
155
|
* NOTE: Having `position` and `rectangle` as observables compromises the performance of diagram
|
154
156
|
* so we want to have a way to refresh the hash for change detection to pick up new hash when we resize
|
@@ -159,6 +161,6 @@ export const positionedRectangle_setPosition = action(
|
|
159
161
|
*/
|
160
162
|
export const positionedRectangle_forceRefreshHash = action(
|
161
163
|
(pR: PositionedRectangle): void => {
|
162
|
-
pR.
|
164
|
+
pR._dummyObservable = {};
|
163
165
|
},
|
164
166
|
);
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
import {
|
25
25
|
type DiagramRenderer,
|
26
26
|
DIAGRAM_INTERACTION_MODE,
|
27
|
-
} from '../../DiagramRenderer';
|
27
|
+
} from '../../DiagramRenderer.js';
|
28
28
|
import { HotkeyConfiguration, PanelDisplayState } from '@finos/legend-art';
|
29
29
|
import {
|
30
30
|
type PackageableElement,
|
@@ -43,10 +43,10 @@ import {
|
|
43
43
|
ElementEditorState,
|
44
44
|
class_addProperty,
|
45
45
|
} from '@finos/legend-studio';
|
46
|
-
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
47
|
-
import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
48
|
-
import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
49
|
-
import type { PropertyHolderView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView';
|
46
|
+
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
47
|
+
import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js';
|
48
|
+
import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
49
|
+
import type { PropertyHolderView } from '../../models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.js';
|
50
50
|
|
51
51
|
enum DIAGRAM_EDITOR_HOTKEY {
|
52
52
|
RECENTER = 'RECENTER',
|
package/tsconfig.json
CHANGED
@@ -12,14 +12,11 @@
|
|
12
12
|
"declarationMap": true,
|
13
13
|
"sourceMap": true,
|
14
14
|
"target": "esnext",
|
15
|
-
"module": "
|
15
|
+
"module": "nodenext",
|
16
16
|
"skipLibCheck": true,
|
17
|
-
"moduleResolution": "node",
|
18
17
|
"resolveJsonModule": true,
|
19
18
|
"isolatedModules": true,
|
20
19
|
"importsNotUsedAsValues": "error",
|
21
|
-
"esModuleInterop": true,
|
22
|
-
"allowSyntheticDefaultImports": true,
|
23
20
|
"strict": true,
|
24
21
|
"noImplicitOverride": true,
|
25
22
|
"noUncheckedIndexedAccess": true,
|
@@ -47,7 +44,7 @@
|
|
47
44
|
"./src/graphManager/DSLDiagram_GraphManagerHelper.ts",
|
48
45
|
"./src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts",
|
49
46
|
"./src/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.ts",
|
50
|
-
"./src/helpers/
|
47
|
+
"./src/helpers/DSLDiagram_Helper.ts",
|
51
48
|
"./src/models/DSLDiagram_ModelUtils.ts",
|
52
49
|
"./src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.ts",
|
53
50
|
"./src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.ts",
|
@@ -61,7 +58,6 @@
|
|
61
58
|
"./src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.ts",
|
62
59
|
"./src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts",
|
63
60
|
"./src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.ts",
|
64
|
-
"./src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts",
|
65
61
|
"./src/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.ts",
|
66
62
|
"./src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_ClassView.ts",
|
67
63
|
"./src/models/protocols/pure/v1/model/packageableElements/diagram/V1_DSLDiagram_Diagram.ts",
|
@@ -89,9 +85,7 @@
|
|
89
85
|
"src/**/*.json"
|
90
86
|
],
|
91
87
|
"exclude": [
|
92
|
-
"src/**/__tests__
|
93
|
-
"src/**/
|
94
|
-
"src/**/__mocks__/**/*.ts",
|
95
|
-
"src/**/__mocks__/**/*.tsx"
|
88
|
+
"src/**/__tests__/**/*.*",
|
89
|
+
"src/**/__mocks__/**/*.*"
|
96
90
|
]
|
97
91
|
}
|