Skip to content

Commit 040e8c2

Browse files
🐛 (admin) color scale controls are unresponsive (#4164)
1 parent 2dbdc99 commit 040e8c2

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
EntityName,
4141
OwidVariableRow,
4242
OwidTableSlugs,
43-
colorScaleConfigDefaults,
4443
VerticalAlign,
4544
} from "@ourworldindata/types"
4645
import { OwidTable, CoreColumn } from "@ourworldindata/core-table"
@@ -504,10 +503,8 @@ export class MarimekkoChart
504503

505504
@computed get colorScaleConfig(): ColorScaleConfigDefaults | undefined {
506505
return (
507-
ColorScaleConfig.fromDSL(this.colorColumn.def) ?? {
508-
...colorScaleConfigDefaults,
509-
...this.manager.colorScale,
510-
}
506+
ColorScaleConfig.fromDSL(this.colorColumn.def) ??
507+
this.manager.colorScale
511508
)
512509
}
513510

packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
makeSafeForCSS,
99
sum,
1010
getRelativeMouse,
11-
colorScaleConfigDefaults,
1211
excludeUndefined,
1312
min,
1413
max,
@@ -627,10 +626,7 @@ export class StackedBarChart
627626
}
628627

629628
@computed get colorScaleConfig(): ColorScaleConfigDefaults | undefined {
630-
return {
631-
...colorScaleConfigDefaults,
632-
...this.manager.colorScale,
633-
}
629+
return this.manager.colorScale
634630
}
635631

636632
defaultBaseColorScheme = ColorSchemeName.stackedAreaDefault

packages/@ourworldindata/types/src/grapherTypes/GrapherTypes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,16 @@ export type ColorScaleConfigInterface = ColorScaleConfigDefaults
410410
// legendDescription?: string
411411
// }
412412

413-
export const colorScaleConfigDefaults = {
414-
binningStrategy: BinningStrategy.ckmeans,
415-
customNumericValues: [],
416-
customNumericLabels: [],
417-
customNumericColors: [],
418-
equalSizeBins: true,
419-
customCategoryColors: {},
420-
customCategoryLabels: {},
421-
customHiddenCategories: {},
422-
} satisfies ColorScaleConfigInterface
413+
// export const colorScaleConfigDefaults = {
414+
// binningStrategy: BinningStrategy.ckmeans,
415+
// customNumericValues: [],
416+
// customNumericLabels: [],
417+
// customNumericColors: [],
418+
// equalSizeBins: true,
419+
// customCategoryColors: {},
420+
// customCategoryLabels: {},
421+
// customHiddenCategories: {},
422+
// } satisfies ColorScaleConfigInterface
423423

424424
export interface ColorSchemeInterface {
425425
name: string

packages/@ourworldindata/types/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export {
7373
BinningStrategy,
7474
type ColorScaleConfigInterface,
7575
ColorSchemeName,
76-
colorScaleConfigDefaults,
7776
ChartTypeName,
7877
GrapherTabOption,
7978
StackMode,

0 commit comments

Comments
 (0)