KinoKroki
Mix.install([
{:kino_kroki, "~> 0.1"}
])
図の描画
graph = """
digraph G { bgcolor="purple:pink" label="agraph" fontcolor="white"
fontname="Helvetica,Arial,sans-serif"
node [fontname="Helvetica,Arial,sans-serif"]
edge [fontname="Helvetica,Arial,sans-serif"]
subgraph cluster1 {fillcolor="blue:cyan" label="acluster" fontcolor="white" style="filled" gradientangle="270"
node [shape=box fillcolor="red:yellow" style="filled" gradientangle=90]
anode;
}
}
"""
Kino.Kroki.new(graph, :graphviz)
スマートセル
Kino.Kroki.new(
"blockdiag {\n Kroki -> generates -> \"Block diagrams\";\n Kroki -> is -> \"very easy!\";\n\n Kroki [color = \"greenyellow\"];\n \"Block diagrams\" [color = \"pink\"];\n \"very easy!\" [color = \"orange\"];\n}",
"blockdiag"
)