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
6f194eb9
Commit
6f194eb9
authored
Mar 27, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #460 from sumitsahrawat/plot-patch
Generalize ihaskell-plot to work for all Figure types
parents
5ac6132f
2c96b37d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Plot.hs
ihaskell-display/ihaskell-plot/IHaskell/Display/Plot.hs
+6
-4
No files found.
ihaskell-display/ihaskell-plot/IHaskell/Display/Plot.hs
View file @
6f194eb9
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleInstances #-}
module
IHaskell.Display.Plot
where
...
...
@@ -11,8 +10,9 @@ import Graphics.Rendering.Plot
import
IHaskell.Display
instance
IHaskellDisplay
(
Figure
()
)
where
display
figure
=
do
instance
IHaskellDisplay
(
Figure
a
)
where
display
fig
=
do
let
figure
=
fig
>>
return
()
pngDisp
<-
figureData
figure
PNG
svgDisp
<-
figureData
figure
SVG
return
$
Display
[
pngDisp
,
svgDisp
]
...
...
@@ -36,9 +36,11 @@ figureData figure format = do
case
format
of
PNG
->
png
w
h
$
base64
imgData
SVG
->
svg
$
Char
.
unpack
imgData
_
->
error
"Unsupported format for display"
return
value
where
extension
SVG
=
"svg"
extension
PNG
=
"png"
extension
_
=
""
\ No newline at end of file
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