-
-
Save astellon/57c2b754ffde03473015c798f66b55e8 to your computer and use it in GitHub Desktop.
これは何 -> 今勉強用に作っているkwii名前のDLフレームワークのplot機能の実装です。動きません。どうして...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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