How to use the sprotty.configureModelElement function in sprotty

To help you get started, we’ve selected a few sprotty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spring-projects / sts4 / nodejs-packages / sprotty-live-beans-client / src / di.config.ts View on Github external
switch (transport) {
            case TransportMedium.Websocket:
                bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
                break;
            case TransportMedium.LSP:
                bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
                break;
            default:
                bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:bean', BeanNode, BeanNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
        console.log('di.config.ts : ' + clientId);
    });
github spring-projects / sts4 / nodejs-packages / sprotty-live-beans-client / src / di.config.ts View on Github external
break;
            case TransportMedium.LSP:
                bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
                break;
            default:
                bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:bean', BeanNode, BeanNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
        console.log('di.config.ts : ' + clientId);
    });
github spring-projects / sts4 / headless-services / sprotty-si-view / client / src / di.config.ts View on Github external
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
        configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        configureModelElement(context, 'input-port', RectangularPort, PortView);
        configureModelElement(context, 'output-port', RectangularPort, PortView);
        configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
    });
github TypeFox / npm-dependency-graph / depgraph-navigator / src / browser / graph / graph-sprotty-config.ts View on Github external
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
        rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();

        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, SGraphView);
        configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
            disable: [moveFeature]
        });
        configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
            disable: [editFeature]
        });
        configureModelElement(context, 'label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        if (additionalBindings) {
            additionalBindings(bind, unbind, isBound, rebind);
        }
    });
github spring-projects / sts4 / headless-services / sprotty-si-view / client / src / di.config.ts View on Github external
const integrationGaphModule = new ContainerModule((bind, unbind, isBound, rebind) => {
        switch (transport) {
            case TransportMedium.Websocket:
                bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
                break;
            case TransportMedium.LSP:
                bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
                break;
            default:
                bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
        configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        configureModelElement(context, 'input-port', RectangularPort, PortView);
        configureModelElement(context, 'output-port', RectangularPort, PortView);
        configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
    });
github spring-projects / sts4 / headless-services / sprotty-si-view / client / src / di.config.ts View on Github external
default:
                bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
        configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        configureModelElement(context, 'input-port', RectangularPort, PortView);
        configureModelElement(context, 'output-port', RectangularPort, PortView);
        configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
    });
github TypeFox / npm-dependency-graph / depgraph-navigator / src / browser / graph / graph-sprotty-config.ts View on Github external
const depGraphModule = new ContainerModule((bind, unbind, isBound, rebind) => {
        bind(DependencyGraphFilter).toSelf();
        bind(IGraphGenerator).to(NpmDependencyGraphGenerator).inSingletonScope();
        bind(TYPES.ModelSource).to(DepGraphModelSource).inSingletonScope();
        rebind(ILayoutConfigurator).to(DepGraphLayoutConfigurator);
        bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
        rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();

        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, SGraphView);
        configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
            disable: [moveFeature]
        });
        configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
            disable: [editFeature]
        });
        configureModelElement(context, 'label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        if (additionalBindings) {
            additionalBindings(bind, unbind, isBound, rebind);
        }
    });
github spring-projects / sts4 / headless-services / sprotty-si-view / client / src / di.config.ts View on Github external
switch (transport) {
            case TransportMedium.Websocket:
                bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
                break;
            case TransportMedium.LSP:
                bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
                break;
            default:
                bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
        }
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, ExampleGraphView);
        configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
        configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
        configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
        configureModelElement(context, 'node:label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        configureModelElement(context, 'input-port', RectangularPort, PortView);
        configureModelElement(context, 'output-port', RectangularPort, PortView);
        configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
        configureViewerOptions(context, {
            needsClientLayout: true,
            needsServerLayout: true,
            baseDiv: clientId,
        });
    });
github TypeFox / npm-dependency-graph / depgraph-navigator / src / browser / graph / graph-sprotty-config.ts View on Github external
bind(TYPES.ModelSource).to(DepGraphModelSource).inSingletonScope();
        rebind(ILayoutConfigurator).to(DepGraphLayoutConfigurator);
        bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
        rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();

        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, SGraphView);
        configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
            disable: [moveFeature]
        });
        configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
            disable: [editFeature]
        });
        configureModelElement(context, 'label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        if (additionalBindings) {
            additionalBindings(bind, unbind, isBound, rebind);
        }
    });
github TypeFox / npm-dependency-graph / depgraph-navigator / src / browser / graph / graph-sprotty-config.ts View on Github external
bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
        rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
        rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
        rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();

        const context = { bind, unbind, isBound, rebind };
        configureModelElement(context, 'graph', SGraph, SGraphView);
        configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
            disable: [moveFeature]
        });
        configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
            disable: [editFeature]
        });
        configureModelElement(context, 'label', SLabel, SLabelView);
        configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
        configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
        configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
        if (additionalBindings) {
            additionalBindings(bind, unbind, isBound, rebind);
        }
    });