@eclipse-glsp/layout-elk 0.9.0-next.66aad6e.3 → 0.9.0-next.95961ba.7
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 +7 -13
- package/lib/di.config.d.ts.map +1 -1
- package/lib/di.config.js +20 -32
- package/lib/di.config.js.map +1 -1
- package/lib/di.config.spec.js +13 -16
- package/lib/di.config.spec.js.map +1 -1
- package/lib/element-filter.d.ts +45 -0
- package/lib/element-filter.d.ts.map +1 -0
- package/lib/element-filter.js +84 -0
- package/lib/element-filter.js.map +1 -0
- package/lib/glsp-elk-layout-engine.d.ts +34 -20
- package/lib/glsp-elk-layout-engine.d.ts.map +1 -1
- package/lib/glsp-elk-layout-engine.js +265 -42
- package/lib/glsp-elk-layout-engine.js.map +1 -1
- package/lib/index.d.ts +4 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -7
- package/lib/index.js.map +1 -1
- package/lib/{glsp-layout-configurator.d.ts → layout-configurator.d.ts} +29 -15
- package/lib/layout-configurator.d.ts.map +1 -0
- package/lib/layout-configurator.js +99 -0
- package/lib/layout-configurator.js.map +1 -0
- package/lib/{basic-type-mapper.d.ts → sprotty-elk.d.ts} +3 -11
- package/lib/sprotty-elk.d.ts.map +1 -0
- package/lib/sprotty-elk.js +5 -0
- package/lib/sprotty-elk.js.map +1 -0
- package/package.json +3 -3
- package/src/di.config.spec.ts +15 -18
- package/src/di.config.ts +29 -42
- package/src/element-filter.ts +84 -0
- package/src/glsp-elk-layout-engine.ts +305 -30
- package/src/index.ts +4 -6
- package/src/layout-configurator.ts +101 -0
- package/src/sprotty-elk.ts +18 -0
- package/lib/basic-type-mapper.d.ts.map +0 -1
- package/lib/basic-type-mapper.js +0 -97
- package/lib/basic-type-mapper.js.map +0 -1
- package/lib/glsp-element-filter.d.ts +0 -17
- package/lib/glsp-element-filter.d.ts.map +0 -1
- package/lib/glsp-element-filter.js +0 -53
- package/lib/glsp-element-filter.js.map +0 -1
- package/lib/glsp-layout-configurator.d.ts.map +0 -1
- package/lib/glsp-layout-configurator.js +0 -57
- package/lib/glsp-layout-configurator.js.map +0 -1
- package/src/basic-type-mapper.ts +0 -73
- package/src/glsp-element-filter.ts +0 -38
- package/src/glsp-layout-configurator.ts +0 -59
package/lib/di.config.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LayoutOptions } from 'elkjs/lib/elk.bundled';
|
|
2
2
|
import { ContainerModule } from 'inversify';
|
|
3
|
-
import {
|
|
4
|
-
import { GlspLayoutConfigurator } from './glsp-layout-configurator';
|
|
3
|
+
import { ElementFilter, LayoutConfigurator } from '.';
|
|
5
4
|
declare type Constructor<T> = new (...args: any[]) => T;
|
|
6
5
|
/**
|
|
7
6
|
* Configuration options for the {@link configureELKLayoutModule} function.
|
|
@@ -17,15 +16,15 @@ export interface ElkModuleOptions {
|
|
|
17
16
|
*/
|
|
18
17
|
defaultLayoutOptions?: LayoutOptions;
|
|
19
18
|
/**
|
|
20
|
-
* The custom {@link
|
|
21
|
-
* the {@link
|
|
19
|
+
* The custom {@link LayoutConfigurator} class that should be bound. If this option is not set
|
|
20
|
+
* the {@link FallbackLayoutConfigurator} is bound instead.
|
|
22
21
|
*/
|
|
23
|
-
layoutConfigurator?: Constructor<
|
|
22
|
+
layoutConfigurator?: Constructor<LayoutConfigurator>;
|
|
24
23
|
/**
|
|
25
|
-
* The custom {@link
|
|
24
|
+
* The custom {@link ElementFilter} class that should be bound. If this option is not set, the default implementation
|
|
26
25
|
* is bound.
|
|
27
26
|
*/
|
|
28
|
-
elementFilter?: Constructor<
|
|
27
|
+
elementFilter?: Constructor<ElementFilter>;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Utility method to create a DI module that provides all necessary bindings to use the {@link GlspElkLayoutEngine} in a node GLSP server
|
|
@@ -35,13 +34,8 @@ export interface ElkModuleOptions {
|
|
|
35
34
|
* The constructed module is not intended for standalone use cases and only works in combination with a GLSPDiagramModule.
|
|
36
35
|
*
|
|
37
36
|
* * The following bindings are provided:
|
|
38
|
-
* - {@link BasicTypeMapper}
|
|
39
|
-
* - {@link BaseElkLayoutEngine}
|
|
40
|
-
* - {@link ElkLayoutEngine}
|
|
41
|
-
* - {@link GlspElementFilter}
|
|
42
|
-
* - {@link IElementFilter}
|
|
43
|
-
* - {@link GlspLayoutConfigurator}
|
|
44
37
|
* - {@link ILayoutConfigurator}
|
|
38
|
+
* - {@link IElementFilter}
|
|
45
39
|
* - {@link LayoutEngine}
|
|
46
40
|
* - {@link ElkFactory}
|
|
47
41
|
*
|
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;
|
|
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,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAKtD,aAAK,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
|
@@ -16,15 +16,14 @@ 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 server_node_1 = require("@eclipse-glsp/server-node
|
|
19
|
+
const server_node_1 = require("@eclipse-glsp/server-node");
|
|
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
23
|
const _1 = require(".");
|
|
24
|
-
const
|
|
25
|
-
const glsp_element_filter_1 = require("./glsp-element-filter");
|
|
24
|
+
const element_filter_1 = require("./element-filter");
|
|
26
25
|
const glsp_elk_layout_engine_1 = require("./glsp-elk-layout-engine");
|
|
27
|
-
const
|
|
26
|
+
const layout_configurator_1 = require("./layout-configurator");
|
|
28
27
|
/**
|
|
29
28
|
* Utility method to create a DI module that provides all necessary bindings to use the {@link GlspElkLayoutEngine} in a node GLSP server
|
|
30
29
|
* implementation. A set of configuration options is provided to enable easy customization. In most cases at least
|
|
@@ -33,13 +32,8 @@ const glsp_layout_configurator_1 = require("./glsp-layout-configurator");
|
|
|
33
32
|
* The constructed module is not intended for standalone use cases and only works in combination with a GLSPDiagramModule.
|
|
34
33
|
*
|
|
35
34
|
* * The following bindings are provided:
|
|
36
|
-
* - {@link BasicTypeMapper}
|
|
37
|
-
* - {@link BaseElkLayoutEngine}
|
|
38
|
-
* - {@link ElkLayoutEngine}
|
|
39
|
-
* - {@link GlspElementFilter}
|
|
40
|
-
* - {@link IElementFilter}
|
|
41
|
-
* - {@link GlspLayoutConfigurator}
|
|
42
35
|
* - {@link ILayoutConfigurator}
|
|
36
|
+
* - {@link IElementFilter}
|
|
43
37
|
* - {@link LayoutEngine}
|
|
44
38
|
* - {@link ElkFactory}
|
|
45
39
|
*
|
|
@@ -48,42 +42,36 @@ const glsp_layout_configurator_1 = require("./glsp-layout-configurator");
|
|
|
48
42
|
*/
|
|
49
43
|
function configureELKLayoutModule(options) {
|
|
50
44
|
return new inversify_1.ContainerModule(bind => {
|
|
51
|
-
bind(basic_type_mapper_1.BasicTypeMapper).toSelf().inSingletonScope();
|
|
52
|
-
bind(glsp_elk_layout_engine_1.BaseElkLayoutEngine)
|
|
53
|
-
.toDynamicValue(context => {
|
|
54
|
-
const elkFactory = context.container.get(sprotty_elk_1.ElkFactory);
|
|
55
|
-
const elementFilter = context.container.get(sprotty_elk_1.IElementFilter);
|
|
56
|
-
const layoutConfigurator = context.container.get(sprotty_elk_1.ILayoutConfigurator);
|
|
57
|
-
const typeMapper = context.container.get(basic_type_mapper_1.BasicTypeMapper);
|
|
58
|
-
return new glsp_elk_layout_engine_1.BaseElkLayoutEngine(elkFactory, elementFilter, layoutConfigurator, typeMapper);
|
|
59
|
-
})
|
|
60
|
-
.inSingletonScope();
|
|
61
|
-
bind(sprotty_elk_1.ElkLayoutEngine).to(glsp_elk_layout_engine_1.BaseElkLayoutEngine);
|
|
62
45
|
if (options.elementFilter) {
|
|
63
|
-
bind(
|
|
46
|
+
bind(_1.ElementFilter).to(options.elementFilter).inSingletonScope();
|
|
64
47
|
}
|
|
65
48
|
else {
|
|
66
|
-
bind(
|
|
49
|
+
bind(_1.ElementFilter).to(element_filter_1.DefaultElementFilter).inSingletonScope();
|
|
67
50
|
}
|
|
68
|
-
bind(sprotty_elk_1.IElementFilter).toService(glsp_element_filter_1.GlspElementFilter);
|
|
69
51
|
if (options.layoutConfigurator) {
|
|
70
|
-
bind(
|
|
52
|
+
bind(_1.LayoutConfigurator).to(options.layoutConfigurator);
|
|
71
53
|
}
|
|
72
54
|
else {
|
|
73
|
-
bind(
|
|
74
|
-
.toDynamicValue(context =>
|
|
75
|
-
const typeMapper = context.container.get(basic_type_mapper_1.BasicTypeMapper);
|
|
76
|
-
return new glsp_layout_configurator_1.FallbackGlspLayoutConfigurator(typeMapper, options.algorithms, options.defaultLayoutOptions);
|
|
77
|
-
})
|
|
55
|
+
bind(_1.LayoutConfigurator)
|
|
56
|
+
.toDynamicValue(context => new layout_configurator_1.FallbackLayoutConfigurator(options.algorithms, options.defaultLayoutOptions))
|
|
78
57
|
.inSingletonScope();
|
|
79
58
|
}
|
|
80
|
-
bind(sprotty_elk_1.ILayoutConfigurator).toService(glsp_layout_configurator_1.GlspLayoutConfigurator);
|
|
81
|
-
bind(server_node_1.LayoutEngine).to(_1.GlspElkLayoutEngine).inSingletonScope();
|
|
82
59
|
const elkFactory = () => new elk_bundled_1.default({
|
|
83
60
|
algorithms: options.algorithms,
|
|
84
61
|
defaultLayoutOptions: options.defaultLayoutOptions
|
|
85
62
|
});
|
|
86
63
|
bind(sprotty_elk_1.ElkFactory).toConstantValue(elkFactory);
|
|
64
|
+
bind(glsp_elk_layout_engine_1.GlspElkLayoutEngine)
|
|
65
|
+
.toDynamicValue(context => {
|
|
66
|
+
const container = context.container;
|
|
67
|
+
const factory = container.get(sprotty_elk_1.ElkFactory);
|
|
68
|
+
const filter = container.get(_1.ElementFilter);
|
|
69
|
+
const configurator = container.get(_1.LayoutConfigurator);
|
|
70
|
+
const modelState = container.get(server_node_1.ModelState);
|
|
71
|
+
return new glsp_elk_layout_engine_1.GlspElkLayoutEngine(factory, filter, configurator, modelState);
|
|
72
|
+
})
|
|
73
|
+
.inSingletonScope();
|
|
74
|
+
bind(server_node_1.LayoutEngine).toService(glsp_elk_layout_engine_1.GlspElkLayoutEngine);
|
|
87
75
|
});
|
|
88
76
|
}
|
|
89
77
|
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":";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AE;YACtB,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACpC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAa,wBAAU,CAAC,CAAC;YACtD,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAgB,gBAAa,CAAC,CAAC;YAC3D,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAqB,qBAAkB,CAAC,CAAC;YAC3E,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAa,wBAAU,CAAC,CAAC;YACzD,OAAO,IAAI,4CAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAC9E,CAAC,CAAC;aACD,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,0BAAY,CAAC,CAAC,SAAS,CAAC,4CAAmB,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC;AApCD,4DAoCC"}
|
package/lib/di.config.spec.js
CHANGED
|
@@ -26,18 +26,16 @@ const mock_util_1 = require("@eclipse-glsp/server-node/lib/test/mock-util");
|
|
|
26
26
|
const chai_1 = require("chai");
|
|
27
27
|
const inversify_1 = require("inversify");
|
|
28
28
|
const sinon = require("sinon");
|
|
29
|
-
const sprotty_elk_1 = require("sprotty-elk");
|
|
30
|
-
const sprotty_protocol_1 = require("sprotty-protocol");
|
|
31
29
|
const _1 = require(".");
|
|
32
30
|
const di_config_1 = require("./di.config");
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
let CustomLayoutConfigurator = class CustomLayoutConfigurator extends _1.
|
|
31
|
+
const element_filter_1 = require("./element-filter");
|
|
32
|
+
const layout_configurator_1 = require("./layout-configurator");
|
|
33
|
+
let CustomLayoutConfigurator = class CustomLayoutConfigurator extends _1.AbstractLayoutConfigurator {
|
|
36
34
|
};
|
|
37
35
|
CustomLayoutConfigurator = __decorate([
|
|
38
36
|
inversify_1.injectable()
|
|
39
37
|
], CustomLayoutConfigurator);
|
|
40
|
-
let CustomElementFilter = class CustomElementFilter extends
|
|
38
|
+
let CustomElementFilter = class CustomElementFilter extends element_filter_1.DefaultElementFilter {
|
|
41
39
|
};
|
|
42
40
|
CustomElementFilter = __decorate([
|
|
43
41
|
inversify_1.injectable()
|
|
@@ -50,7 +48,6 @@ describe('test configureELKLayoutModule', () => {
|
|
|
50
48
|
sandbox.stub(mockDiagramConfiguration, 'typeMapping').value(typeMappings);
|
|
51
49
|
const modelState = new server_node_1.DefaultModelState();
|
|
52
50
|
const baseModule = new inversify_1.ContainerModule(bind => {
|
|
53
|
-
bind(server_node_1.DiagramConfiguration).toConstantValue(mockDiagramConfiguration);
|
|
54
51
|
bind(server_node_1.ModelState).toConstantValue(modelState);
|
|
55
52
|
});
|
|
56
53
|
it('configure with minimal options', () => {
|
|
@@ -58,11 +55,11 @@ describe('test configureELKLayoutModule', () => {
|
|
|
58
55
|
const elkModule = di_config_1.configureELKLayoutModule({ algorithms: [algorithm] });
|
|
59
56
|
const container = new inversify_1.Container();
|
|
60
57
|
container.load(baseModule, elkModule);
|
|
61
|
-
const filter = container.get(
|
|
62
|
-
chai_1.expect(filter).to.be.instanceOf(
|
|
63
|
-
const configurator = container.get(
|
|
64
|
-
chai_1.expect(configurator).to.be.instanceOf(
|
|
65
|
-
const graphOptions = configurator.apply(new server_node_1.GGraph()
|
|
58
|
+
const filter = container.get(element_filter_1.ElementFilter);
|
|
59
|
+
chai_1.expect(filter).to.be.instanceOf(element_filter_1.DefaultElementFilter);
|
|
60
|
+
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
61
|
+
chai_1.expect(configurator).to.be.instanceOf(layout_configurator_1.FallbackLayoutConfigurator);
|
|
62
|
+
const graphOptions = configurator.apply(new server_node_1.GGraph());
|
|
66
63
|
chai_1.expect(graphOptions).not.to.be.undefined;
|
|
67
64
|
chai_1.expect(graphOptions['elk.algorithm']).to.equal(algorithm);
|
|
68
65
|
});
|
|
@@ -75,8 +72,8 @@ describe('test configureELKLayoutModule', () => {
|
|
|
75
72
|
const elkModule = di_config_1.configureELKLayoutModule({ algorithms: [algorithm], defaultLayoutOptions });
|
|
76
73
|
const container = new inversify_1.Container();
|
|
77
74
|
container.load(baseModule, elkModule);
|
|
78
|
-
const configurator = container.get(
|
|
79
|
-
const graphOptions = configurator.apply(new server_node_1.GGraph()
|
|
75
|
+
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
76
|
+
const graphOptions = configurator.apply(new server_node_1.GGraph());
|
|
80
77
|
chai_1.expect(graphOptions).not.to.be.undefined;
|
|
81
78
|
chai_1.expect(graphOptions).to.include(defaultLayoutOptions);
|
|
82
79
|
});
|
|
@@ -85,7 +82,7 @@ describe('test configureELKLayoutModule', () => {
|
|
|
85
82
|
const elkModule = di_config_1.configureELKLayoutModule({ algorithms: [algorithm], layoutConfigurator: CustomLayoutConfigurator });
|
|
86
83
|
const container = new inversify_1.Container();
|
|
87
84
|
container.load(baseModule, elkModule);
|
|
88
|
-
const configurator = container.get(
|
|
85
|
+
const configurator = container.get(layout_configurator_1.LayoutConfigurator);
|
|
89
86
|
chai_1.expect(configurator).to.be.instanceOf(CustomLayoutConfigurator);
|
|
90
87
|
});
|
|
91
88
|
it('configure with custom element filter', () => {
|
|
@@ -93,7 +90,7 @@ describe('test configureELKLayoutModule', () => {
|
|
|
93
90
|
const elkModule = di_config_1.configureELKLayoutModule({ algorithms: [algorithm], elementFilter: CustomElementFilter });
|
|
94
91
|
const container = new inversify_1.Container();
|
|
95
92
|
container.load(baseModule, elkModule);
|
|
96
|
-
const filter = container.get(
|
|
93
|
+
const filter = container.get(element_filter_1.ElementFilter);
|
|
97
94
|
chai_1.expect(filter).to.be.instanceOf(CustomElementFilter);
|
|
98
95
|
});
|
|
99
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.spec.js","sourceRoot":"","sources":["../src/di.config.spec.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|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CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2018-2022 TypeFox and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { GEdge, GLabel, GModelElement, GNode, GPort, ModelState } from '@eclipse-glsp/server-node';
|
|
17
|
+
export declare const ElementFilter: unique symbol;
|
|
18
|
+
/**
|
|
19
|
+
* Filter used to determine which model elements should be included in the automatic layout.
|
|
20
|
+
*/
|
|
21
|
+
export interface ElementFilter {
|
|
22
|
+
/**
|
|
23
|
+
* Applies the element filter on the given element,
|
|
24
|
+
* @param element The element on which the filter should be applied.
|
|
25
|
+
* @returns `true` if the element should be included in the automatic layout, `false` otherwise.
|
|
26
|
+
*/
|
|
27
|
+
apply(element: GModelElement): boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Default implementation of {@link ElementFilter}.
|
|
31
|
+
* Without further configuration this filter includes all basic model elements (nodes,edges,labels,ports) that are
|
|
32
|
+
* part of the graphical model. For each basic type a custom filter behavior is in place.
|
|
33
|
+
* Edges that have no source or target are filtered out. In addition, edges that are connected to a filtered element are filtered out
|
|
34
|
+
* as well. The filter behavior for each of the basic types can be customized by overriding the corresponding `filter` method.
|
|
35
|
+
* (e.g. {@link DefaultElementFilter.filterNode})
|
|
36
|
+
*/
|
|
37
|
+
export declare class DefaultElementFilter implements ElementFilter {
|
|
38
|
+
protected modelState: ModelState;
|
|
39
|
+
apply(element: GModelElement): boolean;
|
|
40
|
+
protected filterNode(node: GNode): boolean;
|
|
41
|
+
protected filterEdge(edge: GEdge): boolean;
|
|
42
|
+
protected filterLabel(label: GLabel): boolean;
|
|
43
|
+
protected filterPort(port: GPort): boolean;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=element-filter.d.ts.map
|
|
@@ -0,0 +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,2BAA2B,CAAC;AAGnG,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"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultElementFilter = exports.ElementFilter = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2018-2022 TypeFox and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const server_node_1 = require("@eclipse-glsp/server-node");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
exports.ElementFilter = Symbol('ElementFilter');
|
|
31
|
+
/**
|
|
32
|
+
* Default implementation of {@link ElementFilter}.
|
|
33
|
+
* Without further configuration this filter includes all basic model elements (nodes,edges,labels,ports) that are
|
|
34
|
+
* part of the graphical model. For each basic type a custom filter behavior is in place.
|
|
35
|
+
* Edges that have no source or target are filtered out. In addition, edges that are connected to a filtered element are filtered out
|
|
36
|
+
* as well. The filter behavior for each of the basic types can be customized by overriding the corresponding `filter` method.
|
|
37
|
+
* (e.g. {@link DefaultElementFilter.filterNode})
|
|
38
|
+
*/
|
|
39
|
+
let DefaultElementFilter = class DefaultElementFilter {
|
|
40
|
+
apply(element) {
|
|
41
|
+
if (element instanceof server_node_1.GNode) {
|
|
42
|
+
return this.filterNode(element);
|
|
43
|
+
}
|
|
44
|
+
else if (element instanceof server_node_1.GEdge) {
|
|
45
|
+
return this.filterEdge(element);
|
|
46
|
+
}
|
|
47
|
+
else if (element instanceof server_node_1.GLabel) {
|
|
48
|
+
this.filterLabel(element);
|
|
49
|
+
}
|
|
50
|
+
else if (element instanceof server_node_1.GPort) {
|
|
51
|
+
this.filterPort(element);
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
filterNode(node) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
filterEdge(edge) {
|
|
59
|
+
const source = this.modelState.index.get(edge.sourceId);
|
|
60
|
+
if (!source || (source instanceof server_node_1.GNode && !this.filterNode(source)) || (source instanceof server_node_1.GPort && !this.filterPort(source))) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const target = this.modelState.index.get(edge.targetId);
|
|
64
|
+
if (!target || (target instanceof server_node_1.GNode && !this.filterNode(target)) || (target instanceof server_node_1.GPort && !this.filterPort(target))) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
filterLabel(label) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
filterPort(port) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
__decorate([
|
|
77
|
+
inversify_1.inject(server_node_1.ModelState),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], DefaultElementFilter.prototype, "modelState", void 0);
|
|
80
|
+
DefaultElementFilter = __decorate([
|
|
81
|
+
inversify_1.injectable()
|
|
82
|
+
], DefaultElementFilter);
|
|
83
|
+
exports.DefaultElementFilter = DefaultElementFilter;
|
|
84
|
+
//# sourceMappingURL=element-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-filter.js","sourceRoot":"","sources":["../src/element-filter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAmG;AACnG,yCAA+C;AAElC,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAarD;;;;;;;GAOG;AAEH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAI7B,KAAK,CAAC,OAAsB;QACxB,IAAI,OAAO,YAAY,mBAAK,EAAE;YAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACnC;aAAM,IAAI,OAAO,YAAY,mBAAK,EAAE;YACjC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACnC;aAAM,IAAI,OAAO,YAAY,oBAAM,EAAE;YAClC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC7B;aAAM,IAAI,OAAO,YAAY,mBAAK,EAAE;YACjC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SAC5B;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,UAAU,CAAC,IAAW;QAC5B,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,UAAU,CAAC,IAAW;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExD,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,YAAY,mBAAK,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,YAAY,mBAAK,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;YAC3H,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExD,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,YAAY,mBAAK,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,YAAY,mBAAK,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;AAzCG;IADC,kBAAM,CAAC,wBAAU,CAAC;;wDACc;AAFxB,oBAAoB;IADhC,sBAAU,EAAE;GACA,oBAAoB,CA2ChC;AA3CY,oDAAoB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022
|
|
3
|
-
*
|
|
2
|
+
* Copyright (c) 2018-2022 TypeFox and others.
|
|
4
3
|
* This program and the accompanying materials are made available under the
|
|
5
4
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
5
|
* http://www.eclipse.org/legal/epl-2.0.
|
|
@@ -13,27 +12,42 @@
|
|
|
13
12
|
*
|
|
14
13
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
14
|
********************************************************************************/
|
|
16
|
-
import { LayoutEngine, ModelState } from '@eclipse-glsp/server-node';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
* Layout engine that delegates to ELK by transforming the graphical model into an ELK graph.
|
|
22
|
-
*/
|
|
23
|
-
export declare class BaseElkLayoutEngine extends ElkLayoutEngine {
|
|
24
|
-
protected readonly filter: IElementFilter;
|
|
25
|
-
protected readonly configurator: ILayoutConfigurator;
|
|
26
|
-
protected typeMapper: BasicTypeMapper;
|
|
27
|
-
constructor(elkFactory: ElkFactory, filter: IElementFilter, configurator: ILayoutConfigurator, typeMapper: BasicTypeMapper);
|
|
28
|
-
protected getBasicType(smodel: SModelElement): string;
|
|
29
|
-
}
|
|
15
|
+
import { GEdge, GGraph, GLabel, GModelElement, GModelElementConstructor, GModelRoot, GNode, GPort, GShapeElement, LayoutEngine, MaybePromise, ModelState } from '@eclipse-glsp/server-node';
|
|
16
|
+
import { ELK, ElkEdge, ElkGraphElement, ElkLabel, ElkNode, ElkPort, ElkPrimitiveEdge, ElkShape } from 'elkjs/lib/elk-api';
|
|
17
|
+
import { ElkFactory } from 'sprotty-elk';
|
|
18
|
+
import { ElementFilter } from './element-filter';
|
|
19
|
+
import { LayoutConfigurator } from './layout-configurator';
|
|
30
20
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
21
|
+
* An implementation of GLSP's {@link LayoutEngine} interface that retrieves the graphical model from the {@link ModelState},
|
|
22
|
+
* transforms this model into an ELK graph and then invokes the underlying ELK instance for layout computation.
|
|
33
23
|
*/
|
|
34
24
|
export declare class GlspElkLayoutEngine implements LayoutEngine {
|
|
25
|
+
protected readonly filter: ElementFilter;
|
|
26
|
+
protected readonly configurator: LayoutConfigurator;
|
|
35
27
|
protected modelState: ModelState;
|
|
36
|
-
protected
|
|
37
|
-
|
|
28
|
+
protected readonly elk: ELK;
|
|
29
|
+
protected elkEdges: ElkEdge[];
|
|
30
|
+
protected idToElkElement: Map<string, ElkGraphElement>;
|
|
31
|
+
constructor(elkFactory: ElkFactory, filter: ElementFilter, configurator: LayoutConfigurator, modelState: ModelState);
|
|
32
|
+
layout(): MaybePromise<GModelRoot>;
|
|
33
|
+
protected transformToElk(model: GModelElement): ElkGraphElement;
|
|
34
|
+
/**
|
|
35
|
+
* Searches for all children of the given element that are an instance of the given {@link GModelElementConstructor}
|
|
36
|
+
* and are included by the {@link ElementFilter}. Also considers children that are nested inside of {@link GCompartment}s.
|
|
37
|
+
* @param element The element whose children should be queried.
|
|
38
|
+
* @param constructor The class instance that should be matched
|
|
39
|
+
* @returns A list of all matching children.
|
|
40
|
+
*/
|
|
41
|
+
protected findChildren<G extends GModelElement>(element: GModelElement, constructor: GModelElementConstructor<G>): G[];
|
|
42
|
+
protected findCommonAncestor(elkEdge: ElkPrimitiveEdge): ElkNode | undefined;
|
|
43
|
+
protected transformGraph(graph: GGraph): ElkGraphElement;
|
|
44
|
+
protected transformNode(node: GNode): ElkNode;
|
|
45
|
+
protected transformShape(elkShape: ElkShape, shape: GShapeElement): void;
|
|
46
|
+
protected transformEdge(edge: GEdge): ElkEdge;
|
|
47
|
+
protected transformLabel(label: GLabel): ElkLabel;
|
|
48
|
+
protected transformPort(port: GPort): ElkPort;
|
|
49
|
+
protected applyLayout(elkNode: ElkNode): void;
|
|
50
|
+
protected applyShape(shape: GShapeElement, elkShape: ElkShape): void;
|
|
51
|
+
protected applyEdge(edge: GEdge, elkEdge: ElkEdge): void;
|
|
38
52
|
}
|
|
39
53
|
//# sourceMappingURL=glsp-elk-layout-engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-elk-layout-engine.d.ts","sourceRoot":"","sources":["../src/glsp-elk-layout-engine.ts"],"names":[],"mappings":"AAAA
|
|
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,a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