Commit f0ce010f authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Chart] With Smart Constructor only (Sankey).

parent df46c07f
...@@ -60,7 +60,7 @@ type D2 = ...@@ -60,7 +60,7 @@ type D2 =
{ "symbolSize" :: Number { "symbolSize" :: Number
, "data" :: Array (Array Number) , "data" :: Array (Array Number)
, "type" :: SeriesType , "type" :: SeriesType
} }
toSeries :: Serie -> Series toSeries :: Serie -> Series
toSeries (SeriesD1 a) = unsafeCoerce a toSeries (SeriesD1 a) = unsafeCoerce a
...@@ -81,8 +81,8 @@ type Link = { source :: String ...@@ -81,8 +81,8 @@ type Link = { source :: String
, value :: Number , value :: Number
} }
mkSankey :: Array Node -> Array Link -> Sankey mkSankey :: Array Node -> Array Link -> Serie
mkSankey ns ls = {"type" : seriesType Sankey mkSankey ns ls = SeriesSankey {"type" : seriesType Sankey
, layout : "none" , layout : "none"
, "data" : ns , "data" : ns
, "links" : ls , "links" : ls
...@@ -131,4 +131,3 @@ mkSankey ns ls = {"type" : seriesType Sankey ...@@ -131,4 +131,3 @@ mkSankey ns ls = {"type" : seriesType Sankey
-- https://ecomfe.github.io/echarts-examples/public/editor.html?c=scatter3D-dataset&gl=1 -- https://ecomfe.github.io/echarts-examples/public/editor.html?c=scatter3D-dataset&gl=1
...@@ -125,7 +125,7 @@ sankeyEx :: Options ...@@ -125,7 +125,7 @@ sankeyEx :: Options
sankeyEx = Options { mainTitle : "" sankeyEx = Options { mainTitle : ""
, subTitle : "" , subTitle : ""
, xAxis : xAxis [] , xAxis : xAxis []
, yAxis : [ SeriesSankey $ mkSankey [{name : "a"}, {name : "b"}, {name:"c"}, {name:"d"}] , yAxis : [ mkSankey [{name : "a"}, {name : "b"}, {name:"c"}, {name:"d"}]
[{source : "a", target : "b", value :2.0} [{source : "a", target : "b", value :2.0}
, {source : "a", target : "c", value :1.0} , {source : "a", target : "c", value :1.0}
, {source : "b", target : "c", value :1.0} , {source : "b", target : "c", value :1.0}
......
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