@eclipse-glsp/layout-elk 1.1.0-next.e0d359d.30 → 1.1.0-next.f692ea4.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/di.config.d.ts +3 -2
- package/lib/di.config.d.ts.map +1 -1
- package/lib/di.config.js +10 -11
- package/lib/di.config.js.map +1 -1
- package/lib/element-filter.d.ts +2 -2
- package/lib/element-filter.d.ts.map +1 -1
- package/lib/element-filter.js +9 -9
- package/lib/element-filter.js.map +1 -1
- package/lib/glsp-elk-layout-engine.d.ts +2 -2
- package/lib/glsp-elk-layout-engine.d.ts.map +1 -1
- package/lib/glsp-elk-layout-engine.js +29 -29
- package/lib/glsp-elk-layout-engine.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/layout-configurator.d.ts +2 -2
- package/lib/layout-configurator.d.ts.map +1 -1
- package/lib/layout-configurator.js +8 -8
- package/lib/layout-configurator.js.map +1 -1
- package/package.json +22 -25
- package/src/di.config.spec.ts +26 -5
- package/src/di.config.ts +4 -5
- package/src/element-filter.ts +2 -2
- package/src/glsp-elk-layout-engine.ts +2 -2
- package/src/layout-configurator.ts +2 -2
- package/lib/di.config.spec.d.ts +0 -2
- package/lib/di.config.spec.d.ts.map +0 -1
- package/lib/di.config.spec.js +0 -97
- package/lib/di.config.spec.js.map +0 -1
package/lib/di.config.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LayoutOptions } from 'elkjs/lib/elk.bundled';
|
|
2
2
|
import { ContainerModule } from 'inversify';
|
|
3
|
-
import { ElementFilter
|
|
4
|
-
|
|
3
|
+
import { ElementFilter } from './element-filter';
|
|
4
|
+
import { LayoutConfigurator } from './layout-configurator';
|
|
5
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
5
6
|
/**
|
|
6
7
|
* Configuration options for the {@link configureELKLayoutModule} function.
|
|
7
8
|
*/
|
package/lib/di.config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":"AAgBA,OAAuB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":"AAgBA,OAAuB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAA8B,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACrD;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAoCnF"}
|
package/lib/di.config.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configureELKLayoutModule = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
5
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,11 +16,10 @@ exports.configureELKLayoutModule = void 0;
|
|
|
16
16
|
*
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
|
-
const
|
|
19
|
+
const server_1 = require("@eclipse-glsp/server");
|
|
20
20
|
const elk_bundled_1 = require("elkjs/lib/elk.bundled");
|
|
21
21
|
const inversify_1 = require("inversify");
|
|
22
22
|
const sprotty_elk_1 = require("sprotty-elk");
|
|
23
|
-
const _1 = require(".");
|
|
24
23
|
const element_filter_1 = require("./element-filter");
|
|
25
24
|
const glsp_elk_layout_engine_1 = require("./glsp-elk-layout-engine");
|
|
26
25
|
const layout_configurator_1 = require("./layout-configurator");
|
|
@@ -43,16 +42,16 @@ const layout_configurator_1 = require("./layout-configurator");
|
|
|
43
42
|
function configureELKLayoutModule(options) {
|
|
44
43
|
return new inversify_1.ContainerModule(bind => {
|
|
45
44
|
if (options.elementFilter) {
|
|
46
|
-
bind(
|
|
45
|
+
bind(element_filter_1.ElementFilter).to(options.elementFilter).inSingletonScope();
|
|
47
46
|
}
|
|
48
47
|
else {
|
|
49
|
-
bind(
|
|
48
|
+
bind(element_filter_1.ElementFilter).to(element_filter_1.DefaultElementFilter).inSingletonScope();
|
|
50
49
|
}
|
|
51
50
|
if (options.layoutConfigurator) {
|
|
52
|
-
bind(
|
|
51
|
+
bind(layout_configurator_1.LayoutConfigurator).to(options.layoutConfigurator);
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
|
-
bind(
|
|
54
|
+
bind(layout_configurator_1.LayoutConfigurator)
|
|
56
55
|
.toDynamicValue(context => new layout_configurator_1.FallbackLayoutConfigurator(options.algorithms, options.defaultLayoutOptions))
|
|
57
56
|
.inSingletonScope();
|
|
58
57
|
}
|
|
@@ -65,13 +64,13 @@ function configureELKLayoutModule(options) {
|
|
|
65
64
|
.toDynamicValue(context => {
|
|
66
65
|
const container = context.container;
|
|
67
66
|
const factory = container.get(sprotty_elk_1.ElkFactory);
|
|
68
|
-
const filter = container.get(
|
|
69
|
-
const configurator = container.get(
|
|
70
|
-
const modelState = container.get(
|
|
67
|
+
const filter = container.get(element_filter_1.ElementFilter);
|
|
68
|
+
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
69
|
+
const modelState = container.get(server_1.ModelState);
|
|
71
70
|
return new glsp_elk_layout_engine_1.GlspElkLayoutEngine(factory, filter, configurator, modelState);
|
|
72
71
|
})
|
|
73
72
|
.inSingletonScope();
|
|
74
|
-
bind(
|
|
73
|
+
bind(server_1.LayoutEngine).toService(glsp_elk_layout_engine_1.GlspElkLayoutEngine);
|
|
75
74
|
});
|
|
76
75
|
}
|
|
77
76
|
exports.configureELKLayoutModule = configureELKLayoutModule;
|
package/lib/di.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAAgE;AAChE,uDAAsE;AACtE,yCAA4C;AAC5C,6CAAyC;AACzC,qDAAuE;AACvE,qEAA+D;AAC/D,+DAAuF;AA6BvF;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,wBAAwB,CAAC,OAAyB;IAC9D,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC9B,IAAI,OAAO,CAAC,aAAa,EAAE;YACvB,IAAI,CAAC,8BAAa,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,gBAAgB,EAAE,CAAC;SACpE;aAAM;YACH,IAAI,CAAC,8BAAa,CAAC,CAAC,EAAE,CAAC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oCC"}
|
package/lib/element-filter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GEdge, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server
|
|
16
|
+
import { GEdge, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server';
|
|
17
17
|
export declare const ElementFilter: unique symbol;
|
|
18
18
|
/**
|
|
19
19
|
* Filter used to determine which model elements should be included in the automatic layout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-filter.d.ts","sourceRoot":"","sources":["../src/element-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"element-filter.d.ts","sourceRoot":"","sources":["../src/element-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG9F,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,qBACa,oBAAqB,YAAW,aAAa;IAEtD,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAatC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO;IAI1C,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO;IAe1C,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAI7C,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO;CAG7C"}
|
package/lib/element-filter.js
CHANGED
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DefaultElementFilter = exports.ElementFilter = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2018-
|
|
14
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
15
15
|
*
|
|
16
16
|
* This program and the accompanying materials are made available under the
|
|
17
17
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -25,7 +25,7 @@ exports.DefaultElementFilter = exports.ElementFilter = void 0;
|
|
|
25
25
|
*
|
|
26
26
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
27
|
********************************************************************************/
|
|
28
|
-
const
|
|
28
|
+
const server_1 = require("@eclipse-glsp/server");
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
30
|
exports.ElementFilter = Symbol('ElementFilter');
|
|
31
31
|
/**
|
|
@@ -38,16 +38,16 @@ exports.ElementFilter = Symbol('ElementFilter');
|
|
|
38
38
|
*/
|
|
39
39
|
let DefaultElementFilter = class DefaultElementFilter {
|
|
40
40
|
apply(element) {
|
|
41
|
-
if (element instanceof
|
|
41
|
+
if (element instanceof server_1.GNode) {
|
|
42
42
|
return this.filterNode(element);
|
|
43
43
|
}
|
|
44
|
-
else if (element instanceof
|
|
44
|
+
else if (element instanceof server_1.GEdge) {
|
|
45
45
|
return this.filterEdge(element);
|
|
46
46
|
}
|
|
47
|
-
else if (element instanceof
|
|
47
|
+
else if (element instanceof server_1.GLabel) {
|
|
48
48
|
this.filterLabel(element);
|
|
49
49
|
}
|
|
50
|
-
else if (element instanceof
|
|
50
|
+
else if (element instanceof server_1.GPort) {
|
|
51
51
|
this.filterPort(element);
|
|
52
52
|
}
|
|
53
53
|
return true;
|
|
@@ -57,11 +57,11 @@ let DefaultElementFilter = class DefaultElementFilter {
|
|
|
57
57
|
}
|
|
58
58
|
filterEdge(edge) {
|
|
59
59
|
const source = this.modelState.index.get(edge.sourceId);
|
|
60
|
-
if (!source || (source instanceof
|
|
60
|
+
if (!source || (source instanceof server_1.GNode && !this.filterNode(source)) || (source instanceof server_1.GPort && !this.filterPort(source))) {
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
63
|
const target = this.modelState.index.get(edge.targetId);
|
|
64
|
-
if (!target || (target instanceof
|
|
64
|
+
if (!target || (target instanceof server_1.GNode && !this.filterNode(target)) || (target instanceof server_1.GPort && !this.filterPort(target))) {
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
67
|
return true;
|
|
@@ -74,7 +74,7 @@ let DefaultElementFilter = class DefaultElementFilter {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
__decorate([
|
|
77
|
-
(0, inversify_1.inject)(
|
|
77
|
+
(0, inversify_1.inject)(server_1.ModelState),
|
|
78
78
|
__metadata("design:type", Object)
|
|
79
79
|
], DefaultElementFilter.prototype, "modelState", void 0);
|
|
80
80
|
DefaultElementFilter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-filter.js","sourceRoot":"","sources":["../src/element-filter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"element-filter.js","sourceRoot":"","s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AAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,YAAY,cAAK,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;YAC3H,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,WAAW,CAAC,KAAa;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,UAAU,CAAC,IAAW;QAC5B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AA1CG;IAAC,IAAA,kBAAM,EAAC,mBAAU,CAAC;;wDACc;AAFxB,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA2ChC;AA3CY,oDAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
3
3
|
* This program and the accompanying materials are made available under the
|
|
4
4
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
5
5
|
* http://www.eclipse.org/legal/epl-2.0.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
14
14
|
********************************************************************************/
|
|
15
|
-
import { GEdge, GGraph, GLabel, GModelElement, GModelElementConstructor, GModelRoot, GNode, GPort, GShapeElement, LayoutEngine, MaybePromise, ModelState } from '@eclipse-glsp/server
|
|
15
|
+
import { GEdge, GGraph, GLabel, GModelElement, GModelElementConstructor, GModelRoot, GNode, GPort, GShapeElement, LayoutEngine, MaybePromise, ModelState } from '@eclipse-glsp/server';
|
|
16
16
|
import { ELK, ElkEdge, ElkGraphElement, ElkLabel, ElkNode, ElkPort, ElkPrimitiveEdge, ElkShape } from 'elkjs/lib/elk-api';
|
|
17
17
|
import { ElkFactory } from 'sprotty-elk';
|
|
18
18
|
import { ElementFilter } from './element-filter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-elk-layout-engine.d.ts","sourceRoot":"","sources":["../src/glsp-elk-layout-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;kFAakF;AAClF,OAAO,EAIH,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,wBAAwB,EACxB,UAAU,EACV,KAAK,EACL,KAAK,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EAEb,MAAM,
|
|
1
|
+
{"version":3,"file":"glsp-elk-layout-engine.d.ts","sourceRoot":"","sources":["../src/glsp-elk-layout-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;kFAakF;AAClF,OAAO,EAIH,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,wBAAwB,EACxB,UAAU,EACV,KAAK,EACL,KAAK,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAmB,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE3I,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,qBACa,mBAAoB,YAAW,YAAY;IAQhD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa;IACxC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,kBAAkB;IACnD,SAAS,CAAC,UAAU,EAAE,UAAU;IATpC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAE5B,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;IAC9B,SAAS,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value: true });
|
|
12
12
|
exports.GlspElkLayoutEngine = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2018-
|
|
14
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
15
15
|
* This program and the accompanying materials are made available under the
|
|
16
16
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
17
17
|
* http://www.eclipse.org/legal/epl-2.0.
|
|
@@ -24,7 +24,7 @@ exports.GlspElkLayoutEngine = void 0;
|
|
|
24
24
|
*
|
|
25
25
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
26
26
|
********************************************************************************/
|
|
27
|
-
const
|
|
27
|
+
const server_1 = require("@eclipse-glsp/server");
|
|
28
28
|
const inversify_1 = require("inversify");
|
|
29
29
|
const sprotty_elk_1 = require("sprotty-elk");
|
|
30
30
|
const element_filter_1 = require("./element-filter");
|
|
@@ -42,7 +42,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
42
42
|
}
|
|
43
43
|
layout() {
|
|
44
44
|
const root = this.modelState.root;
|
|
45
|
-
if (!(root instanceof
|
|
45
|
+
if (!(root instanceof server_1.GGraph)) {
|
|
46
46
|
return root;
|
|
47
47
|
}
|
|
48
48
|
this.elkEdges = [];
|
|
@@ -54,7 +54,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
transformToElk(model) {
|
|
57
|
-
if (model instanceof
|
|
57
|
+
if (model instanceof server_1.GGraph) {
|
|
58
58
|
const graph = this.transformGraph(model);
|
|
59
59
|
this.elkEdges.forEach(elkEdge => {
|
|
60
60
|
const parent = this.findCommonAncestor(elkEdge);
|
|
@@ -64,16 +64,16 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
64
64
|
});
|
|
65
65
|
return graph;
|
|
66
66
|
}
|
|
67
|
-
else if (model instanceof
|
|
67
|
+
else if (model instanceof server_1.GNode) {
|
|
68
68
|
return this.transformNode(model);
|
|
69
69
|
}
|
|
70
|
-
else if (model instanceof
|
|
70
|
+
else if (model instanceof server_1.GEdge) {
|
|
71
71
|
return this.transformEdge(model);
|
|
72
72
|
}
|
|
73
|
-
else if (model instanceof
|
|
73
|
+
else if (model instanceof server_1.GLabel) {
|
|
74
74
|
return this.transformPort(model);
|
|
75
75
|
}
|
|
76
|
-
else if (model instanceof
|
|
76
|
+
else if (model instanceof server_1.GPort) {
|
|
77
77
|
return this.transformPort(model);
|
|
78
78
|
}
|
|
79
79
|
throw new Error('Type not supported: ' + model.type);
|
|
@@ -91,7 +91,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
91
91
|
if (child instanceof constructor && this.filter.apply(element)) {
|
|
92
92
|
result.push(child);
|
|
93
93
|
}
|
|
94
|
-
else if (child instanceof
|
|
94
|
+
else if (child instanceof server_1.GCompartment) {
|
|
95
95
|
result.push(...this.findChildren(child, constructor));
|
|
96
96
|
}
|
|
97
97
|
});
|
|
@@ -103,8 +103,8 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
103
103
|
if (!source || !target) {
|
|
104
104
|
return undefined;
|
|
105
105
|
}
|
|
106
|
-
const sourceParent = (0,
|
|
107
|
-
const targetParent = (0,
|
|
106
|
+
const sourceParent = (0, server_1.findParent)(source.parent, parent => parent instanceof server_1.GNode || parent instanceof server_1.GGraph);
|
|
107
|
+
const targetParent = (0, server_1.findParent)(target.parent, parent => parent instanceof server_1.GNode || parent instanceof server_1.GGraph);
|
|
108
108
|
if (!sourceParent || !targetParent) {
|
|
109
109
|
return undefined;
|
|
110
110
|
}
|
|
@@ -125,9 +125,9 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
125
125
|
layoutOptions: this.configurator.apply(graph)
|
|
126
126
|
};
|
|
127
127
|
if (graph.children) {
|
|
128
|
-
elkGraph.children = this.findChildren(graph,
|
|
128
|
+
elkGraph.children = this.findChildren(graph, server_1.GNode).map(child => this.transformToElk(child));
|
|
129
129
|
elkGraph.edges = [];
|
|
130
|
-
this.elkEdges.push(...this.findChildren(graph,
|
|
130
|
+
this.elkEdges.push(...this.findChildren(graph, server_1.GEdge).map(child => this.transformToElk(child)));
|
|
131
131
|
}
|
|
132
132
|
this.idToElkElement.set(graph.id, elkGraph);
|
|
133
133
|
return elkGraph;
|
|
@@ -138,11 +138,11 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
138
138
|
layoutOptions: this.configurator.apply(node)
|
|
139
139
|
};
|
|
140
140
|
if (node.children) {
|
|
141
|
-
elkNode.children = this.findChildren(node,
|
|
141
|
+
elkNode.children = this.findChildren(node, server_1.GNode).map(child => this.transformToElk(child));
|
|
142
142
|
elkNode.edges = [];
|
|
143
|
-
this.elkEdges.push(...this.findChildren(node,
|
|
144
|
-
elkNode.labels = this.findChildren(node,
|
|
145
|
-
elkNode.ports = this.findChildren(node,
|
|
143
|
+
this.elkEdges.push(...this.findChildren(node, server_1.GEdge).map(child => this.transformToElk(child)));
|
|
144
|
+
elkNode.labels = this.findChildren(node, server_1.GLabel).map(child => this.transformToElk(child));
|
|
145
|
+
elkNode.ports = this.findChildren(node, server_1.GPort).map(child => this.transformToElk(child));
|
|
146
146
|
}
|
|
147
147
|
this.transformShape(elkNode, node);
|
|
148
148
|
this.idToElkElement.set(node.id, elkNode);
|
|
@@ -166,23 +166,23 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
166
166
|
layoutOptions: this.configurator.apply(edge)
|
|
167
167
|
};
|
|
168
168
|
const sourceElement = this.modelState.index.get(edge.sourceId);
|
|
169
|
-
if (sourceElement instanceof
|
|
170
|
-
const parentNode = (0,
|
|
169
|
+
if (sourceElement instanceof server_1.GPort) {
|
|
170
|
+
const parentNode = (0, server_1.findParentByClass)(sourceElement, server_1.GNode);
|
|
171
171
|
if (parentNode) {
|
|
172
172
|
elkEdge.source = parentNode.id;
|
|
173
173
|
elkEdge.sourcePort = sourceElement.id;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
const targetElement = this.modelState.index.get(edge.targetId);
|
|
177
|
-
if (sourceElement instanceof
|
|
178
|
-
const parentNode = (0,
|
|
177
|
+
if (sourceElement instanceof server_1.GPort) {
|
|
178
|
+
const parentNode = (0, server_1.findParentByClass)(targetElement, server_1.GNode);
|
|
179
179
|
if (parentNode) {
|
|
180
180
|
elkEdge.target = parentNode.id;
|
|
181
181
|
elkEdge.targetPort = targetElement.id;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
if (edge.children) {
|
|
185
|
-
elkEdge.labels = this.findChildren(edge,
|
|
185
|
+
elkEdge.labels = this.findChildren(edge, server_1.GLabel).map(child => this.transformToElk(child));
|
|
186
186
|
}
|
|
187
187
|
const points = edge.routingPoints;
|
|
188
188
|
if (points && points.length >= 2) {
|
|
@@ -209,8 +209,8 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
209
209
|
layoutOptions: this.configurator.apply(port)
|
|
210
210
|
};
|
|
211
211
|
if (port.children) {
|
|
212
|
-
elkPort.labels = this.findChildren(port,
|
|
213
|
-
this.elkEdges.push(...this.findChildren(port,
|
|
212
|
+
elkPort.labels = this.findChildren(port, server_1.GLabel).map(child => this.transformToElk(child));
|
|
213
|
+
this.elkEdges.push(...this.findChildren(port, server_1.GEdge).map(child => this.transformToElk(child)));
|
|
214
214
|
}
|
|
215
215
|
this.transformShape(elkPort, port);
|
|
216
216
|
this.idToElkElement.set(port.id, elkPort);
|
|
@@ -218,7 +218,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
218
218
|
}
|
|
219
219
|
applyLayout(elkNode) {
|
|
220
220
|
const element = this.modelState.index.get(elkNode.id);
|
|
221
|
-
if (element instanceof
|
|
221
|
+
if (element instanceof server_1.GNode) {
|
|
222
222
|
this.applyShape(element, elkNode);
|
|
223
223
|
}
|
|
224
224
|
if (elkNode.children) {
|
|
@@ -229,14 +229,14 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
229
229
|
if (elkNode.edges) {
|
|
230
230
|
for (const elkEdge of elkNode.edges) {
|
|
231
231
|
const edge = this.modelState.index.get(elkEdge.id);
|
|
232
|
-
if (edge instanceof
|
|
232
|
+
if (edge instanceof server_1.GEdge) {
|
|
233
233
|
this.applyEdge(edge, elkEdge);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
if (elkNode.ports) {
|
|
238
238
|
for (const elkPort of elkNode.ports) {
|
|
239
|
-
const port = this.modelState.index.findByClass(elkPort.id,
|
|
239
|
+
const port = this.modelState.index.findByClass(elkPort.id, server_1.GPort);
|
|
240
240
|
if (port) {
|
|
241
241
|
this.applyShape(port, elkPort);
|
|
242
242
|
}
|
|
@@ -252,7 +252,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
252
252
|
}
|
|
253
253
|
if (elkShape.labels) {
|
|
254
254
|
for (const elkLabel of elkShape.labels) {
|
|
255
|
-
const label = this.modelState.index.findByClass(elkLabel.id,
|
|
255
|
+
const label = this.modelState.index.findByClass(elkLabel.id, server_1.GLabel);
|
|
256
256
|
if (label) {
|
|
257
257
|
this.applyShape(label, elkLabel);
|
|
258
258
|
}
|
|
@@ -288,7 +288,7 @@ let GlspElkLayoutEngine = class GlspElkLayoutEngine {
|
|
|
288
288
|
edge.routingPoints = points;
|
|
289
289
|
if (elkEdge.labels) {
|
|
290
290
|
elkEdge.labels.forEach(elkLabel => {
|
|
291
|
-
const label = this.modelState.index.findByClass(elkLabel.id,
|
|
291
|
+
const label = this.modelState.index.findByClass(elkLabel.id, server_1.GLabel);
|
|
292
292
|
if (label) {
|
|
293
293
|
this.applyShape(label, elkLabel);
|
|
294
294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-elk-layout-engine.js","sourceRoot":"","sources":["../src/glsp-elk-layout-engine.ts"],"names":[],"mappings":";;;;;;;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,UAAU,EAAE;gBACpB,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;aACtC;YACD,IAAI,OAAO,CAAC,WAAW,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aACpC;SACJ;QACD,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAE5B,IAAI,OAAO,CAAC,MAAM,EAAE;YAChB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,eAAM,CAAC,CAAC;gBACrE,IAAI,KAAK,EAAE;oBACP,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;iBACpC;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC;CACJ,CAAA;AAjSY,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;;GACA,mBAAmB,CAiS/B;AAjSY,kDAAmB"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,8CAA4B;AAC5B,mDAAiC;AACjC,2DAAyC;AACzC,wDAAsC;AACtC,gDAA8B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GEdge, GGraph, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server
|
|
16
|
+
import { GEdge, GGraph, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server';
|
|
17
17
|
import { LayoutOptions } from './sprotty-elk';
|
|
18
18
|
export declare const LayoutConfigurator: unique symbol;
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-configurator.d.ts","sourceRoot":"","sources":["../src/layout-configurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"layout-configurator.d.ts","sourceRoot":"","sources":["../src/layout-configurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtG,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC;CAC5D;AAED;;;;GAIG;AACH,8BACsB,0BAA2B,YAAW,kBAAkB;IAE1E,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,GAAG,SAAS;IAexD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIhE,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,SAAS;IAI7D,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,SAAS;IAI7D,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIhE,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,GAAG,SAAS;CAGjE;AAED;;;;;GAKG;AACH,qBACa,0BAA2B,SAAQ,0BAA0B;IACtE,SAAS,CAAC,oBAAoB,EAAE,aAAa,CAAC;gBAClC,UAAU,EAAE,MAAM,EAAE,EAAE,oBAAoB,GAAE,aAAkB;cAQvD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;CAG7E"}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FallbackLayoutConfigurator = exports.AbstractLayoutConfigurator = exports.LayoutConfigurator = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
14
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
15
15
|
*
|
|
16
16
|
* This program and the accompanying materials are made available under the
|
|
17
17
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -25,7 +25,7 @@ exports.FallbackLayoutConfigurator = exports.AbstractLayoutConfigurator = export
|
|
|
25
25
|
*
|
|
26
26
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
27
|
********************************************************************************/
|
|
28
|
-
const
|
|
28
|
+
const server_1 = require("@eclipse-glsp/server");
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
30
|
exports.LayoutConfigurator = Symbol('LayoutConfigurator');
|
|
31
31
|
/**
|
|
@@ -35,19 +35,19 @@ exports.LayoutConfigurator = Symbol('LayoutConfigurator');
|
|
|
35
35
|
*/
|
|
36
36
|
let AbstractLayoutConfigurator = class AbstractLayoutConfigurator {
|
|
37
37
|
apply(element) {
|
|
38
|
-
if (element instanceof
|
|
38
|
+
if (element instanceof server_1.GGraph) {
|
|
39
39
|
return this.graphOptions(element);
|
|
40
40
|
}
|
|
41
|
-
else if (element instanceof
|
|
41
|
+
else if (element instanceof server_1.GNode) {
|
|
42
42
|
return this.nodeOptions(element);
|
|
43
43
|
}
|
|
44
|
-
else if (element instanceof
|
|
44
|
+
else if (element instanceof server_1.GEdge) {
|
|
45
45
|
return this.edgeOptions(element);
|
|
46
46
|
}
|
|
47
|
-
else if (element instanceof
|
|
47
|
+
else if (element instanceof server_1.GLabel) {
|
|
48
48
|
this.labelOptions(element);
|
|
49
49
|
}
|
|
50
|
-
else if (element instanceof
|
|
50
|
+
else if (element instanceof server_1.GPort) {
|
|
51
51
|
this.portOptions(element);
|
|
52
52
|
}
|
|
53
53
|
return undefined;
|
|
@@ -69,7 +69,7 @@ let AbstractLayoutConfigurator = class AbstractLayoutConfigurator {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
__decorate([
|
|
72
|
-
(0, inversify_1.inject)(
|
|
72
|
+
(0, inversify_1.inject)(server_1.ModelState),
|
|
73
73
|
__metadata("design:type", Object)
|
|
74
74
|
], AbstractLayoutConfigurator.prototype, "modelState", void 0);
|
|
75
75
|
AbstractLayoutConfigurator = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-configurator.js","sourceRoot":"","sources":["../src/layout-configurator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"layout-configurator.js","sourceRoot":"","sources":["../src/layout-configurator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAAsG;AACtG,yCAA+C;AAGlC,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAe/D;;;;GAIG;AAEI,IAAe,0BAA0B,GAAzC,MAAe,0BAA0B;IAI5C,KAAK,CAAC,OAAsB;QACxB,IAAI,OAAO,YAAY,eAAM,EAAE;YAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACrC;aAAM,IAAI,OAAO,YAAY,cAAK,EAAE;YACjC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SACpC;aAAM,IAAI,OAAO,YAAY,cAAK,EAAE;YACjC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SACpC;aAAM,IAAI,OAAO,YAAY,eAAM,EAAE;YAClC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SAC9B;aAAM,IAAI,OAAO,YAAY,cAAK,EAAE;YACjC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC7B;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,YAAY,CAAC,KAAa;QAChC,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,WAAW,CAAC,IAAW;QAC7B,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,WAAW,CAAC,IAAW;QAC7B,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,YAAY,CAAC,KAAa;QAChC,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,WAAW,CAAC,KAAY;QAC9B,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAA;AArCG;IAAC,IAAA,kBAAM,EAAC,mBAAU,CAAC;;8DACc;AAFf,0BAA0B;IAD/C,IAAA,sBAAU,GAAE;GACS,0BAA0B,CAsC/C;AAtCqB,gEAA0B;AAwChD;;;;;GAKG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,0BAA0B;IAEtE,YAAY,UAAoB,EAAE,uBAAsC,EAAE;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,oBAAoB,mBACrB,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,IAC3B,oBAAoB,CAC1B,CAAC;IACN,CAAC;IAEkB,YAAY,CAAC,MAAc;QAC1C,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;CACJ,CAAA;AAbY,0BAA0B;IADtC,IAAA,sBAAU,GAAE;;GACA,0BAA0B,CAatC;AAbY,gEAA0B"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/layout-elk",
|
|
3
|
-
"version": "1.1.0-next.
|
|
3
|
+
"version": "1.1.0-next.f692ea4.55+f692ea4",
|
|
4
4
|
"description": "Integration of ELK graph layout algorithms in GLSP Node Server",
|
|
5
|
-
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"eclipse",
|
|
8
7
|
"graphics",
|
|
@@ -12,15 +11,16 @@
|
|
|
12
11
|
"glsp",
|
|
13
12
|
"diagram editor"
|
|
14
13
|
],
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "Eclipse GLSP"
|
|
17
|
-
},
|
|
18
14
|
"homepage": "https://www.eclipse.org/glsp/",
|
|
15
|
+
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
19
16
|
"repository": {
|
|
20
17
|
"type": "git",
|
|
21
18
|
"url": "https://github.com/eclipse-glsp/glsp-server-node.git"
|
|
22
19
|
},
|
|
23
|
-
"
|
|
20
|
+
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Eclipse GLSP"
|
|
23
|
+
},
|
|
24
24
|
"contributors": [
|
|
25
25
|
{
|
|
26
26
|
"name": "STMicroelectronics",
|
|
@@ -32,33 +32,30 @@
|
|
|
32
32
|
"url": "https://projects.eclipse.org/projects/ecd.glsp"
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
|
+
"main": "lib/index",
|
|
36
|
+
"types": "lib/index",
|
|
35
37
|
"files": [
|
|
36
38
|
"lib",
|
|
37
|
-
"src"
|
|
38
|
-
"css"
|
|
39
|
+
"src"
|
|
39
40
|
],
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@eclipse-glsp/server-node": "1.1.0-next.e0d359d.30+e0d359d",
|
|
42
|
-
"elkjs": "^0.7.1",
|
|
43
|
-
"sprotty-elk": "0.12.0"
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"inversify": "^5.1.1"
|
|
47
|
-
},
|
|
48
41
|
"scripts": {
|
|
49
|
-
"
|
|
50
|
-
"clean": "rimraf tsconfig.tsbuildinfo
|
|
51
|
-
"build": "tsc",
|
|
52
|
-
"test": "mocha --config ../../.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
|
|
53
|
-
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
|
|
42
|
+
"build": "tsc -b",
|
|
43
|
+
"clean": "rimraf lib tsconfig.tsbuildinfo coverage .nyc_output",
|
|
54
44
|
"lint": "eslint --ext .ts,.tsx ./src",
|
|
55
|
-
"lint:
|
|
45
|
+
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
|
|
46
|
+
"prepare": "yarn clean && yarn build",
|
|
47
|
+
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
|
|
48
|
+
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
|
|
49
|
+
"test:coverage": "nyc yarn test",
|
|
56
50
|
"watch": "tsc -w"
|
|
57
51
|
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@eclipse-glsp/server": "1.1.0-next.f692ea4.55+f692ea4",
|
|
54
|
+
"elkjs": "^0.7.1",
|
|
55
|
+
"sprotty-elk": "0.12.0"
|
|
56
|
+
},
|
|
58
57
|
"publishConfig": {
|
|
59
58
|
"access": "public"
|
|
60
59
|
},
|
|
61
|
-
"
|
|
62
|
-
"types": "lib/index",
|
|
63
|
-
"gitHead": "e0d359d747a9d89190c4eb0c95057570095c5f2d"
|
|
60
|
+
"gitHead": "f692ea4c66ddb29f09e8f76738a4a0b63fdf96d8"
|
|
64
61
|
}
|
package/src/di.config.spec.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,15 +13,22 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
DefaultModelState,
|
|
18
|
+
DiagramConfiguration,
|
|
19
|
+
EdgeTypeHint,
|
|
20
|
+
GGraph,
|
|
21
|
+
GModelElementConstructor,
|
|
22
|
+
ModelState,
|
|
23
|
+
ServerLayoutKind,
|
|
24
|
+
ShapeTypeHint
|
|
25
|
+
} from '@eclipse-glsp/server';
|
|
18
26
|
import { expect } from 'chai';
|
|
19
27
|
import { Container, ContainerModule, injectable } from 'inversify';
|
|
20
28
|
import * as sinon from 'sinon';
|
|
21
|
-
import { AbstractLayoutConfigurator } from '.';
|
|
22
29
|
import { configureELKLayoutModule } from './di.config';
|
|
23
30
|
import { DefaultElementFilter, ElementFilter } from './element-filter';
|
|
24
|
-
import { FallbackLayoutConfigurator, LayoutConfigurator } from './layout-configurator';
|
|
31
|
+
import { AbstractLayoutConfigurator, FallbackLayoutConfigurator, LayoutConfigurator } from './layout-configurator';
|
|
25
32
|
|
|
26
33
|
@injectable()
|
|
27
34
|
class CustomLayoutConfigurator extends AbstractLayoutConfigurator {}
|
|
@@ -29,6 +36,20 @@ class CustomLayoutConfigurator extends AbstractLayoutConfigurator {}
|
|
|
29
36
|
@injectable()
|
|
30
37
|
class CustomElementFilter extends DefaultElementFilter {}
|
|
31
38
|
|
|
39
|
+
class StubDiagramConfiguration implements DiagramConfiguration {
|
|
40
|
+
typeMapping = new Map<string, GModelElementConstructor>();
|
|
41
|
+
|
|
42
|
+
shapeTypeHints: ShapeTypeHint[] = [];
|
|
43
|
+
|
|
44
|
+
edgeTypeHints: EdgeTypeHint[] = [];
|
|
45
|
+
|
|
46
|
+
layoutKind = ServerLayoutKind.NONE;
|
|
47
|
+
|
|
48
|
+
needsClientLayout = true;
|
|
49
|
+
|
|
50
|
+
animatedUpdate = true;
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
describe('test configureELKLayoutModule', () => {
|
|
33
54
|
const sandbox = sinon.createSandbox();
|
|
34
55
|
const mockDiagramConfiguration = new StubDiagramConfiguration();
|
package/src/di.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { LayoutEngine, ModelState } from '@eclipse-glsp/server
|
|
16
|
+
import { LayoutEngine, ModelState } from '@eclipse-glsp/server';
|
|
17
17
|
import ElkConstructor, { LayoutOptions } from 'elkjs/lib/elk.bundled';
|
|
18
18
|
import { ContainerModule } from 'inversify';
|
|
19
19
|
import { ElkFactory } from 'sprotty-elk';
|
|
20
|
-
import {
|
|
21
|
-
import { DefaultElementFilter } from './element-filter';
|
|
20
|
+
import { DefaultElementFilter, ElementFilter } from './element-filter';
|
|
22
21
|
import { GlspElkLayoutEngine } from './glsp-elk-layout-engine';
|
|
23
|
-
import { FallbackLayoutConfigurator } from './layout-configurator';
|
|
22
|
+
import { FallbackLayoutConfigurator, LayoutConfigurator } from './layout-configurator';
|
|
24
23
|
|
|
25
24
|
type Constructor<T> = new (...args: any[]) => T;
|
|
26
25
|
|
package/src/element-filter.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GEdge, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server
|
|
16
|
+
import { GEdge, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
|
|
19
19
|
export const ElementFilter = Symbol('ElementFilter');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2023 TypeFox and others.
|
|
3
3
|
* This program and the accompanying materials are made available under the
|
|
4
4
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
5
5
|
* http://www.eclipse.org/legal/epl-2.0.
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
MaybePromise,
|
|
30
30
|
ModelState,
|
|
31
31
|
Point
|
|
32
|
-
} from '@eclipse-glsp/server
|
|
32
|
+
} from '@eclipse-glsp/server';
|
|
33
33
|
import { ELK, ElkEdge, ElkExtendedEdge, ElkGraphElement, ElkLabel, ElkNode, ElkPort, ElkPrimitiveEdge, ElkShape } from 'elkjs/lib/elk-api';
|
|
34
34
|
import { injectable } from 'inversify';
|
|
35
35
|
import { ElkFactory } from 'sprotty-elk';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GEdge, GGraph, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server
|
|
16
|
+
import { GEdge, GGraph, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { LayoutOptions } from './sprotty-elk';
|
|
19
19
|
|
package/lib/di.config.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.spec.d.ts","sourceRoot":"","sources":["../src/di.config.spec.ts"],"names":[],"mappings":""}
|
package/lib/di.config.spec.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
/********************************************************************************
|
|
10
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
11
|
-
*
|
|
12
|
-
* This program and the accompanying materials are made available under the
|
|
13
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
14
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
15
|
-
*
|
|
16
|
-
* This Source Code may also be made available under the following Secondary
|
|
17
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
18
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
19
|
-
* with the GNU Classpath Exception which is available at
|
|
20
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
21
|
-
*
|
|
22
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
23
|
-
********************************************************************************/
|
|
24
|
-
const server_node_1 = require("@eclipse-glsp/server-node");
|
|
25
|
-
const mock_util_1 = require("@eclipse-glsp/server-node/lib/test/mock-util");
|
|
26
|
-
const chai_1 = require("chai");
|
|
27
|
-
const inversify_1 = require("inversify");
|
|
28
|
-
const sinon = require("sinon");
|
|
29
|
-
const _1 = require(".");
|
|
30
|
-
const di_config_1 = require("./di.config");
|
|
31
|
-
const element_filter_1 = require("./element-filter");
|
|
32
|
-
const layout_configurator_1 = require("./layout-configurator");
|
|
33
|
-
let CustomLayoutConfigurator = class CustomLayoutConfigurator extends _1.AbstractLayoutConfigurator {
|
|
34
|
-
};
|
|
35
|
-
CustomLayoutConfigurator = __decorate([
|
|
36
|
-
(0, inversify_1.injectable)()
|
|
37
|
-
], CustomLayoutConfigurator);
|
|
38
|
-
let CustomElementFilter = class CustomElementFilter extends element_filter_1.DefaultElementFilter {
|
|
39
|
-
};
|
|
40
|
-
CustomElementFilter = __decorate([
|
|
41
|
-
(0, inversify_1.injectable)()
|
|
42
|
-
], CustomElementFilter);
|
|
43
|
-
describe('test configureELKLayoutModule', () => {
|
|
44
|
-
const sandbox = sinon.createSandbox();
|
|
45
|
-
const mockDiagramConfiguration = new mock_util_1.StubDiagramConfiguration();
|
|
46
|
-
const typeMappings = new Map();
|
|
47
|
-
typeMappings.set('graph', server_node_1.GGraph);
|
|
48
|
-
sandbox.stub(mockDiagramConfiguration, 'typeMapping').value(typeMappings);
|
|
49
|
-
const modelState = new server_node_1.DefaultModelState();
|
|
50
|
-
const baseModule = new inversify_1.ContainerModule(bind => {
|
|
51
|
-
bind(server_node_1.ModelState).toConstantValue(modelState);
|
|
52
|
-
});
|
|
53
|
-
it('configure with minimal options', () => {
|
|
54
|
-
const algorithm = 'layered';
|
|
55
|
-
const elkModule = (0, di_config_1.configureELKLayoutModule)({ algorithms: [algorithm] });
|
|
56
|
-
const container = new inversify_1.Container();
|
|
57
|
-
container.load(baseModule, elkModule);
|
|
58
|
-
const filter = container.get(element_filter_1.ElementFilter);
|
|
59
|
-
(0, chai_1.expect)(filter).to.be.an.instanceOf(element_filter_1.DefaultElementFilter);
|
|
60
|
-
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
61
|
-
(0, chai_1.expect)(configurator).to.be.an.instanceOf(layout_configurator_1.FallbackLayoutConfigurator);
|
|
62
|
-
const graphOptions = configurator.apply(new server_node_1.GGraph());
|
|
63
|
-
(0, chai_1.expect)(graphOptions).not.to.be.undefined;
|
|
64
|
-
(0, chai_1.expect)(graphOptions['elk.algorithm']).to.equal(algorithm);
|
|
65
|
-
});
|
|
66
|
-
it('configure with additional default layout options', () => {
|
|
67
|
-
const algorithm = 'layered';
|
|
68
|
-
const defaultLayoutOptions = {
|
|
69
|
-
'elk.direction': 'LEFT',
|
|
70
|
-
'elk.edgeRouting': 'POLYLINE'
|
|
71
|
-
};
|
|
72
|
-
const elkModule = (0, di_config_1.configureELKLayoutModule)({ algorithms: [algorithm], defaultLayoutOptions });
|
|
73
|
-
const container = new inversify_1.Container();
|
|
74
|
-
container.load(baseModule, elkModule);
|
|
75
|
-
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
76
|
-
const graphOptions = configurator.apply(new server_node_1.GGraph());
|
|
77
|
-
(0, chai_1.expect)(graphOptions).not.to.be.undefined;
|
|
78
|
-
(0, chai_1.expect)(graphOptions).to.include(defaultLayoutOptions);
|
|
79
|
-
});
|
|
80
|
-
it('configure with custom layout configurator', () => {
|
|
81
|
-
const algorithm = 'layered';
|
|
82
|
-
const elkModule = (0, di_config_1.configureELKLayoutModule)({ algorithms: [algorithm], layoutConfigurator: CustomLayoutConfigurator });
|
|
83
|
-
const container = new inversify_1.Container();
|
|
84
|
-
container.load(baseModule, elkModule);
|
|
85
|
-
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
86
|
-
(0, chai_1.expect)(configurator).to.be.an.instanceOf(CustomLayoutConfigurator);
|
|
87
|
-
});
|
|
88
|
-
it('configure with custom element filter', () => {
|
|
89
|
-
const algorithm = 'layered';
|
|
90
|
-
const elkModule = (0, di_config_1.configureELKLayoutModule)({ algorithms: [algorithm], elementFilter: CustomElementFilter });
|
|
91
|
-
const container = new inversify_1.Container();
|
|
92
|
-
container.load(baseModule, elkModule);
|
|
93
|
-
const filter = container.get(element_filter_1.ElementFilter);
|
|
94
|
-
(0, chai_1.expect)(filter).to.be.an.instanceOf(CustomElementFilter);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=di.config.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.spec.js","sourceRoot":"","sources":["../src/di.config.spec.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAA4G;AAC5G,4EAAwF;AACxF,+BAA8B;AAC9B,yCAAmE;AACnE,+BAA+B;AAC/B,wBAA+C;AAC/C,2CAAuD;AACvD,qDAAuE;AACvE,+DAAuF;AAGvF,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,6BAA0B;CAAG,CAAA;AAA9D,wBAAwB;IAD7B,IAAA,sBAAU,GAAE;GACP,wBAAwB,CAAsC;AAGpE,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,qCAAoB;CAAG,CAAA;AAAnD,mBAAmB;IADxB,IAAA,sBAAU,GAAE;GACP,mBAAmB,CAAgC;AAEzD,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IACtC,MAAM,wBAAwB,GAAG,IAAI,oCAAwB,EAAE,CAAC;IAChE,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoC,CAAC;IAEjE,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,oBAAM,CAAC,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAG,IAAI,+BAAiB,EAAE,CAAC;IAC3C,MAAM,UAAU,GAAG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