/
Montone.elm
78 lines (61 loc) · 1.21 KB
/
Montone.elm
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
module Examples.LineCharts.Montone exposing (..)
{-| @LARGE -}
import Html as H
import Chart as C
import Chart.Attributes as CA
view : Model -> H.Html Msg
view model =
{-| @SMALL -}
C.chart
[ CA.height 300
, CA.width 300
]
[ C.xLabels []
, C.yLabels [ CA.withGrid ]
, C.series .x
[ C.interpolated .y [ CA.monotone ] []
, C.interpolated .z [ CA.monotone ] []
]
data
]
{-| @SMALL END -}
{-| @LARGE END -}
meta =
{ category = "Line charts"
, categoryOrder = 3
, name = "Monotone"
, description = "Use a monotone interpolation."
, order = 2
}
type alias Model =
()
init : Model
init =
()
type Msg
= Msg
update : Msg -> Model -> Model
update msg model =
model
type alias Datum =
{ x : Float
, y : Float
, z : Float
, v : Float
, w : Float
, p : Float
, q : Float
}
data : List Datum
data =
[ Datum 1 2 1 4.6 6.9 7.3 8.0
, Datum 2 3 2 5.2 6.2 7.0 8.7
, Datum 3 4 3 5.5 5.2 7.2 8.1
, Datum 4 3 4 5.3 5.7 6.2 7.8
, Datum 5 2 3 4.9 5.9 6.7 8.2
, Datum 6 4 1 4.8 5.4 7.2 8.3
, Datum 7 5 2 5.3 5.1 7.8 7.1
, Datum 8 6 3 5.4 3.9 7.6 8.5
, Datum 9 5 4 5.8 4.6 6.5 6.9
, Datum 10 4 3 4.5 5.3 6.3 7.0
]