Commit 540b54d5 authored by Vaibhav Sagar's avatar Vaibhav Sagar

IHaskell.Display.Graphviz: read directly from stdout

parent 22bb3677
......@@ -40,16 +40,5 @@ instance IHaskellDisplay Graphviz where
svgDisp <- graphDataSVG fig
return $ Display [svgDisp]
name = "ihaskell-graphviz."
graphDataSVG :: Graphviz -> IO DisplayData
graphDataSVG (Dot dotBody) = do
switchToTmpDir
let fname = name ++ "svg"
-- Write the image.
ret <- readProcess "dot" ["-Tsvg", "-o", fname] dotBody
-- Force strictness on readProcess, read file, and output as SVG
imgData <- seq (length ret) $ readFile fname
return $ svg imgData
graphDataSVG (Dot dotBody) = svg <$> readProcess "dot" ["-Tsvg"] dotBody
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment