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