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
e9423828
Commit
e9423828
authored
Jul 18, 2018
by
MMesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json and vegalite are working
parent
d6a5af4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Writer.hs
ipython-kernel/src/IHaskell/IPython/Message/Writer.hs
+9
-0
Types.hs
ipython-kernel/src/IHaskell/IPython/Types.hs
+1
-1
No files found.
ipython-kernel/src/IHaskell/IPython/Message/Writer.hs
View file @
e9423828
...
@@ -8,11 +8,14 @@ module IHaskell.IPython.Message.Writer (ToJSON(..)) where
...
@@ -8,11 +8,14 @@ module IHaskell.IPython.Message.Writer (ToJSON(..)) where
import
Data.Aeson
import
Data.Aeson
import
Data.Aeson.Types
(
Pair
)
import
Data.Aeson.Types
(
Pair
)
import
Data.Aeson.Parser
(
json
)
import
Data.Map
(
Map
)
import
Data.Map
(
Map
)
import
Data.Monoid
(
mempty
)
import
Data.Monoid
(
mempty
)
import
Data.Text
(
Text
,
pack
)
import
Data.Text
(
Text
,
pack
)
import
Data.Text.Encoding
(
encodeUtf8
)
import
qualified
Data.Map
as
Map
import
qualified
Data.Map
as
Map
import
IHaskell.IPython.Types
import
IHaskell.IPython.Types
import
Data.Maybe
(
fromMaybe
)
instance
ToJSON
LanguageInfo
where
instance
ToJSON
LanguageInfo
where
toJSON
info
=
object
toJSON
info
=
object
...
@@ -173,6 +176,12 @@ instance ToJSON StreamType where
...
@@ -173,6 +176,12 @@ instance ToJSON StreamType where
-- | Convert a MIME type and value into a JSON dictionary pair.
-- | Convert a MIME type and value into a JSON dictionary pair.
displayDataToJson
::
DisplayData
->
(
Text
,
Value
)
displayDataToJson
::
DisplayData
->
(
Text
,
Value
)
displayDataToJson
(
DisplayData
MimeJson
dataStr
)
=
pack
(
show
MimeJson
)
.=
fromMaybe
(
String
""
)
(
decodeStrict
(
encodeUtf8
dataStr
)
::
Maybe
Value
)
displayDataToJson
(
DisplayData
MimeVegalite
dataStr
)
=
pack
(
show
MimeVegalite
)
.=
fromMaybe
(
String
""
)
(
decodeStrict
(
encodeUtf8
dataStr
)
::
Maybe
Value
)
displayDataToJson
(
DisplayData
MimeVega
dataStr
)
=
pack
(
show
MimeVega
)
.=
fromMaybe
(
String
""
)
(
decodeStrict
(
encodeUtf8
dataStr
)
::
Maybe
Value
)
displayDataToJson
(
DisplayData
mimeType
dataStr
)
=
displayDataToJson
(
DisplayData
mimeType
dataStr
)
=
pack
(
show
mimeType
)
.=
String
dataStr
pack
(
show
mimeType
)
.=
String
dataStr
...
...
ipython-kernel/src/IHaskell/IPython/Types.hs
View file @
e9423828
...
@@ -599,7 +599,7 @@ instance Show MimeType where
...
@@ -599,7 +599,7 @@ instance Show MimeType where
show
MimeJavascript
=
"application/javascript"
show
MimeJavascript
=
"application/javascript"
show
MimeJson
=
"application/json"
show
MimeJson
=
"application/json"
show
MimeVega
=
"application/vnd.vega.v2+json"
show
MimeVega
=
"application/vnd.vega.v2+json"
show
MimeVegalite
=
"application/vnd.vegalite.v
1
+json"
show
MimeVegalite
=
"application/vnd.vegalite.v
2
+json"
show
MimeVdom
=
"application/vdom.v1+json"
show
MimeVdom
=
"application/vdom.v1+json"
instance
Read
MimeType
where
instance
Read
MimeType
where
...
...
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