@finos/legend-extension-dsl-diagram 0.1.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/lib/DSLDiagram_Extension.d.ts +0 -5
- package/lib/DSLDiagram_Extension.d.ts.map +1 -1
- package/lib/DSLDiagram_Extension.js +0 -12
- package/lib/DSLDiagram_Extension.js.map +1 -1
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +76 -50
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.js +1 -1
- package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
- package/lib/components/studio/{DSLDiagram_StudioPlugin.d.ts → DSLDiagram_LegendStudioPlugin.d.ts} +5 -5
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin.js → DSLDiagram_LegendStudioPlugin.js} +4 -4
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin_Extension.d.ts → DSLDiagram_LegendStudioPlugin_Extension.d.ts} +3 -3
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.d.ts.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin_Extension.js → DSLDiagram_LegendStudioPlugin_Extension.js} +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.js.map +1 -0
- package/lib/components/studio/DiagramEditor.js +36 -36
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js +3 -0
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js.map +1 -1
- 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 +15 -16
- package/src/DSLDiagram_Extension.ts +0 -15
- package/src/DiagramRenderer.ts +94 -73
- package/src/components/studio/{DSLDiagram_StudioPlugin.tsx → DSLDiagram_LegendStudioPlugin.tsx} +7 -7
- package/src/components/studio/{DSLDiagram_StudioPlugin_Extension.tsx → DSLDiagram_LegendStudioPlugin_Extension.tsx} +3 -3
- package/src/components/studio/DiagramEditor.tsx +2 -2
- package/src/index.ts +3 -1
- package/src/models/metamodels/pure/packageableElements/diagram/RelationshipView.ts +24 -14
- package/src/stores/studio/DiagramEditorState.ts +3 -7
- package/tsconfig.json +3 -2
- package/tsconfig.package.json +1 -0
- package/lib/components/studio/DSLDiagram_StudioPlugin.d.ts.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin.js.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin_Extension.d.ts.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin_Extension.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# @finos/legend-extension-dsl-diagram
|
2
2
|
|
3
|
+
## 1.0.2
|
4
|
+
|
5
|
+
## 1.0.1
|
6
|
+
|
7
|
+
## 1.0.0
|
8
|
+
|
9
|
+
### Major Changes
|
10
|
+
|
11
|
+
- [#692](https://github.com/finos/legend-studio/pull/692) [`caab0e67`](https://github.com/finos/legend-studio/commit/caab0e6772181e514b246fe6030a02e7169952cc) ([@akphi](https://github.com/akphi)) - **BREAKING CHANGE:** Remove `LegendStudioPreset` and `LegendQueryPreset` and expose `LegendStudioPlugin` and `LegendQueryPlugin` respectively as we now prefer the usage of `@finos/legend-graph-extension-collection` to better manage graph presets.
|
12
|
+
|
13
|
+
## 0.1.2
|
14
|
+
|
15
|
+
## 0.1.1
|
16
|
+
|
3
17
|
## 0.1.0
|
4
18
|
|
5
19
|
### Minor Changes
|
@@ -15,13 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
import { AbstractPreset } from '@finos/legend-shared';
|
17
17
|
import type { GraphPluginManager } from '@finos/legend-graph';
|
18
|
-
import type { StudioPluginManager } from '@finos/legend-studio';
|
19
18
|
export declare class DSLDiagram_GraphPreset extends AbstractPreset {
|
20
19
|
constructor();
|
21
20
|
install(pluginManager: GraphPluginManager): void;
|
22
21
|
}
|
23
|
-
export declare class DSLDiagram_StudioPreset extends AbstractPreset {
|
24
|
-
constructor();
|
25
|
-
install(pluginManager: StudioPluginManager): void;
|
26
|
-
}
|
27
22
|
//# sourceMappingURL=DSLDiagram_Extension.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_Extension.d.ts","sourceRoot":"","sources":["../src/DSLDiagram_Extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"DSLDiagram_Extension.d.ts","sourceRoot":"","sources":["../src/DSLDiagram_Extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,qBAAa,sBAAuB,SAAQ,cAAc;;IAKxD,OAAO,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI;CAKjD"}
|
@@ -17,7 +17,6 @@ import packageJson from '../package.json';
|
|
17
17
|
import { AbstractPreset } from '@finos/legend-shared';
|
18
18
|
import { DSLDiagram_PureGraphManagerPlugin } from './graphManager/DSLDiagram_PureGraphManagerPlugin';
|
19
19
|
import { DSLDiagram_PureProtocolProcessorPlugin } from './models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin';
|
20
|
-
import { DSLDiagram_StudioPlugin } from './components/studio/DSLDiagram_StudioPlugin';
|
21
20
|
import { DSLDiagram_PureGraphPlugin } from './graph/DSLDiagram_PureGraphPlugin';
|
22
21
|
export class DSLDiagram_GraphPreset extends AbstractPreset {
|
23
22
|
constructor() {
|
@@ -29,15 +28,4 @@ export class DSLDiagram_GraphPreset extends AbstractPreset {
|
|
29
28
|
new DSLDiagram_PureProtocolProcessorPlugin().install(pluginManager);
|
30
29
|
}
|
31
30
|
}
|
32
|
-
export class DSLDiagram_StudioPreset extends AbstractPreset {
|
33
|
-
constructor() {
|
34
|
-
super(packageJson.extensions.studioPreset, packageJson.version);
|
35
|
-
}
|
36
|
-
install(pluginManager) {
|
37
|
-
new DSLDiagram_StudioPlugin().install(pluginManager);
|
38
|
-
new DSLDiagram_PureGraphPlugin().install(pluginManager);
|
39
|
-
new DSLDiagram_PureGraphManagerPlugin().install(pluginManager);
|
40
|
-
new DSLDiagram_PureProtocolProcessorPlugin().install(pluginManager);
|
41
|
-
}
|
42
|
-
}
|
43
31
|
//# sourceMappingURL=DSLDiagram_Extension.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DSLDiagram_Extension.js","sourceRoot":"","sources":["../src/DSLDiagram_Extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,sCAAsC,EAAE,MAAM,gEAAgE,CAAC;
|
1
|
+
{"version":3,"file":"DSLDiagram_Extension.js","sourceRoot":"","sources":["../src/DSLDiagram_Extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cA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|
493
|
-
let
|
494
|
-
let
|
495
|
-
|
496
|
-
let maxY =
|
497
|
-
this.diagram.classViews[0].rectangle.height;
|
492
|
+
const firstClassView = guaranteeNonNullable(this.diagram.classViews[0]);
|
493
|
+
let minX = firstClassView.position.x;
|
494
|
+
let minY = firstClassView.position.y;
|
495
|
+
let maxX = firstClassView.position.x + firstClassView.rectangle.width;
|
496
|
+
let maxY = firstClassView.position.y + firstClassView.rectangle.height;
|
498
497
|
for (const classView of this.diagram.classViews) {
|
499
498
|
minX = Math.min(minX, classView.position.x);
|
500
499
|
minY = Math.min(minY, classView.position.y);
|
@@ -508,7 +507,10 @@ export class DiagramRenderer {
|
|
508
507
|
let fullPath = relationshipView.buildFullPath();
|
509
508
|
fullPath = manageInsidePointsDynamically(fullPath, relationshipView.from.classView.value, relationshipView.to.classView.value);
|
510
509
|
if (relationshipView instanceof PropertyView) {
|
511
|
-
const box = this.drawLinePropertyText(
|
510
|
+
const box = this.drawLinePropertyText(
|
511
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
512
|
+
// to always have at least 2 points
|
513
|
+
fullPath[fullPath.length - 2], fullPath[fullPath.length - 1], relationshipView.to.classView.value, relationshipView.property.value, false);
|
512
514
|
minX = Math.min(minX, box.position.x);
|
513
515
|
minY = Math.min(minY, box.position.y);
|
514
516
|
maxX = Math.max(maxX, box.edgePoint().x);
|
@@ -1157,7 +1159,10 @@ export class DiagramRenderer {
|
|
1157
1159
|
fullPath = manageInsidePointsDynamically(fullPath, propertyView.from.classView.value, propertyView.to.classView.value);
|
1158
1160
|
// const toProperty = asso instanceof.property ? asso.property : asso.association.properties[1];
|
1159
1161
|
const toProperty = propertyView.property.value;
|
1160
|
-
this.drawLinePropertyText(
|
1162
|
+
this.drawLinePropertyText(
|
1163
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
1164
|
+
// to always have at least 2 points
|
1165
|
+
fullPath[fullPath.length - 2], fullPath[fullPath.length - 1], propertyView.to.classView.value, toProperty, false);
|
1161
1166
|
// if (asso.association) {
|
1162
1167
|
// this.displayText(fullPath[1], fullPath[0], asso.from.classView, asso.association.properties[0], this.ctx);
|
1163
1168
|
// }
|
@@ -1234,6 +1239,8 @@ export class DiagramRenderer {
|
|
1234
1239
|
const rect = inheritance.to.classView.value.rectangle;
|
1235
1240
|
let fullPath = inheritance.buildFullPath();
|
1236
1241
|
fullPath = manageInsidePointsDynamically(fullPath, inheritance.from.classView.value, inheritance.to.classView.value);
|
1242
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
1243
|
+
// to always have at least 2 points
|
1237
1244
|
const startX = fullPath[fullPath.length - 2].x;
|
1238
1245
|
const startY = fullPath[fullPath.length - 2].y;
|
1239
1246
|
const endX = fullPath[fullPath.length - 1].x;
|
@@ -1312,17 +1319,25 @@ export class DiagramRenderer {
|
|
1312
1319
|
angle = endX >= startX ? angle : angle + Math.PI;
|
1313
1320
|
this.ctx.beginPath();
|
1314
1321
|
this.ctx.moveTo(resultX +
|
1315
|
-
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1316
|
-
|
1322
|
+
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1323
|
+
this.zoom, resultY +
|
1324
|
+
(this.screenOffset.y + this.triangle[0].rotateY(angle)) *
|
1325
|
+
this.zoom);
|
1317
1326
|
this.ctx.lineTo(resultX +
|
1318
|
-
(this.screenOffset.x + this.triangle[1].rotateX(angle)) *
|
1319
|
-
|
1327
|
+
(this.screenOffset.x + this.triangle[1].rotateX(angle)) *
|
1328
|
+
this.zoom, resultY +
|
1329
|
+
(this.screenOffset.y + this.triangle[1].rotateY(angle)) *
|
1330
|
+
this.zoom);
|
1320
1331
|
this.ctx.lineTo(resultX +
|
1321
|
-
(this.screenOffset.x + this.triangle[2].rotateX(angle)) *
|
1322
|
-
|
1332
|
+
(this.screenOffset.x + this.triangle[2].rotateX(angle)) *
|
1333
|
+
this.zoom, resultY +
|
1334
|
+
(this.screenOffset.y + this.triangle[2].rotateY(angle)) *
|
1335
|
+
this.zoom);
|
1323
1336
|
this.ctx.lineTo(resultX +
|
1324
|
-
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1325
|
-
|
1337
|
+
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1338
|
+
this.zoom, resultY +
|
1339
|
+
(this.screenOffset.y + this.triangle[0].rotateY(angle)) *
|
1340
|
+
this.zoom);
|
1326
1341
|
this.ctx.fillStyle = this.generalizationViewInheritanceTriangeFillColor;
|
1327
1342
|
this.ctx.fill();
|
1328
1343
|
this.ctx.stroke();
|
@@ -1560,7 +1575,8 @@ export class DiagramRenderer {
|
|
1560
1575
|
nextZoomLevel = Math.ceil(currentZoomLevel / 10) * 10 - 10;
|
1561
1576
|
}
|
1562
1577
|
else if (currentZoomLevel >=
|
1563
|
-
DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1] +
|
1578
|
+
DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1] +
|
1579
|
+
100) {
|
1564
1580
|
nextZoomLevel = Math.ceil(currentZoomLevel / 100) * 100 - 100;
|
1565
1581
|
}
|
1566
1582
|
else {
|
@@ -1575,9 +1591,9 @@ export class DiagramRenderer {
|
|
1575
1591
|
this.handleAddRelationship) {
|
1576
1592
|
const eventPointInModelCoordinate = this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Point(e.x, e.y)));
|
1577
1593
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
1578
|
-
|
1579
|
-
|
1580
|
-
const gview = this.handleAddRelationship(this.startClassView,
|
1594
|
+
const targetClassView = this.diagram.classViews[i];
|
1595
|
+
if (targetClassView.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
|
1596
|
+
const gview = this.handleAddRelationship(this.startClassView, targetClassView);
|
1581
1597
|
if (gview) {
|
1582
1598
|
gview.from.setOffsetX(-(this.startClassView.position.x +
|
1583
1599
|
this.startClassView.rectangle.width / 2 -
|
@@ -1668,7 +1684,8 @@ export class DiagramRenderer {
|
|
1668
1684
|
// Check if the selection lies within the bottom right corner box of a box (so we can do resize of box here)
|
1669
1685
|
// NOTE: Traverse backwards the class views to preserve z-index buffer
|
1670
1686
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
1671
|
-
|
1687
|
+
const targetClassView = this.diagram.classViews[i];
|
1688
|
+
if (targetClassView
|
1672
1689
|
.buildBottomRightCornerBox()
|
1673
1690
|
.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
|
1674
1691
|
this.setSelectedClasses([]);
|
@@ -1694,11 +1711,11 @@ export class DiagramRenderer {
|
|
1694
1711
|
let anyClassesSelected = false;
|
1695
1712
|
// Traverse backwards the class views to preserve z-index buffer
|
1696
1713
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
1697
|
-
|
1714
|
+
const targetClassView = this.diagram.classViews[i];
|
1715
|
+
if (targetClassView.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
|
1698
1716
|
if (this.selectedClasses.length === 0 ||
|
1699
|
-
this.selectedClasses.indexOf(
|
1700
|
-
|
1701
|
-
this.setSelectedClasses([this.diagram.classViews[i]]);
|
1717
|
+
this.selectedClasses.indexOf(targetClassView) === -1) {
|
1718
|
+
this.setSelectedClasses([targetClassView]);
|
1702
1719
|
}
|
1703
1720
|
if (!this.isReadOnly) {
|
1704
1721
|
// Bring the class view to front
|
@@ -1775,8 +1792,9 @@ export class DiagramRenderer {
|
|
1775
1792
|
this.setSelectionStart(eventPointInModelCoordinate);
|
1776
1793
|
this.startClassView = undefined;
|
1777
1794
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
1778
|
-
|
1779
|
-
|
1795
|
+
const targetClassView = this.diagram.classViews[i];
|
1796
|
+
if (targetClassView.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
|
1797
|
+
this.startClassView = targetClassView;
|
1780
1798
|
}
|
1781
1799
|
}
|
1782
1800
|
if (!this.startClassView) {
|
@@ -2001,7 +2019,10 @@ export class DiagramRenderer {
|
|
2001
2019
|
for (const propertyHolderView of propertyHolderViews) {
|
2002
2020
|
let fullPath = propertyHolderView.buildFullPath();
|
2003
2021
|
fullPath = manageInsidePointsDynamically(fullPath, propertyHolderView.from.classView.value, propertyHolderView.to.classView.value);
|
2004
|
-
const propertyInfoBox = this.drawLinePropertyText(
|
2022
|
+
const propertyInfoBox = this.drawLinePropertyText(
|
2023
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
2024
|
+
// to always have at least 2 points
|
2025
|
+
fullPath[fullPath.length - 2], fullPath[fullPath.length - 1], propertyHolderView.to.classView.value, propertyHolderView.property.value, false);
|
2005
2026
|
if (propertyInfoBox.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
|
2006
2027
|
this.setMouseOverPropertyHolderViewLabel(propertyHolderView);
|
2007
2028
|
break;
|
@@ -2028,33 +2049,38 @@ export class DiagramRenderer {
|
|
2028
2049
|
return [];
|
2029
2050
|
}
|
2030
2051
|
layoutTaxonomy(classViewLevels, diagram, positionInitialClass, superType) {
|
2031
|
-
//Offsets
|
2052
|
+
// Offsets
|
2032
2053
|
const spaceY = 30;
|
2033
2054
|
const spaceX = 10;
|
2034
2055
|
classViewLevels.reverse();
|
2035
|
-
const classViews = classViewLevels.flatMap((
|
2056
|
+
const classViews = classViewLevels.flatMap((levels, currentLevelIndex) => {
|
2036
2057
|
// Get the bounding box of the precedent level
|
2037
2058
|
let precedentTotalWidth = 0;
|
2038
2059
|
let precedentTotalHeight = 0;
|
2039
2060
|
let precedentX = 0;
|
2040
2061
|
let precedentY = 0;
|
2041
2062
|
if (currentLevelIndex > 0) {
|
2042
|
-
const
|
2043
|
-
|
2044
|
-
|
2045
|
-
precedentByX[
|
2046
|
-
|
2047
|
-
precedentByX[
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
precedentByY[
|
2052
|
-
|
2053
|
-
|
2063
|
+
const precedent = classViewLevels[currentLevelIndex - 1];
|
2064
|
+
if (precedent.length) {
|
2065
|
+
const precedentByX = [...precedent].sort((a, b) => a.position.x - b.position.x);
|
2066
|
+
precedentX = precedentByX[0].position.x;
|
2067
|
+
precedentTotalWidth =
|
2068
|
+
precedentByX[precedentByX.length - 1].position.x +
|
2069
|
+
precedentByX[precedentByX.length - 1].rectangle
|
2070
|
+
.width -
|
2071
|
+
precedentByX[0].position.x;
|
2072
|
+
const precedentByY = [...precedent].sort((a, b) => a.position.y - b.position.y);
|
2073
|
+
precedentY = precedentByY[0].position.y;
|
2074
|
+
precedentTotalHeight =
|
2075
|
+
precedentByY[precedentByY.length - 1].position.y +
|
2076
|
+
precedentByY[precedentByY.length - 1].rectangle
|
2077
|
+
.height -
|
2078
|
+
precedentByY[0].position.y;
|
2079
|
+
}
|
2054
2080
|
}
|
2055
2081
|
// Get the bounding box of current Level
|
2056
|
-
const maxHeight = Math.max(...
|
2057
|
-
const totalWidth =
|
2082
|
+
const maxHeight = Math.max(...levels.map((classView) => classView.rectangle.height));
|
2083
|
+
const totalWidth = levels
|
2058
2084
|
.map((classView) => classView.rectangle.width)
|
2059
2085
|
.reduce((a, b) => a + b + spaceX);
|
2060
2086
|
// Get the starting position
|
@@ -2064,19 +2090,19 @@ export class DiagramRenderer {
|
|
2064
2090
|
: precedentY + precedentTotalHeight + spaceY;
|
2065
2091
|
// Set layout of current level
|
2066
2092
|
if (positionInitialClass || currentLevelIndex > 0) {
|
2067
|
-
|
2068
|
-
|
2069
|
-
if (
|
2070
|
-
const precedent =
|
2093
|
+
levels[0].setPosition(new Point(startX, currentLevelY));
|
2094
|
+
levels.forEach((view, idx) => {
|
2095
|
+
if (idx > 0) {
|
2096
|
+
const precedent = levels[idx - 1];
|
2071
2097
|
view.setPosition(new Point(precedent.position.x + precedent.rectangle.width + spaceX, currentLevelY));
|
2072
2098
|
}
|
2073
2099
|
});
|
2074
2100
|
}
|
2075
|
-
return
|
2101
|
+
return levels;
|
2076
2102
|
});
|
2077
2103
|
const generalizationViews = (superType ? classViewLevels : classViewLevels.reverse())
|
2078
2104
|
.slice(0, classViewLevels.length - 1)
|
2079
|
-
.flatMap((level,
|
2105
|
+
.flatMap((level, idx) => level.flatMap((fromClassView) => classViewLevels[idx + 1].flatMap((toClassView) => {
|
2080
2106
|
if (fromClassView.class.value.generalizations
|
2081
2107
|
.map((g) => g.value.rawType)
|
2082
2108
|
.includes(toClassView.class.value)) {
|