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
74e36155
Commit
74e36155
authored
Jul 25, 2021
by
David Davó
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Box widgets
parent
f9abfc19
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
4 deletions
+161
-4
ihaskell-widgets.cabal
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
+3
-0
Widgets.hs
...-display/ihaskell-widgets/src/IHaskell/Display/Widgets.hs
+3
-0
GridBox.hs
...skell-widgets/src/IHaskell/Display/Widgets/Box/GridBox.hs
+49
-0
HBox.hs
...ihaskell-widgets/src/IHaskell/Display/Widgets/Box/HBox.hs
+49
-0
VBox.hs
...ihaskell-widgets/src/IHaskell/Display/Widgets/Box/VBox.hs
+49
-0
Types.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
+8
-4
No files found.
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
View file @
74e36155
...
@@ -64,6 +64,9 @@ library
...
@@ -64,6 +64,9 @@ library
IHaskell.Display.Widgets.ColorPicker
IHaskell.Display.Widgets.ColorPicker
IHaskell.Display.Widgets.DatePicker
IHaskell.Display.Widgets.DatePicker
IHaskell.Display.Widgets.Box.Box
IHaskell.Display.Widgets.Box.Box
IHaskell.Display.Widgets.Box.GridBox
IHaskell.Display.Widgets.Box.HBox
IHaskell.Display.Widgets.Box.VBox
IHaskell.Display.Widgets.Box.SelectionContainer.Accordion
IHaskell.Display.Widgets.Box.SelectionContainer.Accordion
IHaskell.Display.Widgets.Box.SelectionContainer.Tab
IHaskell.Display.Widgets.Box.SelectionContainer.Tab
IHaskell.Display.Widgets.Bool.CheckBox
IHaskell.Display.Widgets.Bool.CheckBox
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets.hs
View file @
74e36155
...
@@ -5,6 +5,9 @@ import IHaskell.Display.Widgets.ColorPicker as X
...
@@ -5,6 +5,9 @@ import IHaskell.Display.Widgets.ColorPicker as X
import
IHaskell.Display.Widgets.DatePicker
as
X
import
IHaskell.Display.Widgets.DatePicker
as
X
import
IHaskell.Display.Widgets.Box.Box
as
X
import
IHaskell.Display.Widgets.Box.Box
as
X
import
IHaskell.Display.Widgets.Box.GridBox
as
X
import
IHaskell.Display.Widgets.Box.HBox
as
X
import
IHaskell.Display.Widgets.Box.VBox
as
X
import
IHaskell.Display.Widgets.Box.SelectionContainer.Accordion
as
X
import
IHaskell.Display.Widgets.Box.SelectionContainer.Accordion
as
X
import
IHaskell.Display.Widgets.Box.SelectionContainer.Tab
as
X
import
IHaskell.Display.Widgets.Box.SelectionContainer.Tab
as
X
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/GridBox.hs
0 → 100644
View file @
74e36155
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
IHaskell.Display.Widgets.Box.GridBox
(
-- * The GridBox widget
GridBox
-- * Constructor
,
mkGridBox
)
where
-- To keep `cabal repl` happy when running from the ihaskell repo
import
Prelude
import
Data.Aeson
import
Data.IORef
(
newIORef
)
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display.Widgets.Types
-- | A 'GridBox' represents a GridBox widget from IPython.html.widgets.
type
GridBox
=
IPythonWidget
'G
r
idBoxType
-- | Create a new GridBox
mkGridBox
::
IO
GridBox
mkGridBox
=
do
-- Default properties, with a random uuid
wid
<-
U
.
random
let
widgetState
=
WidgetState
$
defaultBoxWidget
"GridBoxView"
"GridBoxModel"
stateIO
<-
newIORef
widgetState
let
gridBox
=
IPythonWidget
wid
stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen
gridBox
$
toJSON
widgetState
-- Return the widget
return
gridBox
instance
IHaskellWidget
GridBox
where
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/HBox.hs
0 → 100644
View file @
74e36155
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
IHaskell.Display.Widgets.Box.HBox
(
-- * The HBox widget
HBox
-- * Constructor
,
mkHBox
)
where
-- To keep `cabal repl` happy when running from the ihaskell repo
import
Prelude
import
Data.Aeson
import
Data.IORef
(
newIORef
)
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display.Widgets.Types
-- | A 'HBox' represents a HBox widget from IPython.html.widgets.
type
HBox
=
IPythonWidget
'H
B
oxType
-- | Create a new HBox
mkHBox
::
IO
HBox
mkHBox
=
do
-- Default properties, with a random uuid
wid
<-
U
.
random
let
widgetState
=
WidgetState
$
defaultBoxWidget
"HBoxView"
"HBoxModel"
stateIO
<-
newIORef
widgetState
let
hBox
=
IPythonWidget
wid
stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen
hBox
$
toJSON
widgetState
-- Return the widget
return
hBox
instance
IHaskellWidget
HBox
where
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/VBox.hs
0 → 100644
View file @
74e36155
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
IHaskell.Display.Widgets.Box.VBox
(
-- * The VBox widget
VBox
-- * Constructor
,
mkVBox
)
where
-- To keep `cabal repl` happy when running from the ihaskell repo
import
Prelude
import
Data.Aeson
import
Data.IORef
(
newIORef
)
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display.Widgets.Types
-- | A 'VBox' represents a VBox widget from IPython.html.widgets.
type
VBox
=
IPythonWidget
'V
B
oxType
-- | Create a new VBox
mkVBox
::
IO
VBox
mkVBox
=
do
-- Default properties, with a random uuid
wid
<-
U
.
random
let
widgetState
=
WidgetState
$
defaultBoxWidget
"VBoxView"
"VBoxModel"
stateIO
<-
newIORef
widgetState
let
vbox
=
IPythonWidget
wid
stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen
vbox
$
toJSON
widgetState
-- Return the widget
return
vbox
instance
IHaskellWidget
VBox
where
getCommUUID
=
uuid
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
View file @
74e36155
...
@@ -161,7 +161,7 @@ type FloatRangeClass = FloatClass :++ '[ 'S.FloatPairValue ]
...
@@ -161,7 +161,7 @@ type FloatRangeClass = FloatClass :++ '[ 'S.FloatPairValue ]
type
BoundedFloatRangeClass
=
FloatRangeClass
:++
[
'S
.
StepFloat
,
'S
.
MinFloat
,
'S
.
MaxFloat
]
type
BoundedFloatRangeClass
=
FloatRangeClass
:++
[
'S
.
StepFloat
,
'S
.
MinFloat
,
'S
.
MaxFloat
]
type
BoxClass
=
DOMWidgetClass
:++
[
'S
.
Children
,
'S
.
OverflowX
,
'S
.
OverflowY
,
'S
.
BoxStyle
]
type
BoxClass
=
CoreWidgetClass
:++
DOMWidgetClass
:++
[
'S
.
Children
,
'S
.
BoxStyle
]
type
SelectionContainerClass
=
BoxClass
:++
[
'S
.
Titles
,
'S
.
SelectedIndex
,
'S
.
ChangeHandler
]
type
SelectionContainerClass
=
BoxClass
:++
[
'S
.
Titles
,
'S
.
SelectedIndex
,
'S
.
ChangeHandler
]
...
@@ -322,6 +322,9 @@ data WidgetType = ButtonType
...
@@ -322,6 +322,9 @@ data WidgetType = ButtonType
|
FloatProgressType
|
FloatProgressType
|
FloatRangeSliderType
|
FloatRangeSliderType
|
BoxType
|
BoxType
|
GridBoxType
|
HBoxType
|
VBoxType
|
AccordionType
|
AccordionType
|
TabType
|
TabType
|
ControllerButtonType
|
ControllerButtonType
...
@@ -401,6 +404,9 @@ type family WidgetFields (w :: WidgetType) :: [Field] where
...
@@ -401,6 +404,9 @@ type family WidgetFields (w :: WidgetType) :: [Field] where
BoundedFloatRangeClass
:++
BoundedFloatRangeClass
:++
[
'S
.
StepFloat
,
'S
.
Orientation
,
'S
.
ReadOut
,
'S
.
ReadOutFormat
,
'S
.
ContinuousUpdate
,
'S
.
Disabled
]
[
'S
.
StepFloat
,
'S
.
Orientation
,
'S
.
ReadOut
,
'S
.
ReadOutFormat
,
'S
.
ContinuousUpdate
,
'S
.
Disabled
]
WidgetFields
'B
o
xType
=
BoxClass
WidgetFields
'B
o
xType
=
BoxClass
WidgetFields
'G
r
idBoxType
=
BoxClass
WidgetFields
'H
B
oxType
=
BoxClass
WidgetFields
'V
B
oxType
=
BoxClass
WidgetFields
'A
c
cordionType
=
SelectionContainerClass
WidgetFields
'A
c
cordionType
=
SelectionContainerClass
WidgetFields
'T
a
bType
=
SelectionContainerClass
WidgetFields
'T
a
bType
=
SelectionContainerClass
WidgetFields
'C
o
ntrollerType
=
WidgetFields
'C
o
ntrollerType
=
...
@@ -907,11 +913,9 @@ defaultBoundedFloatRangeWidget viewName modelName = defaultFloatRangeWidget view
...
@@ -907,11 +913,9 @@ defaultBoundedFloatRangeWidget viewName modelName = defaultFloatRangeWidget view
-- | A record representing a widget of the _Box class from IPython
-- | A record representing a widget of the _Box class from IPython
defaultBoxWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
BoxClass
defaultBoxWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
BoxClass
defaultBoxWidget
viewName
modelName
=
defaultDOMWidget
viewName
modelName
<+>
intAttrs
defaultBoxWidget
viewName
modelName
=
default
CoreWidget
<+>
default
DOMWidget
viewName
modelName
<+>
intAttrs
where
where
intAttrs
=
(
Children
=::
[]
)
intAttrs
=
(
Children
=::
[]
)
:&
(
OverflowX
=::
DefaultOverflow
)
:&
(
OverflowY
=::
DefaultOverflow
)
:&
(
BoxStyle
=::
DefaultBox
)
:&
(
BoxStyle
=::
DefaultBox
)
:&
RNil
:&
RNil
...
...
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