@plantuml/core
v1.2026.6
Published
PlantUML diagram rendering engine compiled to JavaScript with TeaVM. Renders UML and many other diagrams entirely in the browser, with no server and no Java.
Maintainers
Readme
@plantuml/core
The PlantUML diagram engine, compiled to JavaScript with TeaVM. It renders UML and many other diagrams entirely in the browser -- no server, no Java, no Graphviz binary required.
This package is generated from the official PlantUML build (issue #2715).
Install
npm install @plantuml/coreOr import straight from a CDN:
<script src="https://unpkg.com/@plantuml/[email protected]/viz-global.js"></script>
<script type="module">
import { render } from "https://unpkg.com/@plantuml/[email protected]/plantuml.js";
render("@startuml\nAlice -> Bob : Hello\n@enduml".split("\n"), "out");
</script>
<div id="out"></div>API
The public surface is two functions exported from the plantuml.js
ES2015 module. viz-global.js (the Graphviz layout engine) must be loaded
as a classic script beforehand.
render(lines, targetId)-- render into the DOM element with thatid.linesis anArray<string>.render(lines, targetId, { dark: true })-- same, in dark mode.renderToString(lines, onSuccess, onError)-- deliver the SVG as a string toonSuccess(svg); errors go toonError(message).
Rendering is asynchronous: render() returns immediately and writes the SVG
into the target element later. See
GITHUB_INTEGRATION.md for details and a full
GitHub-style integration example.
What's included
plantuml.js-- the engineviz-global.js-- Graphviz / Viz.js layout engine (required)- demo pages:
index.html(playground),index-basic.html,index-basic-dark.html,index-collection.html, and two GitHub integration proofs of concept
Heavy optional sprite libraries (IBM, tupadr3, material, AWS...) are not bundled here to keep the package small; load them from the project site if you need them.
License
MIT.
Versions ≥ 1.2026.6 are MIT-licensed; earlier versions are GPL-3.0-or-later. npm only displays the license of the latest version, so if you are pinned to an older release, check the license of that specific version.
