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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
083cbffc
Commit
083cbffc
authored
May 15, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Charts] Fix xAxis labels.
parent
0e975a01
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
Data.purs
src/Gargantext/Components/Charts/Options/Data.purs
+3
-3
ECharts.purs
src/Gargantext/Components/Charts/Options/ECharts.purs
+5
-6
Type.purs
src/Gargantext/Components/Charts/Options/Type.purs
+1
-1
Pie.purs
src/Gargantext/Pages/Corpus/Chart/Pie.purs
+4
-2
No files found.
src/Gargantext/Components/Charts/Options/Data.purs
View file @
083cbffc
...
...
@@ -11,10 +11,10 @@ type DataLegend =
, textStyle :: TextStyle
}
type DataAxis =
{ value :: String
type DataAxis =
Array String
{
-
value :: String
, textStyle :: TextStyle
}
-
}
type RequiredData v o =
{ value :: v
...
...
src/Gargantext/Components/Charts/Options/ECharts.purs
View file @
083cbffc
...
...
@@ -2,6 +2,7 @@ module Gargantext.Components.Charts.Options.ECharts where
import Prelude
import Data.String (take)
import CSS (italic)
import CSS.Common (normal)
import Data.Array (length)
...
...
@@ -128,14 +129,12 @@ yAxisVoid = yAxis
xAxis' :: Array String -> XAxis
xAxis' [] = unsafeCoerce {show:false}
xAxis' xs = xAxis
{ "data": x
Data x
s
{ "data": xs
, "type": "category"
, axisTick: {alignWithLabel: true}
, show: true
, axisLabel: {formatter: "{value}"}
}
where
xData :: Array String -> Array DataAxis
xData = map (\x -> {value : x, textStyle : textStyle})
-- TODO try to use Optional
yAxis' :: { position :: String
...
...
@@ -258,10 +257,10 @@ textStyle =
, fontStyle: chartFontStyle normal
, fontWeight: chartFontWeight normal
, fontFamily: "sans-serif"
, fontSize: 1
5
, fontSize: 1
0
, align: relativePosition $ Relative LeftPos
, verticalAlign: relativePosition $ Relative Top
, lineHeight: percentPosition 0.0
, lineHeight: percentPosition
1
0.0
, width: percentPosition 100.0
, height: percentPosition 100.0
, textBorderColor: black
...
...
src/Gargantext/Components/Charts/Options/Type.purs
View file @
083cbffc
...
...
@@ -128,7 +128,7 @@ type AxisTick =
data XAxis
type XAxisOptional =
( "data" :: Array DataAxis
( "data" :: Array
String --
DataAxis
, "type" :: String
, axisTick :: AxisTick
, name :: String
...
...
src/Gargantext/Pages/Corpus/Chart/Pie.purs
View file @
083cbffc
module Gargantext.Pages.Corpus.Chart.Pie where
import Data.Array (foldl, zip)
import Data.String (take, joinWith, Pattern(..), split, length)
import Data.Array (foldl, zip, filter)
import Data.Array as A
import Data.Tuple (Tuple(..))
import Data.Map as Map
import Data.Int (toNumber)
...
...
@@ -61,7 +63,7 @@ chartOptions :: HistoMetrics -> Options
chartOptions (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Bar"
, subTitle : "Count of GraphTerm"
, xAxis : xAxis' dates'
, xAxis : xAxis'
$ map (\t -> joinWith " " $ map (take 3) $ A.take 3 $ filter (\s -> length s > 3) $ split (Pattern " ") t)
dates'
, yAxis : yAxis' { position: "left", show: true, min:0}
, series : [seriesBarD1 {name: "Number of publication / year"} $ map (\n -> dataSerie {name: "", itemStyle: itemStyle {color:blue}, value: n }) count']
, addZoom : false
...
...
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