Commit 6d4ec0f0 authored by Mael NICOLAS's avatar Mael NICOLAS

working on type, need to see why existencial type doesn't compile

parent de941309
module Charts.Types where module Charts.Types where
import Data.Maybe(Maybe(..)) import Prelude ((<>), show, ($))
import Data.Maybe(Maybe)
import Data.Either(Either)
import Data.String (toLower)
import Data.Generic (class Generic, gShow)
import CSS (Color) import CSS (Color)
-- eCharts Props type NumberOrArray = Either Number (Array Number)
-- className :: String -> from React DOM Props data Top = Top | Middle | Bottom
-- style :: String, -- object, derive instance genericTop :: Generic Top
-- group :: String, data Position relative = Flat Number | Percent Number | Relative relative -- 20 | 20% | top
-- option :: Option, -- PropTypes.object.isRequired,
-- initOpts :: String, -- PropTypes.object, class InitialB r
-- notMerge :: Boolean, instance nightOfNumber :: InitialB Number
-- lazyUpdate:: Boolean instance runningInTheString :: InitialB String
-- loading :: Boolean,
-- optsLoading:: OptsLoading, -- PropTypes.object, displayTopPosition :: forall a. InitialB a => Position Top -> a
-- onReady :: String, -- PropTypes.func, displayTopPosition (Flat n) = n
-- resizable :: Boolean, -- PropTypes.bool, displayTopPosition (Percent n) = (show n) <> "%"
-- onEvents :: String -- PropTypes.object displayTopPosition (Relative r) = toLower $ gShow r
type Echarts = type Echarts =
{ className :: Maybe String, { className :: Maybe String,
...@@ -35,14 +39,6 @@ type Echarts = ...@@ -35,14 +39,6 @@ type Echarts =
onEvents :: Maybe String -- PropTypes.object onEvents :: Maybe String -- PropTypes.object
} }
type OptsLoading =
{ text :: String,
color :: Color, --- color
textColor :: Color, --color
maskColor :: Color, --color
zlevel :: Int
}
type Option = type Option =
{ title :: Maybe Title { title :: Maybe Title
, legend :: Maybe Legend , legend :: Maybe Legend
...@@ -55,33 +51,43 @@ type Option = ...@@ -55,33 +51,43 @@ type Option =
} }
type Title = type Title =
{ text :: String {
, show :: Boolean id :: Maybe String
, link :: String , show :: Boolean -- default True
, target :: String , text :: Maybe String -- default ''
, link :: Maybe String -- default ''
, target :: String -- default 'blank'
, textStyle :: TextStyle , textStyle :: TextStyle
, subtext :: String , subtext :: String -- default ''
, sublink :: String , sublink :: String -- default ''
, subtarget :: String , subtarget :: String -- default 'blank'
, subtextStyle :: SubtextStyle , subtextStyle :: SubtextStyle
, padding :: Number , padding :: Number -- default '5'
, itemGap :: Number , itemGap :: Number -- default '10'
, zlevel :: Number , zlevel :: Number -- default '0'
, z :: Number , z :: Number -- default '2'
, left :: Number , left :: Number -- default 'auto'
, top :: Number , top :: Number -- default 'auto'
, right :: Number , right :: Number -- default 'auto'
, bottom :: Number , bottom :: Number -- default 'auto'
, backgroundColor :: Color , backgroundColor :: Color -- default 'transparent''
, borderColor :: Color , borderColor :: Color -- default '#ccc'
, borderWidth :: Number , borderWidth :: Number -- default '1'
, borderRadius :: Number -- data NumberOrArray = Number | Array Number , borderRadius :: Number -- default 0; data NumberOrArray = Number | Array Number
, shadowBlur :: Number , shadowBlur :: Number
, shadowColor :: Color , shadowColor :: Color
, shadowOffsetX :: Number , shadowOffsetX :: Number
, shadowOffsetY :: Number , shadowOffsetY :: Number
} }
type OptsLoading =
{ text :: String,
color :: Color, --- color
textColor :: Color, --color
maskColor :: Color, --color
zlevel :: Int
}
type DataZoom = type DataZoom =
{"type" :: String {"type" :: String
, xAxisIndex :: Int , xAxisIndex :: Int
......
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