Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
e8934f5d
Commit
e8934f5d
authored
Dec 31, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ihaskell-graphviz: use SVG and enable by default in IHaskell
parent
198a5448
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
Graphviz.hs
...ll-display/ihaskell-graphviz/IHaskell/Display/Graphviz.hs
+10
-14
Types.hs
src/IHaskell/Types.hs
+1
-1
No files found.
ihaskell-display/ihaskell-graphviz/IHaskell/Display/Graphviz.hs
View file @
e8934f5d
...
...
@@ -14,7 +14,7 @@
-- @ dot "digraph { l -> o; o -> v; v -> e; h -> a ; a -> s; s -> k ; k -> e ; e -> l ; l -> l}" @
module
IHaskell.Display.Graphviz
(
dot
,
Graphviz
,
Graphviz
(
..
)
)
where
import
qualified
Data.ByteString.Char8
as
Char
...
...
@@ -37,23 +37,19 @@ dot = Dot
instance
IHaskellDisplay
Graphviz
where
display
fig
=
do
pngDisp
<-
graphDataPN
G
fig
return
$
Display
[
pn
gDisp
]
svgDisp
<-
graphDataSV
G
fig
return
$
Display
[
sv
gDisp
]
name
=
"ihaskell-graphviz."
-- Width and height
w
=
300
h
=
300
graphDataPNG
::
Graphviz
->
IO
DisplayData
graphDataPNG
(
Dot
dotBody
)
=
do
graphDataSVG
::
Graphviz
->
IO
DisplayData
graphDataSVG
(
Dot
dotBody
)
=
do
switchToTmpDir
let
fname
=
name
++
"
pn
g"
let
fname
=
name
++
"
sv
g"
-- Write the image.
ret
<-
readProcess
"dot"
[
"-T
pn
g"
,
"-o"
,
fname
]
dotBody
ret
<-
readProcess
"dot"
[
"-T
sv
g"
,
"-o"
,
fname
]
dotBody
-- Force strictness on readProcess, read file, and
convert to base64.
imgData
<-
seq
(
length
ret
)
$
Char
.
readFile
fname
return
$
png
w
h
$
base64
imgData
-- Force strictness on readProcess, read file, and
output as SVG
imgData
<-
seq
(
length
ret
)
$
readFile
fname
return
$
svg
imgData
src/IHaskell/Types.hs
View file @
e8934f5d
...
...
@@ -171,7 +171,7 @@ defaultKernelState :: KernelState
defaultKernelState
=
KernelState
{
getExecutionCounter
=
1
,
getLintStatus
=
LintOn
,
useSvg
=
Fals
e
,
useSvg
=
Tru
e
,
useShowErrors
=
False
,
useShowTypes
=
False
,
usePager
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment