larsen / rando-planner

Clerk viewers and utils to plan bikepacking trips
https://rando-planner.stefanorodighiero.net/
5 stars 0 forks source link

Elevation diagram is displayed wrongly when used as a standalone chart #1

Closed larsen closed 10 months ago

larsen commented 10 months ago

When used standalone

(let [elevation (gpx/elevation gpx-resource)]
  (clerk/html
   [:svg {:width 600 :height 200}
    (diagram/elevation-diagram {:elevation elevation
                                :from 0
                                :to 400
                                :viewbox [0 0 600 200]})]))

image

but, when used in a plan diagram

(clerk/html
 (diagram/plan->diagram plan-start-19))

image

For reference, here the elevation chart displayed by Komoot for the same GPX file

image

larsen commented 10 months ago

It's actually all pieces displayed in reverse!