Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
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
Grégoire Locqueville
purescript-gargantext
Commits
ff90786d
Commit
ff90786d
authored
May 15, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ugly, but it render ;^)
parent
c69d4e81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
Chart.purs
src/Chart.purs
+30
-29
No files found.
src/Chart.purs
View file @
ff90786d
...
@@ -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 Op
tion
foreign import eChartsClass2 :: R.ReactClass Op
Test
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]
]
]
]
]
...
...
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