Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

KinoKroki

livebooks/kino/kino_kroki.livemd

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"
)