-
-
Save jaydeesimon/7844e272b5d43f6a9b14f28ac469f767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn chart [] | |
[:div {:style {:height "500px"}} | |
[:> ResponsiveLine | |
{:data (:data @data) | |
:curve "monotoneX" | |
:axisBottom {:orient "bottom" | |
:legend "hour" | |
:tickValues "every 3 hours" | |
:tickPadding 5 | |
:legendPosition "middle" | |
:legendOffset 39 | |
:format "%H:%M",} | |
:axisLeft {:orient "left" | |
:legend "replicas" | |
:legendPosition "middle" | |
:legendOffset -36} | |
:margin {:top 50 :right 110 :bottom 50 :left 60} | |
:xScale {:type "time" :format "native" :useUTC true} | |
:yScale {:type "linear" | |
:min 0 | |
:max (calc-max-scale (:data @data)) | |
:stacked false} | |
#_:useMesh #_true | |
#_:sliceTooltip #_(fn [slice] | |
(let [slice (js->clj slice :keywordize-keys true) | |
point (second (get-in slice [:slice :points])) | |
time (get-in point [:data :x]) | |
replicas (get-in point [:data :y]) | |
_ (println (count (get-in slice [:slice :points])))] | |
(reagent/as-element | |
[:div (str "Replicas: " replicas)]))) | |
:enableSlices "x"}]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment