Commit bcc861ae authored by Sumit Sahrawat's avatar Sumit Sahrawat

Formatting fixes

parent 6a226ce3
...@@ -13,7 +13,7 @@ import Data.Singletons.TH ...@@ -13,7 +13,7 @@ import Data.Singletons.TH
-- Widget properties -- Widget properties
singletons singletons
[d| [d|
data Field = ViewModule data Field = ViewModule
| ViewName | ViewName
| ModelModule | ModelModule
......
...@@ -89,8 +89,8 @@ import qualified IHaskell.Display.Widgets.Singletons as S ...@@ -89,8 +89,8 @@ import qualified IHaskell.Display.Widgets.Singletons as S
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
-- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication. -- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication.
type WidgetClass = '[S.ViewModule, S.ViewName, S.ModelModule, S.ModelName, S.MsgThrottle, S.Version, type WidgetClass = '[S.ViewModule, S.ViewName, S.ModelModule, S.ModelName,
S.DisplayHandler] S.MsgThrottle, S.Version, S.DisplayHandler]
type DOMWidgetClass = WidgetClass :++ '[S.Visible, S.CSS, S.DOMClasses, S.Width, S.Height, S.Padding, type DOMWidgetClass = WidgetClass :++ '[S.Visible, S.CSS, S.DOMClasses, S.Width, S.Height, S.Padding,
S.Margin, S.Color, S.BackgroundColor, S.BorderColor, S.BorderWidth, S.Margin, S.Color, S.BackgroundColor, S.BorderColor, S.BorderWidth,
...@@ -128,7 +128,7 @@ type BoxClass = DOMWidgetClass :++ '[S.Children, S.OverflowX, S.OverflowY, S.Box ...@@ -128,7 +128,7 @@ type BoxClass = DOMWidgetClass :++ '[S.Children, S.OverflowX, S.OverflowY, S.Box
type SelectionContainerClass = BoxClass :++ '[S.Titles, S.SelectedIndex, S.ChangeHandler] type SelectionContainerClass = BoxClass :++ '[S.Titles, S.SelectedIndex, S.ChangeHandler]
-- Types associated with Fields. -- Types associated with Fields.
type family FieldType (f :: Field) :: * where type family FieldType (f :: Field) :: * where
FieldType S.ViewModule = Text FieldType S.ViewModule = Text
FieldType S.ViewName = Text FieldType S.ViewName = Text
...@@ -239,8 +239,9 @@ data WidgetType = ButtonType ...@@ -239,8 +239,9 @@ data WidgetType = ButtonType
| TextAreaType | TextAreaType
| CheckBoxType | CheckBoxType
| ToggleButtonType | ToggleButtonType
-- TODO: Add 'Valid' widget |
| DropdownType -- TODO: Add 'Valid' widget
DropdownType
| RadioButtonsType | RadioButtonsType
| SelectType | SelectType
| ToggleButtonsType | ToggleButtonsType
...@@ -255,8 +256,9 @@ data WidgetType = ButtonType ...@@ -255,8 +256,9 @@ data WidgetType = ButtonType
| FloatSliderType | FloatSliderType
| FloatProgressType | FloatProgressType
| FloatRangeSliderType | FloatRangeSliderType
-- TODO: Add Proxy and PlaceProxy |
| BoxType -- TODO: Add Proxy and PlaceProxy
BoxType
| FlexBoxType | FlexBoxType
| AccordionType | AccordionType
| TabType | TabType
...@@ -290,7 +292,8 @@ type family WidgetFields (w :: WidgetType) :: [Field] where ...@@ -290,7 +292,8 @@ type family WidgetFields (w :: WidgetType) :: [Field] where
WidgetFields IntSliderType = WidgetFields IntSliderType =
BoundedIntClass :++ BoundedIntClass :++
'[S.Orientation, S.ShowRange, S.ReadOut, S.SliderColor] '[S.Orientation, S.ShowRange, S.ReadOut, S.SliderColor]
WidgetFields IntProgressType = BoundedIntClass :++ '[S.Orientation, S.BarStyle] WidgetFields IntProgressType =
BoundedIntClass :++ '[S.Orientation, S.BarStyle]
WidgetFields IntRangeSliderType = WidgetFields IntRangeSliderType =
BoundedIntRangeClass :++ BoundedIntRangeClass :++
'[S.Orientation, S.ShowRange, S.ReadOut, S.SliderColor] '[S.Orientation, S.ShowRange, S.ReadOut, S.SliderColor]
......
...@@ -97,11 +97,12 @@ instance ToJSON Message where ...@@ -97,11 +97,12 @@ instance ToJSON Message where
object ["prompt" .= prompt] object ["prompt" .= prompt]
toJSON req@CommOpen{} = toJSON req@CommOpen{} =
object [ "comm_id" .= commUuid req object
, "target_name" .= commTargetName req [ "comm_id" .= commUuid req
, "target_module" .= commTargetModule req , "target_name" .= commTargetName req
, "data" .= commData req , "target_module" .= commTargetModule req
] , "data" .= commData req
]
toJSON req@CommData{} = toJSON req@CommData{} =
object ["comm_id" .= commUuid req, "data" .= commData req] object ["comm_id" .= commUuid req, "data" .= commData req]
......
...@@ -65,8 +65,8 @@ class IHaskellDisplay a where ...@@ -65,8 +65,8 @@ class IHaskellDisplay a where
-- | Display as an interactive widget. -- | Display as an interactive widget.
class IHaskellDisplay a => IHaskellWidget a where class IHaskellDisplay a => IHaskellWidget a where
-- | Target name for this widget. The actual input parameter should be ignored. By default -- | Target name for this widget. The actual input parameter should be ignored. By default evaluate
-- evaluate to "ipython.widget", which is used by IPython for its backbone widgets. -- to "ipython.widget", which is used by IPython for its backbone widgets.
targetName :: a -> String targetName :: a -> String
targetName _ = "ipython.widget" targetName _ = "ipython.widget"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment