Skip to content

Instantly share code, notes, and snippets.

@astellon
Forked from abap34/Doushite.jl
Last active May 29, 2020 03:18
Show Gist options
  • Save astellon/57c2b754ffde03473015c798f66b55e8 to your computer and use it in GitHub Desktop.
Save astellon/57c2b754ffde03473015c798f66b55e8 to your computer and use it in GitHub Desktop.
これは何 -> 今勉強用に作っているkwii名前のDLフレームワークのplot機能の実装です。動きません。どうして...
function plot(to_file = "graph.png")
dot_graph =
"""
digraph graph_name {
hoge -> foo
}
"""
mktempdir() do tmp_dir
dot_file_path = joinpath(tmp_dir, "tmp_graph.dot")
open(dot_file_path, "w") do f
write(f, dot_graph)
end
extension = last(split(to_file, "."))
to_file = abspath(to_file)
cmd = `dot $(dot_file_path) -T$(extension) -o $(to_file)`
run(cmd)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment