Skip to content

Instantly share code, notes, and snippets.

@Ringoxue
Forked from ylxdzsw/draw_dep.jl
Created September 30, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ringoxue/9bf973cbb783613dc9850356327328ec to your computer and use it in GitHub Desktop.
Save Ringoxue/9bf973cbb783613dc9850356327328ec to your computer and use it in GitHub Desktop.
generate dot code that can generates a graph of an abstract julia type
function draw_dep(T::Type)
_draw(T::ANY) = for t in subtypes(T)
println(g, """ "$T" -> "$t" """)
_draw(t)
end
g = IOBuffer()
println(g, "digraph dep {")
_draw(T)
println(g, "}")
g |> takebuf_string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment