Documentation
¶
Overview ¶
Package render writes strata's answers as tables, trees, JSON, CSV, NDJSON, Mermaid, DOT, SVG and self-contained HTML. Machine formats are never styled.
Index ¶
- Constants
- func Cell(col string, v any) string
- func D2Source(g *graph.Graph) string
- func DotTo(w io.Writer, g *graph.Graph) error
- func Explain(w io.Writer, ex *service.Explanation) error
- func HTMLTo(w io.Writer, g *graph.Graph) error
- func JSONTo(w io.Writer, v any) error
- func MapTo(w io.Writer, g *graph.Graph) error
- func MermaidTo(w io.Writer, g *graph.Graph) error
- func SVGTo(w io.Writer, g *graph.Graph) error
- func Tree(w io.Writer, g *graph.Graph) error
- func TrendTo(w io.Writer, metric string, series []Series) error
- func WriteGraph(w io.Writer, format string, g *graph.Graph) error
- func WriteRows(w io.Writer, format string, cols []string, rows [][]any) error
- type Display
- type RowWriter
- type Series
- type View
Constants ¶
const ( FormatTree = "tree" Mermaid = "mermaid" Dot = "dot" SVG = "svg" HTML = "html" )
Graph formats.
const ( Table = "table" JSON = "json" CSV = "csv" NDJSON = "ndjson" )
Formats for tabular output.
Variables ¶
This section is empty.
Functions ¶
func Explain ¶
func Explain(w io.Writer, ex *service.Explanation) error
Explain writes a human-readable report of one image.
func HTMLTo ¶
HTMLTo writes a self-contained interactive explorer: the graph JSON plus Cytoscape.js with an ELK layout, opened offline in any browser.
func MapTo ¶
MapTo writes the registry map: an icicle chart with root bases at the left and descendants to the right, each block sized by image count and shaded by its share of stale images.
func SVGTo ¶
SVGTo lays the graph out with D2 (embedded as a library, no Graphviz needed) and writes an SVG.
func Tree ¶
Tree writes a graph as an indented tree with aligned columns: name, short digest, then the verdict for the first node and edge provenance for the rest. Ancestry trees start at the image and descend to the root; descendant trees start at the base.
func TrendTo ¶
TrendTo writes a snapshot metric as a self-contained HTML line chart, drawn as inline SVG with no scripts.
func WriteGraph ¶
WriteGraph writes a graph in tree, mermaid, dot, svg, html or json.
Types ¶
type Display ¶
Display is how a node is named in visual formats: a title, a subtitle with its short digest and status, and the registry host, which is left out of the title when every node shares it.
type RowWriter ¶
type RowWriter interface {
// Header is called once with the column names.
Header(cols []string) error
// Row writes one row.
Row(vals []any) error
// Close flushes buffered output.
Close() error
}
RowWriter streams rows in one format.