-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Elevation Graph Display #290
Conversation
I made this a PR to see if it was just some stupid GH action thing but no, that wasn't it. after a bit of digging it looks like it is an issue with the deps. in you installed. if you delete the package-lock the install fails for some other reason. seems like we might need to upgrade some packages to get everything lined up to fix this issue. |
@graue ^^^^ |
Looks like a configuration issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, great work on the graph! It's looking good 🙌
I found this code hard to follow, and after half an hour of close reading I'm realizing that much of the complexity comes from interpolating elevation values that the router doesn't provide for PT legs (which was not at all obvious on first read).
Can we modify the router to provide those elevation values so this is unnecessary?
If not, could we do a first pass just to interpolate the values and nothing else, to make this simpler?
src/components/RoutesOverview.jsx
Outdated
@@ -125,7 +125,7 @@ export default function RoutesOverview({ | |||
className="stroke-2 text-gray-600" | |||
/> | |||
</Icon> | |||
{formatDistance(route.ascend, intl)} | |||
{formatDistance(route.ascend, intl, true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer an options hash and {forceFeet: true}
so we don't have to look up what this means
Even better how about {isElevation: true}
? Or a separate formatElevation
? Since the judgement that using miles is not appropriate for vertical distances properly belongs to the formatDistance
function. This also keeps it agnostic to imperial vs metric
}; | ||
|
||
const axisLeft = { | ||
legend: 'Feet', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like UI text so it needs to be translated. See Itinerary
for examples of using intl.formatMessage
24d42ec
to
9f12f77
Compare
b37b739
to
7715c33
Compare
Fixes #253 #285
Still needs better styling, will work on that before opening up to full review