Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sprotty-vscode-webview

Package Overview
Dependencies
Maintainers
5
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sprotty-vscode-webview

Integration of Sprotty in a VS Code extensions (WebView part)

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Sprotty Diagrams in VS Code Webviews

This library helps you to implement a VS Code webview that displays a Sprotty diagram. You can use sprotty-vscode to integrate such a webview in a VS Code extension.

Getting Started

The diagram itself is implemented with the Sprotty API. See the Sprotty Wiki, the states example and the Sprotty examples for reference.

The next step is to implement a subclass of SprottyStarter and instantiate it in your entry module as shown below.

export class ExampleSprottyStarter extends SprottyStarter {
    createContainer(diagramIdentifier: SprottyDiagramIdentifier) {
        return createExampleDiagramContainer(diagramIdentifier.clientId);
    }
}

new ExampleSprottyStarter().start();

Don't forget to call the start method, which initiates the communication to the host extension.

The function createExampleDiagramContainer should create an InversifyJS container with all necessary Sprotty configuration. The passed clientId should be used in the baseDiv and hiddenDiv ids in Sprotty's ViewerOptions.

In case you are connecting your diagram with a language server, e.g. using Langium, you should use SprottyLspEditStarter as superclass.

Keywords

FAQs

Package last updated on 21 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc