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
90f967c1
Commit
90f967c1
authored
May 29, 2016
by
Sumit Sahrawat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting fixes
parent
007e9532
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
127 deletions
+131
-127
Gnuplot.hs
...kell-display/ihaskell-gnuplot/IHaskell/Display/Gnuplot.hs
+35
-34
Setup.hs
ihaskell-display/ihaskell-gnuplot/Setup.hs
+2
-1
Types.hs
ipython-kernel/src/IHaskell/IPython/Types.hs
+2
-1
CSS.hs
src/IHaskell/CSS.hs
+91
-90
Lint.hs
src/IHaskell/Eval/Lint.hs
+1
-1
No files found.
ihaskell-display/ihaskell-gnuplot/IHaskell/Display/Gnuplot.hs
View file @
90f967c1
{-# LANGUAGE FlexibleInstances #-}
{- There are 3 types of plots to consider in haskell-gnuplot: Plot, Frame and Multiplot.
Plot types are the actual plots, whereas Frame types are plots with additional options
e.g. custom axes tics, graph title etc.. Multiplots are collections of 2D and/or 3D plots.
...
...
@@ -26,50 +27,51 @@ import IHaskell.Display
-- Plot-types
instance
(
C
x
,
C
y
)
=>
IHaskellDisplay
(
P
.
T
(
Tw
.
T
x
y
))
where
display
fig
=
do
pngDisp
<-
graphDataPNG2P
fig
svgDisp
<-
graphDataSVG2P
fig
return
$
Display
[
pngDisp
,
svgDisp
]
display
fig
=
do
pngDisp
<-
graphDataPNG2P
fig
svgDisp
<-
graphDataSVG2P
fig
return
$
Display
[
pngDisp
,
svgDisp
]
instance
(
C
x
,
C
y
,
C
z
)
=>
IHaskellDisplay
(
P
.
T
(
Th
.
T
x
y
z
))
where
display
fig
=
do
pngDisp
<-
graphDataPNG3P
fig
svgDisp
<-
graphDataSVG3P
fig
return
$
Display
[
pngDisp
,
svgDisp
]
display
fig
=
do
pngDisp
<-
graphDataPNG3P
fig
svgDisp
<-
graphDataSVG3P
fig
return
$
Display
[
pngDisp
,
svgDisp
]
-- Frame-types
instance
(
C
x
,
C
y
)
=>
IHaskellDisplay
(
F
.
T
(
Tw
.
T
x
y
))
where
display
fig
=
do
pngDisp
<-
graphDataPNG2F
fig
svgDisp
<-
graphDataSVG2F
fig
return
$
Display
[
pngDisp
,
svgDisp
]
display
fig
=
do
pngDisp
<-
graphDataPNG2F
fig
svgDisp
<-
graphDataSVG2F
fig
return
$
Display
[
pngDisp
,
svgDisp
]
instance
(
C
x
,
C
y
,
C
z
)
=>
IHaskellDisplay
(
F
.
T
(
Th
.
T
x
y
z
))
where
display
fig
=
do
pngDisp
<-
graphDataPNG3F
fig
svgDisp
<-
graphDataSVG3F
fig
return
$
Display
[
pngDisp
,
svgDisp
]
display
fig
=
do
pngDisp
<-
graphDataPNG3F
fig
svgDisp
<-
graphDataSVG3F
fig
return
$
Display
[
pngDisp
,
svgDisp
]
-- Type: Multiplot
instance
IHaskellDisplay
M
.
T
where
display
fig
=
do
pngDisp
<-
graphDataPNGM
fig
svgDisp
<-
graphDataSVGM
fig
return
$
Display
[
pngDisp
,
svgDisp
]
display
fig
=
do
pngDisp
<-
graphDataPNGM
fig
svgDisp
<-
graphDataSVGM
fig
return
$
Display
[
pngDisp
,
svgDisp
]
-- Filename
name
=
".ihaskell-gnuplot."
-- Width and height
w
=
300
h
=
300
graphDataPNG2P
::
(
C
x
,
C
y
)
=>
P
.
T
(
Tw
.
T
x
y
)
->
IO
DisplayData
graphDataPNG2P
graph
=
do
switchToTmpDir
-- Write the image.
let
fname
=
Pn
.
cons
$
name
++
"png"
let
fname
=
Pn
.
cons
$
name
++
"png"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -81,7 +83,7 @@ graphDataSVG2P graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Sv
.
cons
$
name
++
"svg"
let
fname
=
Sv
.
cons
$
name
++
"svg"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -93,7 +95,7 @@ graphDataPNG2F graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Pn
.
cons
$
name
++
"png"
let
fname
=
Pn
.
cons
$
name
++
"png"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -105,7 +107,7 @@ graphDataSVG2F graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Sv
.
cons
$
name
++
"svg"
let
fname
=
Sv
.
cons
$
name
++
"svg"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -117,7 +119,7 @@ graphDataPNG3P graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Pn
.
cons
$
name
++
"png"
let
fname
=
Pn
.
cons
$
name
++
"png"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -129,11 +131,11 @@ graphDataSVG3P graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Sv
.
cons
$
name
++
"svg"
let
fname
=
Sv
.
cons
$
name
++
"svg"
plot
fname
graph
-- Read back, and convert to base64.
imgData
<-
Char
.
readFile
$
name
++
"svg"
imgData
<-
Char
.
readFile
$
name
++
"svg"
return
$
svg
$
Char
.
unpack
imgData
graphDataPNG3F
::
(
C
x
,
C
y
,
C
z
)
=>
F
.
T
(
Th
.
T
x
y
z
)
->
IO
DisplayData
...
...
@@ -141,7 +143,7 @@ graphDataPNG3F graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Pn
.
cons
$
name
++
"png"
let
fname
=
Pn
.
cons
$
name
++
"png"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -153,20 +155,19 @@ graphDataSVG3F graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Sv
.
cons
$
name
++
"svg"
let
fname
=
Sv
.
cons
$
name
++
"svg"
plot
fname
graph
-- Read back, and convert to base64.
imgData
<-
Char
.
readFile
$
name
++
"svg"
imgData
<-
Char
.
readFile
$
name
++
"svg"
return
$
svg
$
Char
.
unpack
imgData
graphDataPNGM
::
M
.
T
->
IO
DisplayData
graphDataPNGM
graph
=
do
switchToTmpDir
-- Write the image.
let
fname
=
Pn
.
cons
$
name
++
"png"
let
fname
=
Pn
.
cons
$
name
++
"png"
plot
fname
graph
-- Read back, and convert to base64.
...
...
@@ -178,7 +179,7 @@ graphDataSVGM graph = do
switchToTmpDir
-- Write the image.
let
fname
=
Sv
.
cons
$
name
++
"svg"
let
fname
=
Sv
.
cons
$
name
++
"svg"
plot
fname
graph
-- Read back, and convert to base64.
...
...
ihaskell-display/ihaskell-gnuplot/Setup.hs
View file @
90f967c1
import
Distribution.Simple
import
Distribution.Simple
main
=
defaultMain
ipython-kernel/src/IHaskell/IPython/Types.hs
View file @
90f967c1
...
...
@@ -288,7 +288,8 @@ data Message =
KernelInfoReply
{
header
::
MessageHeader
,
protocolVersion
::
String
-- ^ current protocol version, major and minor
,
banner
::
String
-- ^ Kernel information description e.g. (IHaskell 0.8.3.0 GHC 7.10.2)
,
banner
::
String
-- ^ Kernel information description e.g. (IHaskell 0.8.3.0 GHC
-- 7.10.2)
,
implementation
::
String
-- ^ e.g. IHaskell
,
implementationVersion
::
String
-- ^ The version of the implementation
,
languageInfo
::
LanguageInfo
...
...
src/IHaskell/CSS.hs
View file @
90f967c1
...
...
@@ -4,93 +4,94 @@ import IHaskellPrelude
ihaskellCSS
::
String
ihaskellCSS
=
unlines
[
-- Custom IHaskell CSS
"/* Styles used for the Hoogle display in the pager */"
,
".hoogle-doc {"
,
"display: block;"
,
"padding-bottom: 1.3em;"
,
"padding-left: 0.4em;"
,
"}"
,
".hoogle-code {"
,
"display: block;"
,
"font-family: monospace;"
,
"white-space: pre;"
,
"}"
,
".hoogle-text {"
,
"display: block;"
,
"}"
,
".hoogle-name {"
,
"color: green;"
,
"font-weight: bold;"
,
"}"
,
".hoogle-head {"
,
"font-weight: bold;"
,
"}"
,
".hoogle-sub {"
,
"display: block;"
,
"margin-left: 0.4em;"
,
"}"
,
".hoogle-package {"
,
"font-weight: bold;"
,
"font-style: italic;"
,
"}"
,
".hoogle-module {"
,
"font-weight: bold;"
,
"}"
,
".hoogle-class {"
,
"font-weight: bold;"
,
"}"
,
-- Styles used for basic displays
".get-type {"
,
"color: green;"
,
"font-weight: bold;"
,
"font-family: monospace;"
,
"display: block;"
,
"white-space: pre-wrap;"
,
"}"
,
".show-type {"
,
"color: green;"
,
"font-weight: bold;"
,
"font-family: monospace;"
,
"margin-left: 1em;"
,
"}"
,
".mono {"
,
"font-family: monospace;"
,
"display: block;"
,
"}"
,
".err-msg {"
,
"color: red;"
,
"font-style: italic;"
,
"font-family: monospace;"
,
"white-space: pre;"
,
"display: block;"
,
"}"
,
"#unshowable {"
,
"color: red;"
,
"font-weight: bold;"
,
"}"
,
".err-msg.in.collapse {"
,
"padding-top: 0.7em;"
,
"}"
,
-- Code that will get highlighted before it is highlighted
".highlight-code {"
,
"white-space: pre;"
,
"font-family: monospace;"
,
"}"
,
-- Hlint styles
".suggestion-warning { "
,
"font-weight: bold;"
,
"color: rgb(200, 130, 0);"
,
"}"
,
".suggestion-error { "
,
"font-weight: bold;"
,
"color: red;"
,
"}"
,
".suggestion-name {"
,
"font-weight: bold;"
,
"}"
]
unlines
[
-- Custom IHaskell CSS
"/* Styles used for the Hoogle display in the pager */"
,
".hoogle-doc {"
,
"display: block;"
,
"padding-bottom: 1.3em;"
,
"padding-left: 0.4em;"
,
"}"
,
".hoogle-code {"
,
"display: block;"
,
"font-family: monospace;"
,
"white-space: pre;"
,
"}"
,
".hoogle-text {"
,
"display: block;"
,
"}"
,
".hoogle-name {"
,
"color: green;"
,
"font-weight: bold;"
,
"}"
,
".hoogle-head {"
,
"font-weight: bold;"
,
"}"
,
".hoogle-sub {"
,
"display: block;"
,
"margin-left: 0.4em;"
,
"}"
,
".hoogle-package {"
,
"font-weight: bold;"
,
"font-style: italic;"
,
"}"
,
".hoogle-module {"
,
"font-weight: bold;"
,
"}"
,
".hoogle-class {"
,
"font-weight: bold;"
,
"}"
,
-- Styles used for basic displays
".get-type {"
,
"color: green;"
,
"font-weight: bold;"
,
"font-family: monospace;"
,
"display: block;"
,
"white-space: pre-wrap;"
,
"}"
,
".show-type {"
,
"color: green;"
,
"font-weight: bold;"
,
"font-family: monospace;"
,
"margin-left: 1em;"
,
"}"
,
".mono {"
,
"font-family: monospace;"
,
"display: block;"
,
"}"
,
".err-msg {"
,
"color: red;"
,
"font-style: italic;"
,
"font-family: monospace;"
,
"white-space: pre;"
,
"display: block;"
,
"}"
,
"#unshowable {"
,
"color: red;"
,
"font-weight: bold;"
,
"}"
,
".err-msg.in.collapse {"
,
"padding-top: 0.7em;"
,
"}"
,
-- Code that will get highlighted before it is highlighted
".highlight-code {"
,
"white-space: pre;"
,
"font-family: monospace;"
,
"}"
,
-- Hlint styles
".suggestion-warning { "
,
"font-weight: bold;"
,
"color: rgb(200, 130, 0);"
,
"}"
,
".suggestion-error { "
,
"font-weight: bold;"
,
"color: red;"
,
"}"
,
".suggestion-name {"
,
"font-weight: bold;"
,
"}"
]
src/IHaskell/Eval/Lint.hs
View file @
90f967c1
...
...
@@ -187,7 +187,7 @@ htmlSuggestions = concatMap toHtml
_
->
"warning"
style
::
String
->
String
->
String
style
=
printf
"<div class=
\"
suggestion-%s
\"
>%s</div>"
style
=
printf
"<div class=
\"
suggestion-%s
\"
>%s</div>"
named
::
String
->
String
named
=
printf
"<div class=
\"
suggestion-name
\"
style=
\"
clear:both;
\"
>%s</div>"
...
...
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