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
3f10486e
Commit
3f10486e
authored
May 25, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done testStyle and textWeight, working on align
parent
c0af47ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
49 deletions
+69
-49
ECharts.purs
src/Charts/ECharts.purs
+38
-30
Types.purs
src/Charts/Types.purs
+30
-18
Dashboard.purs
src/Dashboard.purs
+1
-1
No files found.
src/Charts/ECharts.purs
View file @
3f10486e
...
...
@@ -97,7 +97,7 @@ series' =
opt :: Option
opt =
{
title: title
'
title: title
,legend: Nothing
,tooltip: tooltip'
,grid: {containLabel: true}
...
...
@@ -106,35 +106,43 @@ opt =
,series: [series']
,dataZoom: [dz1', dz1', dz2', dz2']
}
where title' =
{
id: ""
,show: true
,text: "MudaTitre rpz les pyramides"
,link: "https://google.com"
,target: "blank"
,textStyle: Nothing
,subtext: "Muda Subtitle"
,sublink: "https://google.fr"
,subtarget: "blank"
,subtextStyle: Nothing
,padding: 10.0
,itemGap: 0.0
,zlevel: 2.0
,z: 2.0
,left: renderLeftRelativePosition RightPos
,top: renderTopRelativePosition Middle
,right: renderNumber 60.0
,bottom: renderPercentage 40.0
,backgroundColor: renderCSSColor turquoise
,borderColor: renderCSSColor violet
,borderWidth: 20.0
,borderRadius: Left 20.0
,shadowBlur: 40.0
,shadowColor: renderCSSColor turquoise
,shadowOffsetX: 20.0
,shadowOffsetY: 40.0
}
title :: Title
title =
{
id: ""
,show: true
,text: "MudaTitre rpz les pyramides"
,link: "https://google.com"
,target: "blank"
,textStyle: Nothing
,subtext: "Muda Subtitle"
,sublink: "https://google.fr"
,subtarget: "blank"
,subtextStyle: Nothing
,padding: 10.0
,itemGap: 0.0
,zlevel: 2.0
,z: 2.0
,left: renderLeftRelativePosition RightPos
,top: renderTopRelativePosition Middle
,right: renderNumber 60.0
,bottom: renderPercentage 40.0
,backgroundColor: renderChartColor turquoise
,borderColor: renderChartColor violet
,borderWidth: 20.0
,borderRadius: Left 20.0
,shadowBlur: 40.0
,shadowColor: renderChartColor turquoise
,shadowOffsetX: 20.0
,shadowOffsetY: 40.0
}
textStyle :: ChartFontStyle
textStyle =
{
}
charts :: Echarts
charts =
...
...
src/Charts/Types.purs
View file @
3f10486e
...
...
@@ -2,12 +2,10 @@ module Charts.Types where
import Unsafe.Coerce
import CSS (Color,
toHexString
)
import CSS (Color,
FontStyle(..), Value(..), toHexString, Prefixed(..)
)
import Data.Either (Either)
import Data.Generic (class Generic, gShow)
import Data.Maybe (Maybe)
import Data.String (toLower)
import Prelude ((<>), class Show, show, ($), (>>>), Unit, (<<<))
import Prelude ((<>), class Show, show, ($), Unit, (<<<))
type NumberOrArray = Either Number (Array Number)
...
...
@@ -17,17 +15,31 @@ instance showTopRelativePosition :: Show TopRelativePosition
show (Middle) = "middle"
show (Bottom) = "bottom"
data LeftRelativePosition = LeftPos | Center | RightPos
instance showLeftRelativePosition :: Show LeftRelativePosition
where show (LeftPos) = "left"
show (Center) = "center"
show (RightPos) = "right"
newtype CSSColor = CSSColor String
newtype ChartColor = ChartColor String
renderChartColor :: Color -> ChartColor
renderChartColor = ChartColor <<< toHexString
newtype ChartFontStyle = ChartFontStyle String
renderChartFontStyle :: FontStyle -> ChartFontStyle
renderChartFontStyle (FontStyle (Value (Plain "italic"))) = ChartFontStyle "italic"
renderChartFontStyle (FontStyle (Value (Plain "oblique"))) = ChartFontStyle "oblique"
renderChartFontStyle _ = ChartFontStyle "normal"
renderCSSColor :: Color -> CSSColor
renderCSSColor = CSSColor <<< toHexString
newtype ChartFontWeight = ChartFontWeight String
renderChartFontWeight :: FontWeight -> ChartFontWeight
renderChartFontWeight (FontStyle (Value (Plain "bold")))) = ChartFontWeight "bold"
renderChartFontWeight (FontStyle (Value (Plain "bolder")))) = ChartFontWeight "bolder"
renderChartFontWeight (FontStyle (Value (Plain "lighter")))) = ChartFontWeight "lighter"
renderChartFontWeight _ = ChartFontWeight "normal"
foreign import data Position :: Type -> Type
...
...
@@ -90,12 +102,12 @@ type Title =
, top :: Position TopRelativePosition -- default 'auto'
, right :: Position Unit -- default 'auto'
, bottom :: Position Unit -- default 'auto'
, backgroundColor :: C
SS
Color -- default 'transparent''
, borderColor :: C
SS
Color -- default '#ccc'
, backgroundColor :: C
hart
Color -- default 'transparent''
, borderColor :: C
hart
Color -- default '#ccc'
, borderWidth :: Number -- default '1'
, borderRadius :: NumberOrArray -- default 0; data NumberOrArray = Number | Array Number
, shadowBlur :: Number
, shadowColor :: C
SS
Color
, shadowColor :: C
hart
Color
, shadowOffsetX :: Number
, shadowOffsetY :: Number
}
...
...
@@ -151,12 +163,12 @@ type Data =
}
type SubtextStyle =
{ color :: Color
, fontStyle ::
String
, fontWeight ::
String
{ color :: C
hartC
olor
, fontStyle ::
ChartFontStyle
, fontWeight ::
ChartFontWeight
, fontFamily :: String
, fontSize :: Int
, align ::
String
, align ::
LeftRelativePosition
, verticalAlign :: String
, lineHeight :: Number
, width :: Number
...
...
@@ -216,14 +228,14 @@ type TextStyle =
, verticalAlign :: String
, lineHeight :: Int
, width :: Int
, height
:: Int
, height :: Int
, textBorderColor :: String
, textBorderWidth :: Int
, textShadowColor :: String
, textShadowBlur
:: Int
, textShadowBlur :: Int
, textShadowOffsetX :: Int
, textShadowOffsetY :: Int
, rich
:: Rich
, rich :: Rich
}
type Rich = {}
src/Dashboard.purs
View file @
3f10486e
...
...
@@ -18,7 +18,7 @@ performAction :: forall eff props. PerformAction (dom :: DOM | eff) State props
performAction _ _ _ = pure unit
render :: forall props. Render State props Action
render dispatch _ state _ = [
text "Dashboard",
histogram2]
render dispatch _ state _ = [histogram2]
layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action
layoutDashboard = simpleSpec performAction render
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