     (set-alpha 0.8)
     view))
 
-(def m-per-h->km-per-h (partial * 3.6))
+(def meters-per-hour->kilometers-per-hour (partial * 3.6))
+(defn- seconds->minutes [s] (/ s 60))
+(defn- string-date->millis [str-date]
+  (.getTime
+    (clojure.instant/read-instant-date str-date)))
 
 (defn -main
   [& args]

  (let
    [token (first args)
     activities (->> (strava-json-activities token)
                     (map #(update-in % ["average_speed"] m-per-h->km-per-h))
                     (map #(update-in % ["start_date_local"] to-millis)))
     to-millis (fn [dates] (map #(to-millis %) dates))]

    (with-data
      (to-dataset activities)

        :group-by ($ :type)
        :title "Activity duration over time"
        :x-label "time"
        :y-label "activity's elapsed time (minutes)"))
    ))