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

✨ (stacked bar) move legend to the top on mobile #3629

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented May 22, 2024

Moves the legend of stacked bar charts to the top on mobile.

(SVG differences come from the previous PR)

Screenshot 2024-05-22 at 15 01 24 Screenshot 2024-05-22 at 15 02 04

If there is very little space (due to long text), then moving the legend to the top eats into the vertical space badly:

Before (375px) After (375px)
Screenshot 2024-06-04 at 23 09 20 Screenshot 2024-06-04 at 23 08 21
Before (325px) After (325px)
Screenshot 2024-06-04 at 22 58 39 Screenshot 2024-06-04 at 22 58 13

(Note that the legend overflows in the before version)

Copy link
Member Author

sophiamersmann commented May 22, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sophiamersmann and the rest of your teammates on Graphite Graphite

@owidbot
Copy link
Contributor

owidbot commented May 22, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-discrete-bar-mobile-legend

SVG tester:

Number of differences (default views): 19 (a90d8f) ❌
Number of differences (all views): 100 (c7314e) ❌

Edited: 2024-06-10 11:25:39 UTC
Execution time: 1.19 seconds

@sophiamersmann sophiamersmann force-pushed the discrete-bar-mobile-legend branch 3 times, most recently from 72de730 to 3114651 Compare May 22, 2024 12:59
@sophiamersmann sophiamersmann changed the title ✨ (discrete bar) move legend to the top on mobile ✨ (stacked bar) move legend to the top on mobile May 22, 2024
@sophiamersmann sophiamersmann marked this pull request as ready for review May 23, 2024 06:53
@sophiamersmann sophiamersmann requested review from marcelgerber and removed request for marcelgerber May 23, 2024 06:53
Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! The only thing I could find is that with faceting (for example 2x2), this can make things worse at some screen widths.

If you want to look into that some more, feel free, but otherwise this is also fine.

I realize now that the faceting legend logic is different, as it is always placing the legend at the top.

@sophiamersmann sophiamersmann force-pushed the stacked-bar-hide-legend branch from 4ac4b65 to b7a54a5 Compare June 10, 2024 10:49
@sophiamersmann sophiamersmann force-pushed the discrete-bar-mobile-legend branch from 3114651 to e2a2fa1 Compare June 10, 2024 10:49
Copy link
Member Author

sophiamersmann commented Jun 10, 2024

Merge activity

  • Jun 10, 7:44 AM EDT: @sophiamersmann started a stack merge that includes this pull request via Graphite.
  • Jun 10, 7:47 AM EDT: Graphite rebased this pull request as part of a merge.
  • Jun 10, 7:49 AM EDT: Graphite rebased this pull request as part of a merge.
  • Jun 10, 7:51 AM EDT: @sophiamersmann merged this pull request with Graphite.

@sophiamersmann sophiamersmann force-pushed the stacked-bar-hide-legend branch from b7a54a5 to 8a30d59 Compare June 10, 2024 11:45
Base automatically changed from stacked-bar-hide-legend to master June 10, 2024 11:46
@sophiamersmann sophiamersmann force-pushed the discrete-bar-mobile-legend branch from e2a2fa1 to ce77a8b Compare June 10, 2024 11:47
@sophiamersmann sophiamersmann force-pushed the discrete-bar-mobile-legend branch from ce77a8b to 2457b47 Compare June 10, 2024 11:48
@sophiamersmann sophiamersmann merged commit 84ebb0c into master Jun 10, 2024
12 of 13 checks passed
@sophiamersmann sophiamersmann deleted the discrete-bar-mobile-legend branch June 10, 2024 11:51
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.

3 participants