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

fix(grapher): fix chart icon on first load for line charts #2769

Closed
wants to merge 1 commit into from

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Oct 16, 2023

Fixes an issue where the chart icon changes unexpectedly.

This is what happens (see video below):

  • On first load, the user lands on the map
  • Since we're on the map, a single year is selected
  • With a single year selected, the line chart turns into a discrete bar chart
  • That's why we show the bar chart icon in the content switchers
  • If the user clicks on the chart tab, the time is reset and a start and an end year is now selected
  • The chart icon changes from a bar chart icon to a line chart icon (unexpected!)

We would rather show a line chart icon from the beginning.

Screen.Recording.2023-10-16.at.11.57.17.mov

Examples:

@sophiamersmann
Copy link
Member Author

@marcelgerber can you have a quick look at the code? Line charts turning into discrete bar charts make choosing the correct custom icon kind of complicated... I worry that the code I've written is difficult to understand :(

@marcelgerber
Copy link
Member

Nice! Alternative PR up at #2777, where I explain why I did things differently, and could get rid of some of the confusing parts :)

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.

2 participants