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

🐛 crude fix for map color animation resulting in wrong colors #2643

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions explorer/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ export class Explorer
grapher.reset()
this.updateGrapherFromExplorerCommon()
grapher.updateFromObject(config)
grapher.forceDisableIntroAnimation = true
await grapher.downloadLegacyDataFromOwidVariableIds()

let grapherTable = grapher.inputTable
Expand Down
8 changes: 7 additions & 1 deletion packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ export class Grapher
@observable sortBy?: SortBy
@observable sortOrder?: SortOrder
@observable sortColumnSlug?: string
// TODO: this is a crude fix that is used to turn off the intro
// animation in maps (fading colors in from gray) because
// they end up with the wrong target colors (i.e. the colors
// are initially correct but then the animation screws them up).
// This flag can be removed once the animation bug is properly fixed.
@observable forceDisableIntroAnimation: boolean = false

owidDataset?: MultipleOwidVariableDataDimensionsMap = undefined // This is used for passing data for testing

Expand Down Expand Up @@ -1608,7 +1614,7 @@ export class Grapher
}

@computed get disableIntroAnimation(): boolean {
return this.isExportingtoSvgOrPng
return this.isExportingtoSvgOrPng || this.forceDisableIntroAnimation
}

@computed get mapConfig(): MapConfig {
Expand Down
Loading