# langium-sprotty

> Use Langium as source for Sprotty diagram models

Latest version **4.4.2** (published 2026-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install langium-sprotty
pnpm add langium-sprotty
yarn add langium-sprotty
bun add langium-sprotty
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.4.2 |
| Published | 2026-11-09 |
| First published | 2021-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 3 |
| Unpacked size | 121.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1052 |
| Author | TypeFox |
| Maintainers | spoenemann, typefox-team, msujew |
| Keywords | language, dsl, diagram, lsp, language-server, vscode, visualization, modeling |

## Links

- npm: https://www.npmjs.com/package/langium-sprotty
- Repository: https://github.com/eclipse-langium/langium
- Homepage: https://langium.org
- Issues: https://github.com/eclipse-langium/langium/issues
- npm.io page: https://npm.io/package/langium-sprotty

## Dependencies (3)

- [langium](https://npm.io/package/langium.md) ~4.4.0
- [sprotty-protocol](https://npm.io/package/sprotty-protocol.md) ^1.0.0
- [vscode-languageserver](https://npm.io/package/vscode-languageserver.md) ~10.1.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 4.4.2 (latest) — 2026-11-09
- 4.3.0-next.a52b426 (next) — 2026-06-08
- 4.4.1 — 2026-11-09
- 4.4.0 — 2026-09-09
- 4.3.0 — 2026-06-15
- 4.2.2-next.d9c47299 — 2026-04-30
- 4.2.0 — 2026-01-27
- 4.1.0 — 2025-09-19
- 4.0.0 — 2025-07-31
- 3.5.0-next.91328d6 — 2025-07-22
- 3.5.0-next.936a9d7 — 2025-07-03
- 3.5.0 — 2025-04-17
- 3.4.0-next.89c0a9d — 2025-03-28
- 3.4.0-next.10c0eb7 — 2025-03-04
- 3.4.0 — 2025-02-26
- … 33 more at https://npm.io/package/langium-sprotty/versions

## README

# Integration of Langium and Sprotty

This package provides glue code for [Langium](https://langium.org) and [Sprotty](https://www.npmjs.com/package/sprotty). It includes the following features:

 * Generate diagram models from a Langium AST
 * Listen to document changes and update existing diagram models automatically
 * Hook into the JSON-RPC channel used by the language server

The counterpart of this integration is the [sprotty-vscode](https://www.npmjs.com/package/sprotty-vscode) package, which provides Sprotty diagrams embedded in VS Code webviews and is able to connect with the JSON-RPC stream of a chosen language.

## How to Use This

 1. Implement a diagram model generator by extending `LangiumDiagramGenerator`
 2. Add `SprottyDiagramServices` to the dependency injection module of your language and bind the `diagram.DiagramGenerator` service
 3. Add `DefaultSprottyModule` to the `inject` function that sets up your dependency injection container
 4. Call the `addDiagramHandler` function in your main code to hook into the JSON-RPC stream

---
_Source: https://npm.io/package/langium-sprotty · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
