@finos/legend-extension-dsl-diagram 2.0.1 → 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 +42 -44
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.d.ts +0 -1
- package/lib/components/studio/ClassDiagramPreview.d.ts.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.d.ts +0 -1
- package/lib/components/studio/DiagramEditor.d.ts.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 +3 -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 +6 -6
- 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_ClassViewReference.js +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.js.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 +5 -5
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js +18 -10
- 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 +8 -8
- 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 +15 -14
- 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 +5 -5
- package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
- package/lib/stores/studio/DiagramEditorState.js +6 -6
- package/lib/stores/studio/DiagramEditorState.js.map +1 -1
- package/package.json +22 -21
- package/src/DSLDiagram_Extension.ts +8 -11
- package/src/DiagramRenderer.ts +64 -53
- 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 +8 -7
- package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.ts +3 -3
- 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 +21 -12
- 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 +14 -14
- 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 +9 -9
- 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
@@ -14,13 +14,45 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { RelationshipView } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
|
18
|
-
import { Point } from '../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
19
|
-
import {
|
20
|
-
|
17
|
+
import { RelationshipView } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js';
|
18
|
+
import { Point } from '../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js';
|
19
|
+
import {
|
20
|
+
type PureModel,
|
21
|
+
Class,
|
22
|
+
getAllOwnClassProperties,
|
23
|
+
} from '@finos/legend-graph';
|
21
24
|
import { deleteEntry } from '@finos/legend-shared';
|
22
|
-
import type { ClassView } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
23
|
-
import type { Diagram } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
25
|
+
import type { ClassView } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
26
|
+
import type { Diagram } from '../models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
27
|
+
import { PositionedRectangle } from '../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js';
|
28
|
+
import { Rectangle } from '../models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js';
|
29
|
+
|
30
|
+
export class Vector {
|
31
|
+
readonly x: number;
|
32
|
+
readonly y: number;
|
33
|
+
|
34
|
+
constructor(x: number, y: number) {
|
35
|
+
this.x = x;
|
36
|
+
this.y = y;
|
37
|
+
}
|
38
|
+
|
39
|
+
static fromPoints(a: Point, b: Point): Vector {
|
40
|
+
return new Vector(b.x - a.x, b.y - a.y);
|
41
|
+
}
|
42
|
+
|
43
|
+
unit(): Vector {
|
44
|
+
const norm = Math.sqrt(this.x * this.x + this.y * this.y);
|
45
|
+
return new Vector(this.x / norm, this.y / norm);
|
46
|
+
}
|
47
|
+
|
48
|
+
normal(other: Vector): Vector {
|
49
|
+
return new Vector(other.y - this.y, -(other.x - this.x));
|
50
|
+
}
|
51
|
+
|
52
|
+
dotProduct(other: Vector): number {
|
53
|
+
return this.x * other.x + this.y * other.y;
|
54
|
+
}
|
55
|
+
}
|
24
56
|
|
25
57
|
/**
|
26
58
|
* Get absolute position of element on the screen by recursively walking up element tree
|
@@ -49,7 +81,11 @@ export const cleanUpDeadReferencesInDiagram = (
|
|
49
81
|
// Delete orphan property views
|
50
82
|
const propertyViewsToRemove = diagram.propertyViews.filter(
|
51
83
|
(propertyView) =>
|
52
|
-
!
|
84
|
+
!(
|
85
|
+
propertyView.property.ownerReference.value instanceof Class
|
86
|
+
? getAllOwnClassProperties(propertyView.property.ownerReference.value)
|
87
|
+
: propertyView.property.ownerReference.value.properties
|
88
|
+
)
|
53
89
|
.map((property) => property.name)
|
54
90
|
.includes(propertyView.property.value.name),
|
55
91
|
);
|
@@ -110,15 +146,15 @@ export const _relationshipView_simplifyPath = (
|
|
110
146
|
// if it does we will update the offset
|
111
147
|
if (newPath[0] !== fullPath[0]) {
|
112
148
|
const center = relationshipView.from.classView.value.center();
|
113
|
-
relationshipView.from.
|
114
|
-
relationshipView.from.
|
149
|
+
relationshipView.from._offsetX = (newPath[0] as Point).x - center.x;
|
150
|
+
relationshipView.from._offsetY = (newPath[0] as Point).y - center.y;
|
115
151
|
}
|
116
152
|
|
117
153
|
if (newPath[newPath.length - 1] !== fullPath[fullPath.length - 1]) {
|
118
154
|
const center = relationshipView.to.classView.value.center();
|
119
|
-
relationshipView.to.
|
155
|
+
relationshipView.to._offsetX =
|
120
156
|
(newPath[newPath.length - 1] as Point).x - center.x;
|
121
|
-
relationshipView.to.
|
157
|
+
relationshipView.to._offsetY =
|
122
158
|
(newPath[newPath.length - 1] as Point).y - center.y;
|
123
159
|
}
|
124
160
|
|
@@ -199,3 +235,58 @@ export const _findOrBuildPoint = (
|
|
199
235
|
}
|
200
236
|
return point;
|
201
237
|
};
|
238
|
+
|
239
|
+
export const rotatePointX = (point: Point, angle: number): number =>
|
240
|
+
point.x * Math.cos(angle) - point.y * Math.sin(angle);
|
241
|
+
|
242
|
+
export const rotatePointY = (point: Point, angle: number): number =>
|
243
|
+
point.x * Math.sin(angle) + point.y * Math.cos(angle);
|
244
|
+
|
245
|
+
export const getBottomRightCornerPoint = (pR: PositionedRectangle): Point =>
|
246
|
+
new Point(
|
247
|
+
pR.position.x + pR.rectangle.width,
|
248
|
+
pR.position.y + pR.rectangle.height,
|
249
|
+
);
|
250
|
+
|
251
|
+
/**
|
252
|
+
* Build a small box at the bottom right corner of the rectangle so we
|
253
|
+
* can use that for selection to resize the box
|
254
|
+
*/
|
255
|
+
export const buildBottomRightCornerBox = (
|
256
|
+
pR: PositionedRectangle,
|
257
|
+
): PositionedRectangle => {
|
258
|
+
const bottomRightCornerPoint = getBottomRightCornerPoint(pR);
|
259
|
+
const boxSize = 10;
|
260
|
+
return new PositionedRectangle(
|
261
|
+
new Point(
|
262
|
+
bottomRightCornerPoint.x - boxSize / 2,
|
263
|
+
bottomRightCornerPoint.y - boxSize / 2,
|
264
|
+
),
|
265
|
+
new Rectangle(boxSize, boxSize),
|
266
|
+
);
|
267
|
+
};
|
268
|
+
|
269
|
+
/**
|
270
|
+
* Check if a box contains another box
|
271
|
+
*/
|
272
|
+
export const boxContains = (
|
273
|
+
box: PositionedRectangle,
|
274
|
+
otherBox: PositionedRectangle,
|
275
|
+
): boolean => {
|
276
|
+
otherBox = box.normalizeBox(otherBox);
|
277
|
+
return (
|
278
|
+
box.contains(otherBox.position.x, otherBox.position.y) ||
|
279
|
+
box.contains(
|
280
|
+
otherBox.position.x + otherBox.rectangle.width,
|
281
|
+
otherBox.position.y,
|
282
|
+
) ||
|
283
|
+
box.contains(
|
284
|
+
otherBox.position.x,
|
285
|
+
otherBox.position.y + otherBox.rectangle.height,
|
286
|
+
) ||
|
287
|
+
box.contains(
|
288
|
+
otherBox.position.x + otherBox.rectangle.width,
|
289
|
+
otherBox.position.y + otherBox.rectangle.height,
|
290
|
+
)
|
291
|
+
);
|
292
|
+
};
|
package/src/index.ts
CHANGED
@@ -14,25 +14,28 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
export * from './DSLDiagram_Extension';
|
18
|
-
export { DSLDiagram_LegendStudioPlugin } from './components/studio/DSLDiagram_LegendStudioPlugin';
|
19
|
-
export * from './components/studio/DSLDiagram_LegendStudioPlugin_Extension';
|
17
|
+
export * from './DSLDiagram_Extension.js';
|
18
|
+
export { DSLDiagram_LegendStudioPlugin } from './components/studio/DSLDiagram_LegendStudioPlugin.js';
|
19
|
+
export * from './components/studio/DSLDiagram_LegendStudioPlugin_Extension.js';
|
20
20
|
|
21
|
-
export { DiagramEditorState } from './stores/studio/DiagramEditorState';
|
21
|
+
export { DiagramEditorState } from './stores/studio/DiagramEditorState.js';
|
22
22
|
|
23
|
-
export {
|
23
|
+
export {
|
24
|
+
DiagramRenderer,
|
25
|
+
DIAGRAM_INTERACTION_MODE,
|
26
|
+
} from './DiagramRenderer.js';
|
24
27
|
|
25
|
-
export { Diagram } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram';
|
26
|
-
export { ClassView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
|
27
|
-
export { RelationshipView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
|
28
|
-
export { PropertyHolderView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView';
|
29
|
-
export { PropertyView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
|
30
|
-
export { AssociationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView';
|
31
|
-
export { GeneralizationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
|
32
|
-
export { Point } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
|
33
|
-
export { Rectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
|
34
|
-
export { PositionedRectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle';
|
28
|
+
export { Diagram } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js';
|
29
|
+
export { ClassView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js';
|
30
|
+
export { RelationshipView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js';
|
31
|
+
export { PropertyHolderView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.js';
|
32
|
+
export { PropertyView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js';
|
33
|
+
export { AssociationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js';
|
34
|
+
export { GeneralizationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js';
|
35
|
+
export { Point } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point.js';
|
36
|
+
export { Rectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle.js';
|
37
|
+
export { PositionedRectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js';
|
35
38
|
|
36
|
-
export * from './helpers/
|
37
|
-
export * from './graphManager/DSLDiagram_GraphManagerHelper';
|
38
|
-
export { V1_DSLDiagram_PackageableElementPointerType } from './models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin';
|
39
|
+
export * from './helpers/DSLDiagram_Helper.js';
|
40
|
+
export * from './graphManager/DSLDiagram_GraphManagerHelper.js';
|
41
|
+
export { V1_DSLDiagram_PackageableElementPointerType } from './models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js';
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.ts
CHANGED
@@ -15,10 +15,10 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { PropertyHolderView } from './DSLDiagram_PropertyHolderView';
|
19
|
-
import type { ClassView } from './DSLDiagram_ClassView';
|
20
|
-
import type { Diagram } from './DSLDiagram_Diagram';
|
21
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { PropertyHolderView } from './DSLDiagram_PropertyHolderView.js';
|
19
|
+
import type { ClassView } from './DSLDiagram_ClassView.js';
|
20
|
+
import type { Diagram } from './DSLDiagram_Diagram.js';
|
21
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
22
22
|
import type {
|
23
23
|
Association,
|
24
24
|
PackageableElementReference,
|
@@ -15,15 +15,16 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { PositionedRectangle } from './geometry/DSLDiagram_PositionedRectangle';
|
19
|
-
import { Rectangle } from './geometry/DSLDiagram_Rectangle';
|
20
|
-
import { Point } from './geometry/DSLDiagram_Point';
|
21
|
-
import type { Diagram } from './DSLDiagram_Diagram';
|
22
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { PositionedRectangle } from './geometry/DSLDiagram_PositionedRectangle.js';
|
19
|
+
import { Rectangle } from './geometry/DSLDiagram_Rectangle.js';
|
20
|
+
import { Point } from './geometry/DSLDiagram_Point.js';
|
21
|
+
import type { Diagram } from './DSLDiagram_Diagram.js';
|
22
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
23
23
|
import type { Class, PackageableElementReference } from '@finos/legend-graph';
|
24
24
|
|
25
25
|
export class ClassView extends PositionedRectangle implements Hashable {
|
26
|
-
|
26
|
+
readonly _OWNER: Diagram;
|
27
|
+
|
27
28
|
class: PackageableElementReference<Class>;
|
28
29
|
id: string;
|
29
30
|
hideProperties?: boolean | undefined;
|
@@ -36,7 +37,7 @@ export class ClassView extends PositionedRectangle implements Hashable {
|
|
36
37
|
_class: PackageableElementReference<Class>,
|
37
38
|
) {
|
38
39
|
super(new Point(0, 0), new Rectangle(0, 0));
|
39
|
-
this.
|
40
|
+
this._OWNER = owner;
|
40
41
|
this.id = id;
|
41
42
|
this.class = _class;
|
42
43
|
}
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.ts
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import type { Diagram } from './DSLDiagram_Diagram';
|
18
|
-
import type { ClassView } from './DSLDiagram_ClassView';
|
17
|
+
import type { Diagram } from './DSLDiagram_Diagram.js';
|
18
|
+
import type { ClassView } from './DSLDiagram_ClassView.js';
|
19
19
|
import {
|
20
20
|
PackageableElementExplicitReference,
|
21
21
|
ReferenceWithOwner,
|
@@ -42,7 +42,7 @@ export class ClassViewExplicitReference extends ClassViewReference {
|
|
42
42
|
|
43
43
|
private constructor(value: ClassView) {
|
44
44
|
const ownerReference = PackageableElementExplicitReference.create(
|
45
|
-
value.
|
45
|
+
value._OWNER,
|
46
46
|
);
|
47
47
|
super(ownerReference, value);
|
48
48
|
this.ownerReference = ownerReference;
|
@@ -15,15 +15,15 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import type { ClassView } from './DSLDiagram_ClassView';
|
19
|
-
import type { PropertyView } from './DSLDiagram_PropertyView';
|
20
|
-
import type { GeneralizationView } from './DSLDiagram_GeneralizationView';
|
21
|
-
import type { AssociationView } from './DSLDiagram_AssociationView';
|
18
|
+
import type { ClassView } from './DSLDiagram_ClassView.js';
|
19
|
+
import type { PropertyView } from './DSLDiagram_PropertyView.js';
|
20
|
+
import type { GeneralizationView } from './DSLDiagram_GeneralizationView.js';
|
21
|
+
import type { AssociationView } from './DSLDiagram_AssociationView.js';
|
22
22
|
import {
|
23
23
|
type PackageableElementVisitor,
|
24
24
|
PackageableElement,
|
25
25
|
} from '@finos/legend-graph';
|
26
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
26
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
27
27
|
|
28
28
|
export class Diagram extends PackageableElement implements Hashable {
|
29
29
|
classViews: ClassView[] = [];
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.ts
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { RelationshipView } from './DSLDiagram_RelationshipView';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { RelationshipView } from './DSLDiagram_RelationshipView.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
|
21
21
|
export class GeneralizationView extends RelationshipView implements Hashable {
|
22
22
|
override get hashCode(): string {
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView.ts
CHANGED
@@ -15,11 +15,11 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { RelationshipView } from './DSLDiagram_RelationshipView';
|
19
|
-
import type { ClassView } from './DSLDiagram_ClassView';
|
20
|
-
import type { Diagram } from './DSLDiagram_Diagram';
|
18
|
+
import { RelationshipView } from './DSLDiagram_RelationshipView.js';
|
19
|
+
import type { ClassView } from './DSLDiagram_ClassView.js';
|
20
|
+
import type { Diagram } from './DSLDiagram_Diagram.js';
|
21
21
|
import type { PropertyReference } from '@finos/legend-graph';
|
22
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
22
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
23
23
|
|
24
24
|
export class PropertyHolderView extends RelationshipView implements Hashable {
|
25
25
|
property: PropertyReference;
|
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
|
-
import { PropertyHolderView } from './DSLDiagram_PropertyHolderView';
|
19
|
-
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
|
18
|
+
import { PropertyHolderView } from './DSLDiagram_PropertyHolderView.js';
|
19
|
+
import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils.js';
|
20
20
|
|
21
21
|
export class PropertyView extends PropertyHolderView implements Hashable {
|
22
22
|
override get hashCode(): string {
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.ts
CHANGED
@@ -14,17 +14,18 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import type { ClassViewReference } from './DSLDiagram_ClassViewReference';
|
17
|
+
import type { ClassViewReference } from './DSLDiagram_ClassViewReference.js';
|
18
18
|
|
19
19
|
export class RelationshipEdgeView {
|
20
|
-
classView: ClassViewReference;
|
21
20
|
/**
|
22
21
|
* Offsets from the center of the class view.
|
23
22
|
*
|
24
23
|
* These offsets can be used to compute the end points of relationship views.
|
25
24
|
*/
|
26
|
-
|
27
|
-
|
25
|
+
_offsetX?: number | undefined;
|
26
|
+
_offsetY?: number | undefined;
|
27
|
+
|
28
|
+
classView: ClassViewReference;
|
28
29
|
|
29
30
|
constructor(classView: ClassViewReference) {
|
30
31
|
this.classView = classView;
|
package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts
CHANGED
@@ -15,15 +15,16 @@
|
|
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;
|
27
|
+
|
27
28
|
from: RelationshipEdgeView;
|
28
29
|
to: RelationshipEdgeView;
|
29
30
|
/**
|
@@ -39,13 +40,15 @@ export class RelationshipView implements Hashable {
|
|
39
40
|
path: Point[] = [];
|
40
41
|
|
41
42
|
constructor(owner: Diagram, from: ClassView, to: ClassView) {
|
42
|
-
this.
|
43
|
+
this._OWNER = owner;
|
43
44
|
this.from = new RelationshipEdgeView(
|
44
45
|
ClassViewExplicitReference.create(from),
|
45
46
|
);
|
46
47
|
this.to = new RelationshipEdgeView(ClassViewExplicitReference.create(to));
|
47
48
|
}
|
48
49
|
|
50
|
+
// TODO: to be simplified out of metamodel
|
51
|
+
// we will move these when we move hashing out of metamodel
|
49
52
|
/**
|
50
53
|
* Calculate the end points of the edge using offset, otherwise, use the center
|
51
54
|
*/
|
@@ -55,18 +58,20 @@ export class RelationshipView implements Hashable {
|
|
55
58
|
): Point {
|
56
59
|
const box = edgeView.classView.value;
|
57
60
|
const center = edgeView.classView.value.center();
|
58
|
-
const newX = center.x + (edgeView.
|
59
|
-
const newY = center.y + (edgeView.
|
61
|
+
const newX = center.x + (edgeView._offsetX ?? 0);
|
62
|
+
const newY = center.y + (edgeView._offsetY ?? 0);
|
60
63
|
if (box.contains(newX, newY)) {
|
61
64
|
return new Point(newX, newY);
|
62
65
|
}
|
63
66
|
if (allowChange) {
|
64
|
-
edgeView.
|
65
|
-
edgeView.
|
67
|
+
edgeView._offsetX = 0;
|
68
|
+
edgeView._offsetY = 0;
|
66
69
|
}
|
67
70
|
return new Point(center.x, center.y);
|
68
71
|
}
|
69
72
|
|
73
|
+
// TODO: to be simplified out of metamodel
|
74
|
+
// we will move these when we move hashing out of metamodel
|
70
75
|
/**
|
71
76
|
* Compute the full path for the relationship view (including the ends even if these
|
72
77
|
* ends lie inside of the classviews)
|
@@ -82,6 +87,8 @@ export class RelationshipView implements Hashable {
|
|
82
87
|
];
|
83
88
|
}
|
84
89
|
|
90
|
+
// TODO: to be simplified out of metamodel
|
91
|
+
// we will move these when we move hashing out of metamodel
|
85
92
|
/**
|
86
93
|
* For a path, only keep **at most** 1 point at each end that lies inside the class view.
|
87
94
|
* If there is no inside points, none of kept, so the path only contains outside points.
|
@@ -121,6 +128,8 @@ export class RelationshipView implements Hashable {
|
|
121
128
|
return path.slice(start - 1, end + 2);
|
122
129
|
};
|
123
130
|
|
131
|
+
// TODO: to be simplified out of metamodel
|
132
|
+
// we will move these when we move hashing out of metamodel
|
124
133
|
/**
|
125
134
|
* This method will compute the full path from the offset within class view for serialization and persistence purpose
|
126
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
|