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
ea63b65f
Commit
ea63b65f
authored
Jun 17, 2021
by
David Davó
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created common IHaskellWidget instance
parent
f997f5ad
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
18 additions
and
145 deletions
+18
-145
CheckBox.hs
...ell-widgets/src/IHaskell/Display/Widgets/Bool/CheckBox.hs
+0
-5
ToggleButton.hs
...widgets/src/IHaskell/Display/Widgets/Bool/ToggleButton.hs
+0
-5
Valid.hs
...askell-widgets/src/IHaskell/Display/Widgets/Bool/Valid.hs
+0
-5
Box.hs
.../ihaskell-widgets/src/IHaskell/Display/Widgets/Box/Box.hs
+0
-5
Accordion.hs
...skell/Display/Widgets/Box/SelectionContainer/Accordion.hs
+0
-5
Tab.hs
...rc/IHaskell/Display/Widgets/Box/SelectionContainer/Tab.hs
+0
-5
Button.hs
...y/ihaskell-widgets/src/IHaskell/Display/Widgets/Button.hs
+0
-5
BoundedFloatText.hs
...ll/Display/Widgets/Float/BoundedFloat/BoundedFloatText.hs
+0
-5
FloatProgress.hs
...skell/Display/Widgets/Float/BoundedFloat/FloatProgress.hs
+0
-5
FloatSlider.hs
...Haskell/Display/Widgets/Float/BoundedFloat/FloatSlider.hs
+0
-5
FloatRangeSlider.hs
...splay/Widgets/Float/BoundedFloatRange/FloatRangeSlider.hs
+0
-5
FloatText.hs
...l-widgets/src/IHaskell/Display/Widgets/Float/FloatText.hs
+0
-5
Image.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Image.hs
+0
-5
BoundedIntText.hs
...IHaskell/Display/Widgets/Int/BoundedInt/BoundedIntText.hs
+0
-5
IntProgress.hs
...rc/IHaskell/Display/Widgets/Int/BoundedInt/IntProgress.hs
+0
-5
IntSlider.hs
.../src/IHaskell/Display/Widgets/Int/BoundedInt/IntSlider.hs
+1
-8
IntRangeSlider.hs
...ell/Display/Widgets/Int/BoundedIntRange/IntRangeSlider.hs
+0
-5
IntText.hs
...skell-widgets/src/IHaskell/Display/Widgets/Int/IntText.hs
+0
-5
Output.hs
...y/ihaskell-widgets/src/IHaskell/Display/Widgets/Output.hs
+0
-5
Dropdown.hs
...idgets/src/IHaskell/Display/Widgets/Selection/Dropdown.hs
+0
-5
RadioButtons.hs
...ts/src/IHaskell/Display/Widgets/Selection/RadioButtons.hs
+0
-5
Select.hs
...-widgets/src/IHaskell/Display/Widgets/Selection/Select.hs
+0
-5
SelectMultiple.hs
.../src/IHaskell/Display/Widgets/Selection/SelectMultiple.hs
+0
-5
ToggleButtons.hs
...s/src/IHaskell/Display/Widgets/Selection/ToggleButtons.hs
+0
-5
HTML.hs
...skell-widgets/src/IHaskell/Display/Widgets/String/HTML.hs
+0
-5
Label.hs
...kell-widgets/src/IHaskell/Display/Widgets/String/Label.hs
+0
-5
Text.hs
...skell-widgets/src/IHaskell/Display/Widgets/String/Text.hs
+0
-5
TextArea.hs
...l-widgets/src/IHaskell/Display/Widgets/String/TextArea.hs
+0
-5
Types.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
+17
-2
No files found.
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Bool/CheckBox.hs
View file @
ea63b65f
...
@@ -47,11 +47,6 @@ mkCheckBox = do
...
@@ -47,11 +47,6 @@ mkCheckBox = do
-- Return the image widget
-- Return the image widget
return
widget
return
widget
instance
IHaskellDisplay
CheckBox
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
CheckBox
where
instance
IHaskellWidget
CheckBox
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Bool/ToggleButton.hs
View file @
ea63b65f
...
@@ -53,11 +53,6 @@ mkToggleButton = do
...
@@ -53,11 +53,6 @@ mkToggleButton = do
-- Return the image widget
-- Return the image widget
return
widget
return
widget
instance
IHaskellDisplay
ToggleButton
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
ToggleButton
where
instance
IHaskellWidget
ToggleButton
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Bool/Valid.hs
View file @
ea63b65f
...
@@ -49,10 +49,5 @@ mkValidWidget = do
...
@@ -49,10 +49,5 @@ mkValidWidget = do
-- Return the image widget
-- Return the image widget
return
widget
return
widget
instance
IHaskellDisplay
ValidWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
ValidWidget
where
instance
IHaskellWidget
ValidWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/Box.hs
View file @
ea63b65f
...
@@ -45,10 +45,5 @@ mkBox = do
...
@@ -45,10 +45,5 @@ mkBox = do
-- Return the widget
-- Return the widget
return
box
return
box
instance
IHaskellDisplay
Box
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
Box
where
instance
IHaskellWidget
Box
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/SelectionContainer/Accordion.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkAccordion = do
...
@@ -48,11 +48,6 @@ mkAccordion = do
-- Return the widget
-- Return the widget
return
box
return
box
instance
IHaskellDisplay
Accordion
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
Accordion
where
instance
IHaskellWidget
Accordion
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/SelectionContainer/Tab.hs
View file @
ea63b65f
...
@@ -47,11 +47,6 @@ mkTabWidget = do
...
@@ -47,11 +47,6 @@ mkTabWidget = do
-- Return the widget
-- Return the widget
return
box
return
box
instance
IHaskellDisplay
TabWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
TabWidget
where
instance
IHaskellWidget
TabWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Button.hs
View file @
ea63b65f
...
@@ -55,11 +55,6 @@ mkButton = do
...
@@ -55,11 +55,6 @@ mkButton = do
-- Return the button widget
-- Return the button widget
return
button
return
button
instance
IHaskellDisplay
Button
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
Button
where
instance
IHaskellWidget
Button
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/BoundedFloatText.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkBoundedFloatText = do
...
@@ -48,11 +48,6 @@ mkBoundedFloatText = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
BoundedFloatText
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
BoundedFloatText
where
instance
IHaskellWidget
BoundedFloatText
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/FloatProgress.hs
View file @
ea63b65f
...
@@ -51,10 +51,5 @@ mkFloatProgress = do
...
@@ -51,10 +51,5 @@ mkFloatProgress = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
FloatProgress
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
FloatProgress
where
instance
IHaskellWidget
FloatProgress
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloat/FloatSlider.hs
View file @
ea63b65f
...
@@ -55,11 +55,6 @@ mkFloatSlider = do
...
@@ -55,11 +55,6 @@ mkFloatSlider = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
FloatSlider
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
FloatSlider
where
instance
IHaskellWidget
FloatSlider
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/BoundedFloatRange/FloatRangeSlider.hs
View file @
ea63b65f
...
@@ -56,11 +56,6 @@ mkFloatRangeSlider = do
...
@@ -56,11 +56,6 @@ mkFloatRangeSlider = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
FloatRangeSlider
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
FloatRangeSlider
where
instance
IHaskellWidget
FloatRangeSlider
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Float/FloatText.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkFloatText = do
...
@@ -48,11 +48,6 @@ mkFloatText = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
FloatText
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
FloatText
where
instance
IHaskellWidget
FloatText
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Image.hs
View file @
ea63b65f
...
@@ -54,10 +54,5 @@ mkImageWidget = do
...
@@ -54,10 +54,5 @@ mkImageWidget = do
-- Return the image widget
-- Return the image widget
return
widget
return
widget
instance
IHaskellDisplay
ImageWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
ImageWidget
where
instance
IHaskellWidget
ImageWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/BoundedInt/BoundedIntText.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkBoundedIntText = do
...
@@ -48,11 +48,6 @@ mkBoundedIntText = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
BoundedIntText
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
BoundedIntText
where
instance
IHaskellWidget
BoundedIntText
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/BoundedInt/IntProgress.hs
View file @
ea63b65f
...
@@ -51,10 +51,5 @@ mkIntProgress = do
...
@@ -51,10 +51,5 @@ mkIntProgress = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
IntProgress
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
IntProgress
where
instance
IHaskellWidget
IntProgress
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/BoundedInt/IntSlider.hs
View file @
ea63b65f
...
@@ -17,16 +17,14 @@ import Prelude
...
@@ -17,16 +17,14 @@ import Prelude
import
Control.Monad
(
void
)
import
Control.Monad
(
void
)
import
Data.Aeson
import
Data.Aeson
import
Data.Text.Lazy
(
unpack
)
import
Data.Text.Lazy.Encoding
import
Data.IORef
(
newIORef
)
import
Data.IORef
(
newIORef
)
import
qualified
Data.Scientific
as
Sci
import
qualified
Data.Scientific
as
Sci
import
Data.Vinyl
(
Rec
(
..
),
(
<+>
))
import
Data.Vinyl
(
Rec
(
..
),
(
<+>
))
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display
(
IHaskellWidget
(
..
))
import
IHaskell.Display.Widgets.Types
import
IHaskell.Display.Widgets.Types
import
IHaskell.Display.Widgets.Common
import
IHaskell.Display.Widgets.Common
...
@@ -57,11 +55,6 @@ mkIntSlider = do
...
@@ -57,11 +55,6 @@ mkIntSlider = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
IntSlider
where
display
b
=
do
widgetSendView
b
return
$
Display
[
widgetdisplay
$
unpack
$
decodeUtf8
$
encode
$
object
[
"model_id"
.=
getCommUUID
b
,
"version_major"
.=
toInteger
2
,
"version_minor"
.=
toInteger
0
]
]
instance
IHaskellWidget
IntSlider
where
instance
IHaskellWidget
IntSlider
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/BoundedIntRange/IntRangeSlider.hs
View file @
ea63b65f
...
@@ -56,11 +56,6 @@ mkIntRangeSlider = do
...
@@ -56,11 +56,6 @@ mkIntRangeSlider = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
IntRangeSlider
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
IntRangeSlider
where
instance
IHaskellWidget
IntRangeSlider
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/IntText.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkIntText = do
...
@@ -48,11 +48,6 @@ mkIntText = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
IntText
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
IntText
where
instance
IHaskellWidget
IntText
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Output.hs
View file @
ea63b65f
...
@@ -70,10 +70,5 @@ replaceOutput widget d = do
...
@@ -70,10 +70,5 @@ replaceOutput widget d = do
clearOutput_
widget
clearOutput_
widget
appendOutput
widget
d
appendOutput
widget
d
instance
IHaskellDisplay
OutputWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
OutputWidget
where
instance
IHaskellWidget
OutputWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/Dropdown.hs
View file @
ea63b65f
...
@@ -49,11 +49,6 @@ mkDropdown = do
...
@@ -49,11 +49,6 @@ mkDropdown = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
Dropdown
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
Dropdown
where
instance
IHaskellWidget
Dropdown
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/RadioButtons.hs
View file @
ea63b65f
...
@@ -46,11 +46,6 @@ mkRadioButtons = do
...
@@ -46,11 +46,6 @@ mkRadioButtons = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
RadioButtons
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
RadioButtons
where
instance
IHaskellWidget
RadioButtons
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/Select.hs
View file @
ea63b65f
...
@@ -46,11 +46,6 @@ mkSelect = do
...
@@ -46,11 +46,6 @@ mkSelect = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
Select
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
Select
where
instance
IHaskellWidget
Select
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/SelectMultiple.hs
View file @
ea63b65f
...
@@ -47,11 +47,6 @@ mkSelectMultiple = do
...
@@ -47,11 +47,6 @@ mkSelectMultiple = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
SelectMultiple
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
SelectMultiple
where
instance
IHaskellWidget
SelectMultiple
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/ToggleButtons.hs
View file @
ea63b65f
...
@@ -52,11 +52,6 @@ mkToggleButtons = do
...
@@ -52,11 +52,6 @@ mkToggleButtons = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
ToggleButtons
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
ToggleButtons
where
instance
IHaskellWidget
ToggleButtons
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/HTML.hs
View file @
ea63b65f
...
@@ -44,10 +44,5 @@ mkHTMLWidget = do
...
@@ -44,10 +44,5 @@ mkHTMLWidget = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
HTMLWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
HTMLWidget
where
instance
IHaskellWidget
HTMLWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Label.hs
View file @
ea63b65f
...
@@ -44,10 +44,5 @@ mkLabelWidget = do
...
@@ -44,10 +44,5 @@ mkLabelWidget = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
LabelWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
LabelWidget
where
instance
IHaskellWidget
LabelWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Text.hs
View file @
ea63b65f
...
@@ -49,11 +49,6 @@ mkTextWidget = do
...
@@ -49,11 +49,6 @@ mkTextWidget = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
TextWidget
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
TextWidget
where
instance
IHaskellWidget
TextWidget
where
getCommUUID
=
uuid
getCommUUID
=
uuid
-- Two possibilities: 1. content -> event -> "submit" 2. sync_data -> value -> <new_value>
-- Two possibilities: 1. content -> event -> "submit" 2. sync_data -> value -> <new_value>
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/TextArea.hs
View file @
ea63b65f
...
@@ -48,11 +48,6 @@ mkTextArea = do
...
@@ -48,11 +48,6 @@ mkTextArea = do
-- Return the widget
-- Return the widget
return
widget
return
widget
instance
IHaskellDisplay
TextArea
where
display
b
=
do
widgetSendView
b
return
$
Display
[]
instance
IHaskellWidget
TextArea
where
instance
IHaskellWidget
TextArea
where
getCommUUID
=
uuid
getCommUUID
=
uuid
comm
widget
val
_
=
comm
widget
val
_
=
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
View file @
ea63b65f
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
-- | This module houses all the type-trickery needed to make widgets happen.
-- | This module houses all the type-trickery needed to make widgets happen.
--
--
...
@@ -90,12 +91,15 @@ import Data.Singletons.Prelude.List
...
@@ -90,12 +91,15 @@ import Data.Singletons.Prelude.List
import
Data.Singletons.Prelude
((
:++
))
import
Data.Singletons.Prelude
((
:++
))
#
endif
#
endif
import
Data.Text.Lazy
(
unpack
)
import
Data.Text.Lazy.Encoding
import
Data.Singletons.TH
import
Data.Singletons.TH
import
GHC.IO.Exception
import
GHC.IO.Exception
import
IHaskell.Eval.Widgets
(
widgetSendUpdate
)
import
IHaskell.Eval.Widgets
(
widgetSendUpdate
,
widgetSendView
)
import
IHaskell.Display
(
Base64
,
IHaskellWidget
(
..
))
import
IHaskell.Display
(
Base64
,
IHaskellWidget
(
..
)
,
IHaskellDisplay
(
..
),
Display
(
..
),
widgetdisplay
)
import
IHaskell.IPython.Message.UUID
import
IHaskell.IPython.Message.UUID
import
IHaskell.Display.Widgets.Singletons
(
Field
,
SField
)
import
IHaskell.Display.Widgets.Singletons
(
Field
,
SField
)
...
@@ -909,3 +913,14 @@ triggerSubmit = triggerEvent SubmitHandler
...
@@ -909,3 +913,14 @@ triggerSubmit = triggerEvent SubmitHandler
triggerDisplay
::
(
'S
.
DisplayHandler
∈
WidgetFields
w
)
=>
IPythonWidget
w
->
IO
()
triggerDisplay
::
(
'S
.
DisplayHandler
∈
WidgetFields
w
)
=>
IPythonWidget
w
->
IO
()
triggerDisplay
=
triggerEvent
DisplayHandler
triggerDisplay
=
triggerEvent
DisplayHandler
-- | Every IHaskellWidget widget has the same IHaskellDisplay instance, for this
-- reason we need to use FlexibleContexts. The display implementation can still
-- be overriden per widget
instance
IHaskellWidget
(
IPythonWidget
w
)
=>
IHaskellDisplay
(
IPythonWidget
w
)
where
display
b
=
do
widgetSendView
b
-- Keeping compatibility with classic notebook
return
$
Display
[
widgetdisplay
$
unpack
$
decodeUtf8
$
encode
$
object
[
"model_id"
.=
getCommUUID
b
,
"version_major"
.=
toInteger
2
,
"version_minor"
.=
toInteger
0
]
]
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