Open imjasonh opened 2 years ago
Have you seen n3wscott/graph?
Very nice. I think he had some cgo-less graphviz SVG thing I wanted to use right?
@n3wscott @jonjohnsonjr
Graphviz squad assemble
y'all should check out mermaid diagrams too, I hear they are the new hotness (or so my daughter tells me).
Take a look at https://github.com/n3wscott/go-graphviz
I forked go-graphviz and removed all the cgo parts. I also found it is not great at making dot files, but I use it like this:
graph, err := graphviz.ParseBytes(g.Dot(opts))
if err != nil {
return err
}
gv := graphviz.New()
defer func() {
if err := graph.Close(); err != nil {
log.Fatal(err)
}
_ = gv.Close()
}()
return gv.RenderFilename(graph, graphviz.SVG, file)
I make dot files by hand (or generated) and then pass it to this parser and it spits out an SVG., good enough for me.
I hacked this up: https://gist.github.com/imjasonh/ff2d293540b578efb433110d8e9c2a20
(green rectangles are pipeline params, red rectangles are pipeline results)
It's pretty noisy, and it's not even that complicated. I may play with it more.
kubectl get pipeline foo | tknviz | dot -Tpng ...
Ideas:
when
gray, etc.