Documentation
¶
Overview ¶
Package gogv lays out graphs written in the Graphviz DOT language and renders them, as the Graphviz dot program does.
Index ¶
Constants ¶
const GraphvizVersion = output.GraphvizVersion
GraphvizVersion is the version of Graphviz that gogv follows, "16.1.0". `dot -V` names it before the version of gogv, and the SVG output names it in its "Generated by graphviz version" comment.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FormatError ¶
type FormatError struct {
Format string
}
FormatError is an output format that Render does not write.
func (*FormatError) Error ¶
func (e *FormatError) Error() string
type SyntaxError ¶
SyntaxError is a syntax error in the input, worded as the reference words it.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type Warning ¶
type Warning struct {
// Object names the graph, subgraph, node or edge, as "node a"; empty
// for warnings about the input text.
Object string
// Feature names what is not supported yet, as "shape=record".
Feature string
// Default is what is used instead, or "".
Default string
// contains filtered or unexported fields
}
Warning reports something the caller may want to know about an input: mostly a Graphviz feature that is not supported yet, with the default used instead.
func Render ¶
Render lays out every graph of DOT source text and writes it in format, as `dot -T<format>` writes it to standard output. It returns the output, the warnings, and an error for a format it does not write or a syntax error. After a syntax error, the output holds the graphs read before the one that contains the error. Render is safe for concurrent use.
func (Warning) NotSupportedYet ¶
NotSupportedYet reports whether the warning is about a feature that is not supported yet.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
dot
command
Command dot lays out graphs written in the DOT language, as Graphviz's dot does.
|
Command dot lays out graphs written in the DOT language, as Graphviz's dot does. |
|
internal
|
|
|
attrs
Package attrs knows which attributes the Graphviz documentation describes and which of them, with which values, gogv supports; it reports the features that are not supported yet and gives the layout the values it acts on, with the documented defaults in place of unsupported ones.
|
Package attrs knows which attributes the Graphviz documentation describes and which of them, with which values, gogv supports; it reports the features that are not supported yet and gives the layout the values it acts on, with the documented defaults in place of unsupported ones. |
|
cli
Package cli is the dot command line: it reads DOT files or standard input and writes their layouts in the format chosen with -T.
|
Package cli is the dot command line: it reads DOT files or standard input and writes their layouts in the format chosen with -T. |
|
conformance
Package conformance compares the outputs of gogv with those of the reference dot (Graphviz 16.1.0 built without Pango), layer by layer, as the upstream-compatibility spec defines: canon byte for byte, plain by nodes, edges and size, svg by size and the structural similarity of the rasterized documents.
|
Package conformance compares the outputs of gogv with those of the reference dot (Graphviz 16.1.0 built without Pango), layer by layer, as the upstream-compatibility spec defines: canon byte for byte, plain by nodes, edges and size, svg by size and the structural similarity of the rasterized documents. |
|
corpushash
command
Command corpushash renders every case of a corpus directory as canon, plain and svg, and prints a SHA-256 of each output and of all of them, so that builds for different platforms can be compared.
|
Command corpushash renders every case of a corpus directory as canon, plain and svg, and prints a SHA-256 of each output and of all of them, so that builds for different platforms can be compared. |
|
dotlang
Package dotlang reads graphs written in the DOT language: a lexer, a parser that produces a syntax tree, and the construction of the graph model with the semantics of attribute defaults, subgraphs, edge chains and strict graphs.
|
Package dotlang reads graphs written in the DOT language: a lexer, a parser that produces a syntax tree, and the construction of the graph model with the semantics of attribute defaults, subgraphs, edge chains and strict graphs. |
|
fdlibm
Package fdlibm provides deterministic elementary functions: Sin, Cos, Atan and Atan2, a port of fdlibm 5.3 taken from gopuml.
|
Package fdlibm provides deterministic elementary functions: Sin, Cos, Atan and Atan2, a port of fdlibm 5.3 taken from gopuml. |
|
graph
Package graph is the graph model that the DOT reader builds and that the layout and the outputs read: a root graph with nested subgraphs, nodes and edges, and attributes with the semantics observed on the reference:
|
Package graph is the graph model that the DOT reader builds and that the layout and the outputs read: a root graph with nested subgraphs, nodes and edges, and attributes with the semantics observed on the reference: |
|
label
Package label turns plain-text label attributes into lines: it expands the escapes that name objects and splits the text at the line breaks, as the reference does.
|
Package label turns plain-text label attributes into lines: it expands the escapes that name objects and splits the text at the line breaks, as the reference does. |
|
layout
Package layout computes the dot layout: ranks, the order of nodes within ranks, coordinates, and the routes of edges.
|
Package layout computes the dot layout: ranks, the order of nodes within ranks, coordinates, and the routes of edges. |
|
output
Package output writes graphs in the output formats of dot.
|
Package output writes graphs in the output formats of dot. |
|
playground
command
Command playground is the WebAssembly entry point of the playground of the landing page.
|
Command playground is the WebAssembly entry point of the playground of the landing page. |
|
textmetrics
Package textmetrics measures text with advance-width tables of the Liberation fonts, which are metrically compatible with Times New Roman, Arial and Courier New.
|
Package textmetrics measures text with advance-width tables of the Liberation fonts, which are metrically compatible with Times New Roman, Arial and Courier New. |
|
wasmcheck
command
Command wasmcheck renders the DOT text of its first argument as SVG on standard output; the library tests run it in the WebAssembly build.
|
Command wasmcheck renders the DOT text of its first argument as SVG on standard output; the library tests run it in the WebAssembly build. |
|
tools
|
|
|
attrdoc
command
Command attrdoc generates internal/attrs/documented.go, the list of the attributes that the Graphviz documentation describes, with the kinds of objects that use them, from the attribute table of https://graphviz.org/doc/info/attrs.html.
|
Command attrdoc generates internal/attrs/documented.go, the list of the attributes that the Graphviz documentation describes, with the kinds of objects that use them, from the attribute table of https://graphviz.org/doc/info/attrs.html. |
|
clustervariant
command
Command clustervariant writes a variant of the harvested gopuml graphs that have clusters: each HTML label that gopuml puts on a cluster is replaced by an empty label.
|
Command clustervariant writes a variant of the harvested gopuml graphs that have clusters: each HTML label that gopuml puts on a cluster is replaced by an empty label. |
|
fontmetrics
command
Command fontmetrics generates the advance-width tables of internal/textmetrics from the Liberation 2.1.5 fonts (SIL Open Font License 1.1).
|
Command fontmetrics generates the advance-width tables of internal/textmetrics from the Liberation 2.1.5 fonts (SIL Open Font License 1.1). |
|
harvest
command
Command harvest collects the DOT that gopuml generates for its conformance cases, so that gogv is checked against what its first consumer sends.
|
Command harvest collects the DOT that gopuml generates for its conformance cases, so that gogv is checked against what its first consumer sends. |
|
metricscheck
command
Command metricscheck measures, as a black box, how wide the reference dot sets each printable ASCII character in its Times, Helvetica and Courier metrics, and reports the differences with the tables of internal/textmetrics into .cache/metricscheck/report.md.
|
Command metricscheck measures, as a black box, how wide the reference dot sets each printable ASCII character in its Times, Helvetica and Courier metrics, and reports the differences with the tables of internal/textmetrics into .cache/metricscheck/report.md. |
|
pprofcorpus
command
Command pprofcorpus writes the corpus of DOT that go tool pprof writes: it builds the program of ./workload, runs it twice, and writes the DOT of go tool pprof -dot for its CPU and heap profiles with several option sets into the curated cases of pprof.
|
Command pprofcorpus writes the corpus of DOT that go tool pprof writes: it builds the program of ./workload, runs it twice, and writes the DOT of go tool pprof -dot for its CPU and heap profiles with several option sets into the curated cases of pprof. |
|
pprofcorpus/workload
command
Command workload is the program that tools/pprofcorpus profiles: hashing, sorting and string building under the pprof label work, for the CPU profile, then allocations of three sizes, for the heap profile.
|
Command workload is the program that tools/pprofcorpus profiles: hashing, sorting and string building under the pprof label work, for the CPU profile, then allocations of three sizes, for the heap profile. |
|
provenance
command
Command provenance checks that every non-test Go source file declares where its code comes from, so that the project stays clean-room: written from papers, the Graphviz documentation and the observed behavior of dot, never from the code of Graphviz or of its ports.
|
Command provenance checks that every non-test Go source file declares where its code comes from, so that the project stays clean-room: written from papers, the Graphviz documentation and the observed behavior of dot, never from the code of Graphviz or of its ports. |
|
refgen
command
Command refgen records the outputs of the reference dot for every case of a corpus: it runs `dot -Tcanon`, `-Tplain` and `-Tsvg` in the reference image (tools/reference/Dockerfile) with each case on stdin, and writes stdout, stderr and the exit status with conformance.WriteReference.
|
Command refgen records the outputs of the reference dot for every case of a corpus: it runs `dot -Tcanon`, `-Tplain` and `-Tsvg` in the reference image (tools/reference/Dockerfile) with each case on stdin, and writes stdout, stderr and the exit status with conformance.WriteReference. |
|
site
command
Command site assembles the landing page and the WebAssembly module of its playground into a directory that GitHub Pages or any static file server can serve.
|
Command site assembles the landing page and the WebAssembly module of its playground into a directory that GitHub Pages or any static file server can serve. |