render start/end marks on time axis
they don't do anything yet
This commit is contained in:
parent
c10e5ea70d
commit
f4a9314033
@ -191,7 +191,7 @@ type Msg
|
|||||||
| Loaded (Result Http.Error (List Point))
|
| Loaded (Result Http.Error (List Point))
|
||||||
| NewUrlRequest
|
| NewUrlRequest
|
||||||
| UrlChanged
|
| UrlChanged
|
||||||
|
| Dribble String
|
||||||
|
|
||||||
update : Msg -> Model -> (Model, Cmd Msg)
|
update : Msg -> Model -> (Model, Cmd Msg)
|
||||||
|
|
||||||
@ -247,6 +247,9 @@ updateModel msg model =
|
|||||||
Err e -> { model | track = Debug.log "unknown error" (Failure "e") }
|
Err e -> { model | track = Debug.log "unknown error" (Failure "e") }
|
||||||
NewUrlRequest -> model
|
NewUrlRequest -> model
|
||||||
UrlChanged -> model
|
UrlChanged -> model
|
||||||
|
Dribble message ->
|
||||||
|
let _ = Debug.log "dribble" message
|
||||||
|
in model
|
||||||
|
|
||||||
|
|
||||||
-- VIEW
|
-- VIEW
|
||||||
@ -400,6 +403,9 @@ measureView title colour fn allPoints =
|
|||||||
, xtick 5
|
, xtick 5
|
||||||
]
|
]
|
||||||
|
|
||||||
|
timeClickDecoder =
|
||||||
|
D.map Dribble (D.at ["target", "id"] D.string)
|
||||||
|
|
||||||
timeAxis allPoints =
|
timeAxis allPoints =
|
||||||
let filteredPoints = Point.downsample 300 allPoints
|
let filteredPoints = Point.downsample 300 allPoints
|
||||||
graphHeight = 30
|
graphHeight = 30
|
||||||
@ -439,13 +445,35 @@ timeAxis allPoints =
|
|||||||
, fill "#eef"
|
, fill "#eef"
|
||||||
, stroke "none"
|
, stroke "none"
|
||||||
] []
|
] []
|
||||||
|
markStart x =
|
||||||
|
let x1 = String.fromInt x
|
||||||
|
in Svg.path
|
||||||
|
[ S.d ("M " ++ x1 ++ " 40 " ++
|
||||||
|
"v -50 h 10 v 10 h -10 v -10")
|
||||||
|
, fill "#7c7"
|
||||||
|
, stroke "#4e4"
|
||||||
|
, H.id "left-marker"
|
||||||
|
, strokeWidth "3"
|
||||||
|
] []
|
||||||
|
markEnd x =
|
||||||
|
let x1 = String.fromInt x
|
||||||
|
in Svg.path
|
||||||
|
[ S.d ("M " ++ x1 ++ " 40 " ++
|
||||||
|
"v -50 h -10 v 10 h 10 v -10")
|
||||||
|
, fill "#c77"
|
||||||
|
, stroke "#e44"
|
||||||
|
, H.id "right-marker"
|
||||||
|
, strokeWidth "3"
|
||||||
|
] []
|
||||||
in
|
in
|
||||||
svg
|
svg
|
||||||
[ width portalWidth
|
[ width portalWidth
|
||||||
, height graphHeight
|
, height (graphHeight + 20)
|
||||||
, preserveAspectRatio "none"
|
, on "pointerdown" timeClickDecoder
|
||||||
|
, viewBox ("0 -10 " ++ (String.fromInt portalWidth) ++
|
||||||
|
" " ++ (String.fromInt (graphHeight + 10)))
|
||||||
]
|
]
|
||||||
(bg::xticks)
|
(bg::(markStart 22)::(markEnd 422)::xticks)
|
||||||
|
|
||||||
|
|
||||||
cadenceView : List Point -> Svg Msg
|
cadenceView : List Point -> Svg Msg
|
||||||
|
Loading…
Reference in New Issue
Block a user