Skip to content
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

Merged
merged 10 commits into from
Jan 30, 2024
Merged

Add Elevation Graph Display #290

merged 10 commits into from
Jan 30, 2024

Conversation

abhumbla
Copy link
Contributor

@abhumbla abhumbla commented Oct 5, 2023

Fixes #253 #285

Still needs better styling, will work on that before opening up to full review

signal-2023-10-04-202213_004
signal-2023-10-04-202213_003
signal-2023-10-04-202213_005
signal-2023-10-04-202213_002

@Andykmcc Andykmcc marked this pull request as ready for review October 8, 2023 20:15
@Andykmcc Andykmcc self-requested a review October 8, 2023 20:15
@Andykmcc
Copy link
Contributor

Andykmcc commented Oct 8, 2023

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.

@Andykmcc
Copy link
Contributor

Andykmcc commented Oct 8, 2023

@graue ^^^^

@graue
Copy link
Contributor

graue commented Oct 9, 2023

npm ERR! Incorrect or missing password.

Looks like a configuration issue.

@abhumbla
Copy link
Contributor Author

after some finagling with libraries and labeling, the elevation graph now looks like this:

signal-2023-10-19-014139_002
signal-2023-10-19-014139_004

the public transit section is fixed width, and the bike sections are proportional to their distance. i still need to get the actual width of the element, and do label placement testing on phone screens

Copy link
Contributor

@graue graue left a 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?

package.json Outdated Show resolved Hide resolved
src/components/Itinerary.jsx Outdated Show resolved Hide resolved
@@ -125,7 +125,7 @@ export default function RoutesOverview({
className="stroke-2 text-gray-600"
/>
</Icon>
{formatDistance(route.ascend, intl)}
{formatDistance(route.ascend, intl, true)}
Copy link
Contributor

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',
Copy link
Contributor

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

src/components/ItineraryElevationProfile.jsx Show resolved Hide resolved
src/components/ItineraryElevationProfile.jsx Outdated Show resolved Hide resolved
src/components/ItineraryElevationProfile.jsx Outdated Show resolved Hide resolved
src/components/ItineraryElevationProfile.jsx Show resolved Hide resolved
src/components/ItineraryElevationProfile.jsx Show resolved Hide resolved
src/components/ItineraryElevationProfile.jsx Outdated Show resolved Hide resolved
@abhumbla abhumbla merged commit e9412d4 into main Jan 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show elevation profiles for bike legs (or entire routes)
3 participants