@finos/legend-extension-dsl-diagram 7.1.43 → 7.1.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -179,7 +179,9 @@ export declare class DiagramRenderer {
179
179
  setMiddleClick(val: boolean): void;
180
180
  setRightClick(val: boolean): void;
181
181
  setZoomLevel(val: number): void;
182
- render(): void;
182
+ render(options?: {
183
+ initial?: boolean | undefined;
184
+ }): void;
183
185
  refresh(): void;
184
186
  refreshCanvas(): void;
185
187
  clearScreen(): void;
@@ -244,13 +246,13 @@ export declare class DiagramRenderer {
244
246
  switchToAddInheritanceMode(): void;
245
247
  switchToAddClassMode(): void;
246
248
  ejectProperty(): void;
249
+ getSuperTypeLevels(classViews: ClassView[], diagram: Diagram, currentDepth: number, recurseMaxDepth: number): ClassView[][];
250
+ layoutTaxonomy(classViewLevels: ClassView[][], diagram: Diagram, positionInitialClass: boolean, superType: boolean): [ClassView[], GeneralizationView[]];
247
251
  keydown(e: KeyboardEvent): void;
248
252
  mouseup(e: MouseEvent): void;
249
253
  mousedblclick(e: MouseEvent): void;
250
254
  mousedown(e: MouseEvent): void;
251
255
  mousewheel(e: WheelEvent): void;
252
256
  mousemove(e: MouseEvent): void;
253
- getSuperTypeLevels(classViews: ClassView[], diagram: Diagram, currentDepth: number, recurseMaxDepth: number): ClassView[][];
254
- layoutTaxonomy(classViewLevels: ClassView[][], diagram: Diagram, positionInitialClass: boolean, superType: boolean): [ClassView[], GeneralizationView[]];
255
257
  }
256
258
  //# sourceMappingURL=DiagramRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiagramRenderer.d.ts","sourceRoot":"","sources":["../src/DiagramRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,EAeN,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2EAA2E,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,MAAM,sFAAsF,CAAC;AACjH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AchB,gBAAgB,IAAI,IAAI;IASxB,gBAAgB,IAAI,IAAI;IAOxB,eAAe,IAAI,IAAI;IAOvB,uBAAuB,IAAI,IAAI;IAS/B,0BAA0B,IAAI,IAAI;IASlC,oBAAoB,IAAI,IAAI;IAS5B,aAAa,IAAI,IAAI;IA8BrB,kBAAkB,CAChB,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,SAAS,EAAE,EAAE;IAoChB,cAAc,CACZ,eAAe,EAAE,SAAS,EAAE,EAAE,EAC9B,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,OAAO,EAC7B,SAAS,EAAE,OAAO,GACjB,CAAC,SAAS,EAAE,EAAE,kBAAkB,EAAE,CAAC;IAsGtC,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAgM/B,OAAO,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA0J5B,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAuElC,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAsO9B,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAc/B,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CA4V/B"}
@@ -378,9 +378,23 @@ export class DiagramRenderer {
378
378
  setZoomLevel(val) {
379
379
  this.zoom = val;
380
380
  }
381
- render() {
381
+ render(options) {
382
382
  this.diagram.classViews.forEach((classView) => this.ensureClassViewMeetMinDimensions(classView));
383
383
  this.refresh();
384
+ if (options?.initial) {
385
+ this.autoRecenter();
386
+ // only zoom to fit if needed
387
+ if (this.canvas.width <
388
+ this.virtualScreen.rectangle.width +
389
+ this.screenPadding * 2 +
390
+ FIT_ZOOM_PADDING * 2 ||
391
+ this.canvas.height <
392
+ this.virtualScreen.rectangle.height +
393
+ this.screenPadding * 2 +
394
+ FIT_ZOOM_PADDING * 2) {
395
+ this.zoomToFit();
396
+ }
397
+ }
384
398
  }
385
399
  refresh() {
386
400
  this.refreshCanvas();
@@ -1596,6 +1610,85 @@ export class DiagramRenderer {
1596
1610
  }
1597
1611
  }
1598
1612
  }
1613
+ getSuperTypeLevels(classViews, diagram, currentDepth, recurseMaxDepth) {
1614
+ if (classViews.length) {
1615
+ const res = uniqBy(classViews.flatMap((classView) => classView.class.value.generalizations.map((generation) => new ClassView(diagram, uuid(), PackageableElementExplicitReference.create(getRawGenericType(generation.value, Class))))), (a) => a.class.value);
1616
+ res.forEach((classView) => this.ensureClassViewMeetMinDimensions(classView));
1617
+ if (recurseMaxDepth === -1 || currentDepth < recurseMaxDepth) {
1618
+ const rec = this.getSuperTypeLevels(res, diagram, currentDepth + 1, recurseMaxDepth);
1619
+ rec.push(classViews);
1620
+ return rec;
1621
+ }
1622
+ else {
1623
+ return [classViews];
1624
+ }
1625
+ }
1626
+ return [];
1627
+ }
1628
+ layoutTaxonomy(classViewLevels, diagram, positionInitialClass, superType) {
1629
+ // Offsets
1630
+ const spaceY = 30;
1631
+ const spaceX = 10;
1632
+ classViewLevels.reverse();
1633
+ const classViews = classViewLevels.flatMap((levels, currentLevelIndex) => {
1634
+ // Get the bounding box of the precedent level
1635
+ let precedentTotalWidth = 0;
1636
+ let precedentTotalHeight = 0;
1637
+ let precedentX = 0;
1638
+ let precedentY = 0;
1639
+ if (currentLevelIndex > 0) {
1640
+ const precedent = classViewLevels[currentLevelIndex - 1];
1641
+ if (precedent.length) {
1642
+ const precedentByX = [...precedent].sort((a, b) => a.position.x - b.position.x);
1643
+ precedentX = precedentByX[0].position.x;
1644
+ precedentTotalWidth =
1645
+ precedentByX[precedentByX.length - 1].position.x +
1646
+ precedentByX[precedentByX.length - 1].rectangle
1647
+ .width -
1648
+ precedentByX[0].position.x;
1649
+ const precedentByY = [...precedent].sort((a, b) => a.position.y - b.position.y);
1650
+ precedentY = precedentByY[0].position.y;
1651
+ precedentTotalHeight =
1652
+ precedentByY[precedentByY.length - 1].position.y +
1653
+ precedentByY[precedentByY.length - 1].rectangle
1654
+ .height -
1655
+ precedentByY[0].position.y;
1656
+ }
1657
+ }
1658
+ // Get the bounding box of current Level
1659
+ const maxHeight = Math.max(...levels.map((classView) => classView.rectangle.height));
1660
+ const totalWidth = levels
1661
+ .map((classView) => classView.rectangle.width)
1662
+ .reduce((a, b) => a + b + spaceX);
1663
+ // Get the starting position
1664
+ const startX = precedentX + precedentTotalWidth / 2 - totalWidth / 2;
1665
+ const currentLevelY = superType
1666
+ ? precedentY - maxHeight - spaceY
1667
+ : precedentY + precedentTotalHeight + spaceY;
1668
+ // Set layout of current level
1669
+ if (positionInitialClass || currentLevelIndex > 0) {
1670
+ positionedRectangle_setPosition(levels[0], new Point(startX, currentLevelY));
1671
+ levels.forEach((view, idx) => {
1672
+ if (idx > 0) {
1673
+ const precedent = levels[idx - 1];
1674
+ positionedRectangle_setPosition(view, new Point(precedent.position.x + precedent.rectangle.width + spaceX, currentLevelY));
1675
+ }
1676
+ });
1677
+ }
1678
+ return levels;
1679
+ });
1680
+ const generalizationViews = (superType ? classViewLevels : classViewLevels.slice().reverse())
1681
+ .slice(0, classViewLevels.length - 1)
1682
+ .flatMap((level, idx) => level.flatMap((fromClassView) => classViewLevels[idx + 1].flatMap((toClassView) => {
1683
+ if (fromClassView.class.value.generalizations
1684
+ .map((g) => g.value.rawType)
1685
+ .includes(toClassView.class.value)) {
1686
+ return new GeneralizationView(diagram, fromClassView, toClassView);
1687
+ }
1688
+ return [];
1689
+ })));
1690
+ return [classViews, generalizationViews];
1691
+ }
1599
1692
  // --------------------------------- Event handler --------------------------
1600
1693
  keydown(e) {
1601
1694
  // Remove selected view(s)
@@ -2211,88 +2304,5 @@ export class DiagramRenderer {
2211
2304
  }
2212
2305
  }
2213
2306
  }
2214
- //---------------------
2215
- // Inheritance helpers
2216
- //---------------------
2217
- getSuperTypeLevels(classViews, diagram, currentDepth, recurseMaxDepth) {
2218
- if (classViews.length) {
2219
- const res = uniqBy(classViews.flatMap((classView) => classView.class.value.generalizations.map((generation) => new ClassView(diagram, uuid(), PackageableElementExplicitReference.create(getRawGenericType(generation.value, Class))))), (a) => a.class.value);
2220
- res.forEach((classView) => this.ensureClassViewMeetMinDimensions(classView));
2221
- if (recurseMaxDepth === -1 || currentDepth < recurseMaxDepth) {
2222
- const rec = this.getSuperTypeLevels(res, diagram, currentDepth + 1, recurseMaxDepth);
2223
- rec.push(classViews);
2224
- return rec;
2225
- }
2226
- else {
2227
- return [classViews];
2228
- }
2229
- }
2230
- return [];
2231
- }
2232
- // --------------------------------------- Extension -----------------------------------
2233
- layoutTaxonomy(classViewLevels, diagram, positionInitialClass, superType) {
2234
- // Offsets
2235
- const spaceY = 30;
2236
- const spaceX = 10;
2237
- classViewLevels.reverse();
2238
- const classViews = classViewLevels.flatMap((levels, currentLevelIndex) => {
2239
- // Get the bounding box of the precedent level
2240
- let precedentTotalWidth = 0;
2241
- let precedentTotalHeight = 0;
2242
- let precedentX = 0;
2243
- let precedentY = 0;
2244
- if (currentLevelIndex > 0) {
2245
- const precedent = classViewLevels[currentLevelIndex - 1];
2246
- if (precedent.length) {
2247
- const precedentByX = [...precedent].sort((a, b) => a.position.x - b.position.x);
2248
- precedentX = precedentByX[0].position.x;
2249
- precedentTotalWidth =
2250
- precedentByX[precedentByX.length - 1].position.x +
2251
- precedentByX[precedentByX.length - 1].rectangle
2252
- .width -
2253
- precedentByX[0].position.x;
2254
- const precedentByY = [...precedent].sort((a, b) => a.position.y - b.position.y);
2255
- precedentY = precedentByY[0].position.y;
2256
- precedentTotalHeight =
2257
- precedentByY[precedentByY.length - 1].position.y +
2258
- precedentByY[precedentByY.length - 1].rectangle
2259
- .height -
2260
- precedentByY[0].position.y;
2261
- }
2262
- }
2263
- // Get the bounding box of current Level
2264
- const maxHeight = Math.max(...levels.map((classView) => classView.rectangle.height));
2265
- const totalWidth = levels
2266
- .map((classView) => classView.rectangle.width)
2267
- .reduce((a, b) => a + b + spaceX);
2268
- // Get the starting position
2269
- const startX = precedentX + precedentTotalWidth / 2 - totalWidth / 2;
2270
- const currentLevelY = superType
2271
- ? precedentY - maxHeight - spaceY
2272
- : precedentY + precedentTotalHeight + spaceY;
2273
- // Set layout of current level
2274
- if (positionInitialClass || currentLevelIndex > 0) {
2275
- positionedRectangle_setPosition(levels[0], new Point(startX, currentLevelY));
2276
- levels.forEach((view, idx) => {
2277
- if (idx > 0) {
2278
- const precedent = levels[idx - 1];
2279
- positionedRectangle_setPosition(view, new Point(precedent.position.x + precedent.rectangle.width + spaceX, currentLevelY));
2280
- }
2281
- });
2282
- }
2283
- return levels;
2284
- });
2285
- const generalizationViews = (superType ? classViewLevels : classViewLevels.slice().reverse())
2286
- .slice(0, classViewLevels.length - 1)
2287
- .flatMap((level, idx) => level.flatMap((fromClassView) => classViewLevels[idx + 1].flatMap((toClassView) => {
2288
- if (fromClassView.class.value.generalizations
2289
- .map((g) => g.value.rawType)
2290
- .includes(toClassView.class.value)) {
2291
- return new GeneralizationView(diagram, fromClassView, toClassView);
2292
- }
2293
- return [];
2294
- })));
2295
- return [classViews, generalizationViews];
2296
- }
2297
2307
  }
2298
2308
  //# sourceMappingURL=DiagramRenderer.js.map