Repository navigation
Releases
v0.3.1
gogv v0.3.1
This release opens the landing page of gogv at
https://ekalinin.github.io/gogv/, with a playground that lays out DOT in the
browser with the WebAssembly build of this release. The library, the command
line and the outputs are those of v0.3.0.
Changes
- The landing page: what gogv is, the three ways to run it, its use with
go tool pprof, the output formats, the installation, the conformance
results, the clean-room sources and the license. Everything but the
playground is readable without JavaScript. - The playground: it lays out the DOT source as SVG while it is edited,
shows the warnings as the command line words them and the syntax errors
with their line, offers example graphs, and downloads the SVG. It loads
its module only when it is reached. The module is built from
internal/playgroundof this release, which uses only the public API of
the library; it is not a public JavaScript API. make siteassembles the site locally, with a WebAssembly build of the
working tree. The push of a release tag deploys the site with the build of
that release.
Unchanged
The library and the command line are those of v0.3.0: no Go file of either
changed. The conformance results against Graphviz 16.1.0 are the same,
587 cases: 516 passed, 32 known differences, 39 not supported yet, 0 failed,
and so are the hashes that CI compares across platforms.
Installation
This release has no prebuilt binaries. With Go 1.26 or later:
go install github.com/ekalinin/gogv/cmd/dot@v0.3.1
dot -V # dot - graphviz version 16.1.0 (gogv 0.3.1)As a library:
go get github.com/ekalinin/gogv@v0.3.1v0.3.0
gogv v0.3.0
This release draws the call graphs of go tool pprof as Graphviz does. With
gogv installed as dot, go tool pprof -svg, -web and the Graph view of
-http work without an installed Graphviz: nodes are filled with their
colors, hot edges are thicker and kept straight, residual edges are dotted,
tag nodes are boxes with depth, and the Graph view selects nodes by their
id. Dense graphs are also laid out several times faster.
Changes
- Attributes that
go tool pprofwrites are supported, without a warning:- on nodes:
style=filled,fillcolor,shape=box3d,tooltip,id; - on edges:
style=dotted,penwidth,weight,tooltip,
labeltooltip; styletakes a comma-separated list of supported styles, such as
filled,rounded.
- on nodes:
- Layout:
weightweighs edges in the ranking and in the positioning, as in
Gansner et al.: heavy edges are kept short and straight;box3dnodes are sized as boxes;- arrowheads of wider pens stop short of their nodes, and widen above 4
points, as Graphviz draws them.
svg:- fills, with the color that Graphviz chooses:
fillcolor, elsecolor,
elselightgrey; - the outline of
box3d, dotted edges and pen widths; - tooltips, in the
aelements that Graphviz writes; - node groups take their
id, edge groups are numbered in the order the
edges are read, and groups are written in the order Graphviz writes
them; an invisible edge leaves its comment, as in Graphviz.
- fills, with the color that Graphviz chooses:
plain, xdot and JSON write the same styles, fills, pen widths and
box3doutlines, as Graphviz writes them.canonbreaks long strings after commas and equals signs too, as Graphviz
does.- The x positioning updates its network simplex tree in place after each
pivot, as section 2.4 of Gansner et al. describes, instead of rebuilding
it. On the dense class diagrams of issue #29,dot -Tsvgis 3 to 6 times
as fast: 1.24 s instead of 6.16 s for 150 classes, and 20.6 s instead of
119.5 s for 300 classes. The pivots are the same, so the outputs do not
change.
Changed output
For graphs without the new attributes, layouts are unchanged. On the 551
inputs of v0.2.0's conformance corpora, plain and canon are the same,
byte for byte. svg changes in 100 of them, only in the order and the ids
of its groups, and in 12 of these an invisible edge now leaves its comment.
Conformance
Against Graphviz 16.1.0, 587 cases: 516 passed, 32 known differences, 39 not
supported yet, 0 failed. The cases now include 7 DOT files that
go tool pprof writes for CPU and heap profiles. The 6 new known
differences come from heuristics that gogv does not follow yet: the order
within ranks of large profiles, a labeled edge with a back edge between the
same nodes, and the dash phase of thick dotted edges.
Installation
This release has no prebuilt binaries. With Go 1.26 or later:
go install github.com/ekalinin/gogv/cmd/dot@v0.3.0
dot -V # dot - graphviz version 16.1.0 (gogv 0.3.0)As a library:
go get github.com/ekalinin/gogv@v0.3.0To use it with go tool pprof, put the dot that go install writes, in
$(go env GOPATH)/bin, before any other dot on the PATH.
v0.2.0
gogv v0.2.0
This release exports the version of Graphviz that gogv follows, for Go
programs that print it, as gopuml's --check-graphviz does when it lays out
graphs with gogv.
Changes
gogv.GraphvizVersion("16.1.0"): the version of Graphviz that gogv
follows.dot -Vnames it before the version of gogv, and the SVG output
names it in itsGenerated by graphviz versioncomment; both now take it
from this one constant.
Unchanged
The outputs of v0.1.0 are unchanged, byte for byte: the conformance results
against Graphviz 16.1.0 (565 cases: 501 passed, 26 known differences, 38 not
supported yet, 0 failed) and the hashes that CI compares across platforms are
the same.
Installation
This release has no prebuilt binaries. With Go 1.26 or later:
go install github.com/ekalinin/gogv/cmd/dot@v0.2.0
dot -V # dot - graphviz version 16.1.0 (gogv 0.2.0)As a library:
go get github.com/ekalinin/gogv@v0.2.0v0.1.0
gogv v0.1.0
The first release of gogv, a Go implementation of the Graphviz dot program
that follows Graphviz 16.1.0. It lays out graphs written in the DOT language
and writes them in the output formats of dot, as a Go library, a dot
command line and a WebAssembly module. It needs no cgo, no embedded
WebAssembly and no installed Graphviz. gogv is written clean-room, from
published papers, the Graphviz documentation and the observed behavior of
Graphviz, and contains no code of Graphviz or of its ports.
Supported
- the whole DOT grammar
- the layered layout of
dot: ranking, crossing minimization, positioning,
and spline or polyline routing, top to bottom or left to right
(rankdir=LR) - 11 node shapes:
rect,box,rectangle,plaintext,point,
ellipse,oval,circle,diamond,hexagon,octagon - clusters, nested, with labels;
rank=same|min|max|source|sink - plain-text labels, edge labels,
xlabel,headlabelandtaillabel - table labels of empty cells, and node ports that attach edges to their
cells - 14 output formats:
svg,svg_inline,plain,plain-ext,canon,
dot,gv,xdot,xdot1.2,xdot1.4,json,json0,dot_json,
xdot_json
The Status section of the README lists the supported attributes and values.
Not supported yet
Color names (colors are written #rrggbb), styles such as filled and
dashed, other shapes such as record, rankdir=BT and rankdir=RL,
splines=ortho, compass points, text in table cells and HTML text markup,
fonts other than the Times, Helvetica and Courier families, and the other
layout engines. Each gives a warning or an error that names it, and a warning
also names the default used instead. Output formats other than the 14 above,
such as png and pdf, are reported as not recognized, as Graphviz reports
an unknown format.
Conformance
make conformance compares gogv with Graphviz 16.1.0 built without Pango,
layer by layer: canon byte for byte, plain and svg by size and by the
structural similarity of the rasterized documents, the other formats by their
objects, attributes and drawing operations. On 565 cases (the 255 curated
cases of testdata/conformance, the 260 graphs that gopuml v0.3.0 sends to
dot and a variant of 36 of them with clusters, and 14 command line cases):
- 501 cases pass
- 26 cases are documented known differences
(testdata/conformance/known-differences.yaml) - 38 cases use a feature that is not supported yet
- 0 cases fail
Determinism
The output is the same, byte for byte, on every platform: CI renders the
curated cases in every format on linux/amd64, on macOS/arm64 and in the
WebAssembly build, and compares the hashes.
Installation
This release has no prebuilt binaries. With Go 1.26 or later:
go install github.com/ekalinin/gogv/cmd/dot@v0.1.0
dot -V # dot - graphviz version 16.1.0 (gogv 0.1.0)The command is named dot, as Graphviz's is: when Graphviz is installed too,
the dot found first in PATH runs.
As a library:
go get github.com/ekalinin/gogv@v0.1.0