Commit ff90786d authored by Mael NICOLAS's avatar Mael NICOLAS

Ugly, but it render ;^)

parent c69d4e81
...@@ -58,9 +58,12 @@ type OptsLoading = ...@@ -58,9 +58,12 @@ type OptsLoading =
zlevel :: Int zlevel :: Int
} }
type OpTest =
{option :: Option}
type Option = type Option =
{ title :: Maybe Title { title :: Maybe Title
, legend :: Legend , legend :: Maybe Legend
, tooltip :: Tooltip , tooltip :: Tooltip
, grid :: Grid , grid :: Grid
, xAxis :: XAxis , xAxis :: XAxis
...@@ -83,8 +86,8 @@ type Grid = ...@@ -83,8 +86,8 @@ type Grid =
} }
type Legend = type Legend =
{"type" :: Maybe String {"type" :: String
, show :: Maybe Boolean , show :: Boolean
, zlevel :: Maybe Number , zlevel :: Maybe Number
, z :: Maybe Number , z :: Maybe Number
, left :: Maybe Number , left :: Maybe Number
...@@ -103,7 +106,7 @@ type Legend = ...@@ -103,7 +106,7 @@ type Legend =
, selectedMode :: Maybe Boolean , selectedMode :: Maybe Boolean
, inactiveColor :: Maybe Color , inactiveColor :: Maybe Color
, selected :: Maybe String -- object , selected :: Maybe String -- object
, "data" :: Array Data , "data" :: Maybe (Array Data)
} }
type Data = type Data =
...@@ -204,13 +207,13 @@ type Rich = {} ...@@ -204,13 +207,13 @@ type Rich = {}
foreign import eChartsClass :: forall props. R.ReactClass props foreign import eChartsClass :: forall props. R.ReactClass props
foreign import eChartsClass2 :: R.ReactClass Option foreign import eChartsClass2 :: R.ReactClass OpTest
echarts :: forall eff. Array Props -> R.ReactElement echarts :: forall eff. Array Props -> R.ReactElement
echarts p = R.createElementDynamic eChartsClass (unsafeFromPropsArray p) [] echarts p = R.createElementDynamic eChartsClass (unsafeFromPropsArray p) []
echarts' :: forall eff. Option -> R.ReactElement echarts' :: forall eff. Option -> R.ReactElement
echarts' chart = R.createElementDynamic eChartsClass2 chart [] echarts' chart = R.createElementDynamic eChartsClass2 {option: chart} []
-- Props -- Props
...@@ -370,27 +373,27 @@ yAxisIndex = unsafeMkProps "yAxisIndex" ...@@ -370,27 +373,27 @@ yAxisIndex = unsafeMkProps "yAxisIndex"
legend' :: Legend legend' :: Legend
legend' = legend' =
{ {
"type": Nothing "type": "plain"
,show: Nothing , show: true
,zlevel: Nothing , zlevel: Nothing
, z : Nothing , z: Nothing
, left : Nothing , left: Nothing
, top : Nothing , top: Nothing
, right : Nothing , right: Nothing
, bottom: Nothing , bottom: Nothing
, width : Nothing , width: Nothing
, height: Nothing , height: Nothing
, orient: Nothing , orient: Nothing
, align : Nothing , align: Nothing
, padding : Nothing , padding: Nothing
, itemGap : Nothing , itemGap: Nothing
, itemWidth : Nothing , itemWidth: Nothing
, itemHeight : Nothing , itemHeight: Nothing
, formatter : Nothing , formatter: Nothing
, selectedMode : Nothing , selectedMode: Nothing
, inactiveColor: Nothing , inactiveColor: Nothing
, selected : Nothing , selected: Nothing
, "data" : [data1, data2, data3] , "data": Nothing
} }
data1 :: Data data1 :: Data
...@@ -448,17 +451,15 @@ series' = ...@@ -448,17 +451,15 @@ series' =
opt :: Option opt :: Option
opt = opt =
{ {
title: title' title: Nothing
,legend: legend' ,legend: Nothing
,tooltip: tooltip' ,tooltip: tooltip'
,grid: grid' ,grid: {containLabel: true}
,xAxis: xAxis' ,xAxis: xAxis'
,yAxis: yData1 ,yAxis: yData1
,series: [series'] ,series: [series']
,dataZoom: [dz1', dz1', dz2', dz2'] ,dataZoom: [dz1', dz1', dz2', dz2']
} }
where title' = Nothing
grid' = {containLabel: true}
histogram2 :: R.ReactElement histogram2 :: R.ReactElement
histogram2 = echarts' opt histogram2 = echarts' opt
...@@ -480,7 +481,7 @@ histogram = echarts ...@@ -480,7 +481,7 @@ histogram = echarts
] ]
, dataZoom' [dz1', dz1', dz2', dz2'] , dataZoom' [dz1', dz1', dz2', dz2']
, yAxis [ya1, ya2] , yAxis [ya1, ya2]
, series [ sd3] , series [sd1, sd2, sd3]
] ]
] ]
......
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