From 57822c6de912507a9451f14d65d32b42b5b8e293 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Thu, 21 Sep 2023 23:39:31 +0200 Subject: [PATCH] :bug: crude fix for map color animation resulting in wrong colors --- explorer/Explorer.tsx | 1 + packages/@ourworldindata/grapher/src/core/Grapher.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/explorer/Explorer.tsx b/explorer/Explorer.tsx index 3c493124e58..d4c01b1a222 100644 --- a/explorer/Explorer.tsx +++ b/explorer/Explorer.tsx @@ -573,6 +573,7 @@ export class Explorer grapher.reset() this.updateGrapherFromExplorerCommon() grapher.updateFromObject(config) + grapher.forceDisableIntroAnimation = true await grapher.downloadLegacyDataFromOwidVariableIds() let grapherTable = grapher.inputTable diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 46efcf99091..7166459c994 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -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 @@ -1608,7 +1614,7 @@ export class Grapher } @computed get disableIntroAnimation(): boolean { - return this.isExportingtoSvgOrPng + return this.isExportingtoSvgOrPng || this.forceDisableIntroAnimation } @computed get mapConfig(): MapConfig {