Skip to content

Instantly share code, notes, and snippets.

@souenzzo
Created August 1, 2019 17:28
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 souenzzo/ec3bf7cd71c60a944bf65517b9473fbe to your computer and use it in GitHub Desktop.
Save souenzzo/ec3bf7cd71c60a944bf65517b9473fbe to your computer and use it in GitHub Desktop.
(time (let [baos (ByteArrayOutputStream.)
data [[:foo :bar]]]
(-> (apply uber/multidigraph data)
(uber/viz-graph {:save {:format :svg
:filename baos}}))
(-> (xml/parse (io/input-stream (.toByteArray baos)))
(assoc-in [:attrs :data] (pr-str data))
(xml/emit-str)
(.getBytes)
(io/input-stream)
(xml/parse)
:attrs
:data
edn/read-string)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment