https://github.com/tkf/showgraphviz.jl
https://github.com/tkf/showgraphviz.jl
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tkf/showgraphviz.jl
- Owner: tkf
- License: mit
- Created: 2021-10-16T22:36:01.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-19T23:55:08.000Z (about 4 years ago)
- Last Synced: 2024-12-31T09:25:26.214Z (about 1 year ago)
- Language: Julia
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShowGraphviz: Derive various `show` methods from `text/vnd.graphviz`
The main API of ShowGraphviz.jl is `@deriveall`. Given a type that defines
`show` on DOT language MIME type`text/vnd.graphviz`, it defines `show` methods
for various image types such as PNG, GIF, SVG, PDF, etc.
```julia
struct HelloWorld end
Base.show(io::IO, ::MIME"text/vnd.graphviz", ::HelloWorld) =
print(io, "digraph G {Hello->World}")
using ShowGraphviz
ShowGraphviz.@deriveall HelloWorld
svg = sprint(show, "image/svg+xml", HelloWorld())
occursin("