@finos/legend-extension-dsl-diagram 7.1.8 → 7.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/DiagramRenderer.d.ts +2 -2
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +29 -21
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.d.ts.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.js +1 -1
- package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
- package/lib/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/studio/DiagramEditor.d.ts.map +1 -1
- package/lib/components/studio/DiagramEditor.js +3 -3
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +8 -8
- package/src/DiagramRenderer.ts +20 -12
- package/src/components/studio/ClassDiagramPreview.tsx +1 -6
- package/src/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.tsx +1 -1
- package/src/components/studio/DiagramEditor.tsx +21 -10
- package/src/index.ts +3 -0
package/lib/DiagramRenderer.d.ts
CHANGED
@@ -35,7 +35,7 @@ export declare enum DIAGRAM_RELATIONSHIP_EDIT_MODE {
|
|
35
35
|
INHERITANCE = 1,
|
36
36
|
NONE = 2
|
37
37
|
}
|
38
|
-
export declare enum
|
38
|
+
export declare enum DIAGRAM_ALIGNER_OPERATOR {
|
39
39
|
ALIGN_LEFT = 0,
|
40
40
|
ALIGN_CENTER = 1,
|
41
41
|
ALIGN_RIGHT = 2,
|
@@ -188,7 +188,7 @@ export declare class DiagramRenderer {
|
|
188
188
|
*/
|
189
189
|
private center;
|
190
190
|
changeMode(editMode: DIAGRAM_INTERACTION_MODE, relationshipMode: DIAGRAM_RELATIONSHIP_EDIT_MODE): void;
|
191
|
-
align(op:
|
191
|
+
align(op: DIAGRAM_ALIGNER_OPERATOR): void;
|
192
192
|
truncateTextWithEllipsis(val: string, limit?: number): string;
|
193
193
|
canvasCoordinateToModelCoordinate(point: Point): Point;
|
194
194
|
modelCoordinateToCanvasCoordinate(point: Point): Point;
|
@@ -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,OAAO,EAAE,KAAK,EAAE,MAAM,kFAAkF,CAAC;AACzG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gGAAgG,CAAC;AACrI,OAAO,EAAE,SAAS,EAAE,MAAM,6EAA6E,CAAC;AACxG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sFAAsF,CAAC;AAC/H,OAAO,EAAE,kBAAkB,EAAE,MAAM,sFAAsF,CAAC;AAC1H,OAAO,EAAE,gBAAgB,EAAE,MAAM,oFAAoF,CAAC;AA0CtH,oBAAY,wBAAwB;IAClC,MAAM,IAAA;IACN,GAAG,IAAA;IACH,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,gBAAgB,IAAA;IAChB,SAAS,IAAA;CACV;AAED,oBAAY,8BAA8B;IAExC,QAAQ,IAAA;IACR,WAAW,IAAA;IACX,IAAI,IAAA;CACL;AAED,oBAAY,
|
1
|
+
{"version":3,"file":"DiagramRenderer.d.ts","sourceRoot":"","sources":["../src/DiagramRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,EAeN,M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IP_EDIT_MODE || (DIAGRAM_RELATIONSHIP_EDIT_MODE = {}));
|
47
|
-
export var
|
48
|
-
(function (
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
})(
|
47
|
+
export var DIAGRAM_ALIGNER_OPERATOR;
|
48
|
+
(function (DIAGRAM_ALIGNER_OPERATOR) {
|
49
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_LEFT"] = 0] = "ALIGN_LEFT";
|
50
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_CENTER"] = 1] = "ALIGN_CENTER";
|
51
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_RIGHT"] = 2] = "ALIGN_RIGHT";
|
52
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_TOP"] = 3] = "ALIGN_TOP";
|
53
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_MIDDLE"] = 4] = "ALIGN_MIDDLE";
|
54
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["ALIGN_BOTTOM"] = 5] = "ALIGN_BOTTOM";
|
55
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["SPACE_HORIZONTALLY"] = 6] = "SPACE_HORIZONTALLY";
|
56
|
+
DIAGRAM_ALIGNER_OPERATOR[DIAGRAM_ALIGNER_OPERATOR["SPACE_VERTICALLY"] = 7] = "SPACE_VERTICALLY";
|
57
|
+
})(DIAGRAM_ALIGNER_OPERATOR = DIAGRAM_ALIGNER_OPERATOR || (DIAGRAM_ALIGNER_OPERATOR = {}));
|
58
58
|
const MIN_ZOOM_LEVEL = 0.05; // 5%
|
59
59
|
const FIT_ZOOM_PADDING = 10;
|
60
60
|
export const DIAGRAM_ZOOM_LEVELS = [
|
@@ -478,37 +478,37 @@ export class DiagramRenderer {
|
|
478
478
|
return;
|
479
479
|
}
|
480
480
|
switch (op) {
|
481
|
-
case
|
481
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_LEFT: {
|
482
482
|
const leftBound = this.selectedClasses.reduce((val, view) => Math.min(val, view.position.x), Number.MAX_SAFE_INTEGER);
|
483
483
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(leftBound, view.position.y)));
|
484
484
|
break;
|
485
485
|
}
|
486
|
-
case
|
487
|
-
const center = this.selectedClasses.reduce((val, view) => val + view.position.x + view.rectangle.width, 0) / this.selectedClasses.length;
|
486
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_CENTER: {
|
487
|
+
const center = this.selectedClasses.reduce((val, view) => val + view.position.x + view.rectangle.width / 2, 0) / this.selectedClasses.length;
|
488
488
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(center - view.rectangle.width / 2, view.position.y)));
|
489
489
|
break;
|
490
490
|
}
|
491
|
-
case
|
491
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_RIGHT: {
|
492
492
|
const rightBound = this.selectedClasses.reduce((val, view) => Math.max(val, view.position.x + view.rectangle.width), -Number.MAX_SAFE_INTEGER);
|
493
493
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(rightBound - view.rectangle.width, view.position.y)));
|
494
494
|
break;
|
495
495
|
}
|
496
|
-
case
|
496
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_TOP: {
|
497
497
|
const topBound = this.selectedClasses.reduce((val, view) => Math.min(val, view.position.y), Number.MAX_SAFE_INTEGER);
|
498
498
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(view.position.x, topBound)));
|
499
499
|
break;
|
500
500
|
}
|
501
|
-
case
|
502
|
-
const middle = this.selectedClasses.reduce((val, view) => val + view.position.y + view.rectangle.height, 0) / this.selectedClasses.length;
|
501
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_MIDDLE: {
|
502
|
+
const middle = this.selectedClasses.reduce((val, view) => val + view.position.y + view.rectangle.height / 2, 0) / this.selectedClasses.length;
|
503
503
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(view.position.x, middle - view.rectangle.height / 2)));
|
504
504
|
break;
|
505
505
|
}
|
506
|
-
case
|
506
|
+
case DIAGRAM_ALIGNER_OPERATOR.ALIGN_BOTTOM: {
|
507
507
|
const bottomBound = this.selectedClasses.reduce((val, view) => Math.max(val, view.position.y + view.rectangle.height), -Number.MAX_SAFE_INTEGER);
|
508
508
|
this.selectedClasses.forEach((view) => positionedRectangle_setPosition(view, new Point(view.position.x, bottomBound - view.rectangle.height)));
|
509
509
|
break;
|
510
510
|
}
|
511
|
-
case
|
511
|
+
case DIAGRAM_ALIGNER_OPERATOR.SPACE_HORIZONTALLY: {
|
512
512
|
const sorted = this.selectedClasses
|
513
513
|
.slice()
|
514
514
|
.sort((a, b) => a.position.x - b.position.x);
|
@@ -538,7 +538,7 @@ export class DiagramRenderer {
|
|
538
538
|
}
|
539
539
|
break;
|
540
540
|
}
|
541
|
-
case
|
541
|
+
case DIAGRAM_ALIGNER_OPERATOR.SPACE_VERTICALLY: {
|
542
542
|
const sorted = this.selectedClasses
|
543
543
|
.slice()
|
544
544
|
.sort((a, b) => a.position.y - b.position.y);
|
@@ -2003,6 +2003,14 @@ export class DiagramRenderer {
|
|
2003
2003
|
this.drawAll();
|
2004
2004
|
}
|
2005
2005
|
mousewheel(e) {
|
2006
|
+
// no scrolling to be done since we want to convert scroll into zoom
|
2007
|
+
e.preventDefault();
|
2008
|
+
e.stopImmediatePropagation();
|
2009
|
+
// if scrolling is more horizontal than vertical, i.e. zoom using trackpad
|
2010
|
+
// we don't want to treat this as zooming
|
2011
|
+
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) {
|
2012
|
+
return;
|
2013
|
+
}
|
2006
2014
|
// scroll down to zoom in and up to zoom out
|
2007
2015
|
const newZoomLevel = this.zoom - (e.deltaY / 120) * 0.05;
|
2008
2016
|
this.executeZoom(newZoomLevel, new Point(e.x, e.y));
|