-
Notifications
You must be signed in to change notification settings - Fork 7
/
Chart.purs
80 lines (50 loc) · 1.67 KB
/
Chart.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module Apexcharts.Chart where
import Apexcharts (Apexoptions)
import Apexcharts.Common (ChartType, chartTypeToString)
import Data.Functor.Contravariant (cmap)
import Data.Options (Option, Options, opt)
import Data.Options as Opt
data Chart
data StackType = NormalStack | HundertPercent
stackTypeToString :: StackType -> String
stackTypeToString = case _ of
NormalStack -> "normal"
HundertPercent -> "100%"
chart :: Option Apexoptions (Options Chart)
chart = cmap Opt.options (opt "chart")
background :: Option Chart String
background = opt "background"
defaultLocale :: Option Chart String
defaultLocale = opt "defaultLocale"
fontFamily :: Option Chart String
fontFamily = opt "fontFamily"
foreColor :: Option Chart String
foreColor = opt "foreColor"
group :: Option Chart String
group = opt "group"
class ChartHeight a where
height :: Option Chart a
instance heightStr :: ChartHeight String where
height = opt "height"
instance heightInt :: ChartHeight Int where
height = opt "height"
instance heightNum :: ChartHeight Number where
height = opt "height"
id :: Option Chart String
id = opt "id"
offsetX :: Option Chart Number
offsetX = opt "offsetX"
offsetY :: Option Chart Number
offsetY = opt "offsetY"
parentHeightOffset :: Option Chart Number
parentHeightOffset = opt "parentHeightOffset"
redrawOnParentResize :: Option Chart Boolean
redrawOnParentResize = opt "redrawOnParentResize"
stacked :: Option Chart Boolean
stacked = opt "stacked"
stackType :: Option Chart StackType
stackType = cmap stackTypeToString (opt "stackType")
type' :: Option Chart ChartType
type' = cmap chartTypeToString (opt "type")
width :: Option Chart String
width = opt "width"