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): display line/bar chart icon depending on whether it's c… #2777

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented Oct 16, 2023

Alternative fix for #2769, closes #2769.

@sophiamersmann I checked, and all uses of isLineChartThatTurnedIntoDiscreteBar already guard against the situation where we're on the map tab, so ideally this shouldn't change the behavior (🤞🏻), and we don't need to introduce the isAuthoredAsLineChartThatTurnedIntoDiscreteBar property.

We can also get rid of the whole previousChartIcon logic, too.

One thing to watch out for, though, is that for time bounds in grapher there are two different types: There are "restricted" ones (i.e. natural numbers) and "unrestricted" ones (basically, natural numbers and ±Infinity).

minTime and maxTime are unrestriced, i.e. we can end up in situations like:

  • minTime = -Infinity, maxTime = Infinity, resolved time span is 1980..1980
  • minTime = -Infinity, maxTime = 1980, resolved time span is also 1980..1980
  • ... you get the drill

For this reason, it's important to also "resolve" minTime and maxTime, and we do this using findClosestTime.

Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

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

Works perfectly! Thanks so much for looking into this and coming up with a nice solution 🙌🏻

@marcelgerber marcelgerber merged commit e074163 into master Oct 17, 2023
20 checks passed
@marcelgerber marcelgerber deleted the line-chart-collapsed-icon branch October 17, 2023 07:43
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