Skip to content
forkcloserPublic

About

A Graphviz dot command as one static Go binary: go-graphviz's WebAssembly engine, tagged so tool pins can track it. No C toolchain, no system packages.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

dot

A dot command that renders Graphviz graphs without a Graphviz installation. The engine is forkcloser/go-graphviz, forkcloser's fork of goccy/go-graphviz, which ships Graphviz as WebAssembly, so the result is one static Go binary with no C toolchain and no system packages behind it.

go install github.com/forkcloser/dot/cmd/dot@latest

Usage

dot [-K engine] [-T format] [-o path] [input]
Flag Values Default
-K dot, neato, fdp, sfdp, circo, twopi, osage, patchwork dot
-T dot, xdot, svg, png, jpg dot
-o output file standard output
input a DOT file, or - standard input

Flags take Graphviz's glued form (-Tpng, -oout.png) as well as the spaced one. -V prints the version, -h the usage. Exit status is 0 on success, 1 on an input or rendering error, 2 on a usage error.

go tool pprof -dot cpu.prof | dot -Tpng -o profile.png

That is the whole interface. Graphviz's other options (-G, -N, -E, -l, multiple outputs) are not implemented; graph attributes go in the DOT source.

Why

Upstream go-graphviz keeps its own dot command in a nested module that has never been tagged and still requires the library at v0.2.5, five releases behind. A tool directive on it cannot move. This module is the same thin client on the current library, tagged, so a tool directive or go install pin tracks releases like any other dependency.

Releasing

A release is a signed tag on main, cut with just do release vX.Y.Z by a repository admin; go install and tool directives take it from the module proxy. Before tagging: just lint and just test green on CI, and every merged pull request's title saying what changed for a user: the release notes are those titles, published on the tag's release page with gh release create vX.Y.Z --verify-tag --generate-notes, and one that breaks a consumer carries the breaking label.

Licence

MIT, see LICENSE. The binary embeds forkcloser/go-graphviz's graphviz.wasm, built from Graphviz, under the Eclipse Public License 2.0 (LICENSE-graphviz), and expat, under the MIT license (LICENSE-expat); the release archives carry both texts.

About

A Graphviz dot command as one static Go binary: go-graphviz's WebAssembly engine, tagged so tool pins can track it. No C toolchain, no system packages.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages