Skip to content

Commit

Permalink
🐛 (admin) color scale controls are unresponsive
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Nov 14, 2024
1 parent 7398cd8 commit 810bd5f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
EntityName,
OwidVariableRow,
OwidTableSlugs,
colorScaleConfigDefaults,
VerticalAlign,
} from "@ourworldindata/types"
import { OwidTable, CoreColumn } from "@ourworldindata/core-table"
Expand Down Expand Up @@ -504,10 +503,8 @@ export class MarimekkoChart

@computed get colorScaleConfig(): ColorScaleConfigDefaults | undefined {
return (
ColorScaleConfig.fromDSL(this.colorColumn.def) ?? {
...colorScaleConfigDefaults,
...this.manager.colorScale,
}
ColorScaleConfig.fromDSL(this.colorColumn.def) ??
this.manager.colorScale
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
makeSafeForCSS,
sum,
getRelativeMouse,
colorScaleConfigDefaults,
excludeUndefined,
min,
max,
Expand Down Expand Up @@ -627,10 +626,7 @@ export class StackedBarChart
}

@computed get colorScaleConfig(): ColorScaleConfigDefaults | undefined {
return {
...colorScaleConfigDefaults,
...this.manager.colorScale,
}
return this.manager.colorScale
}

defaultBaseColorScheme = ColorSchemeName.stackedAreaDefault
Expand Down
20 changes: 10 additions & 10 deletions packages/@ourworldindata/types/src/grapherTypes/GrapherTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,16 @@ export type ColorScaleConfigInterface = ColorScaleConfigDefaults
// legendDescription?: string
// }

export const colorScaleConfigDefaults = {
binningStrategy: BinningStrategy.ckmeans,
customNumericValues: [],
customNumericLabels: [],
customNumericColors: [],
equalSizeBins: true,
customCategoryColors: {},
customCategoryLabels: {},
customHiddenCategories: {},
} satisfies ColorScaleConfigInterface
// export const colorScaleConfigDefaults = {
// binningStrategy: BinningStrategy.ckmeans,
// customNumericValues: [],
// customNumericLabels: [],
// customNumericColors: [],
// equalSizeBins: true,
// customCategoryColors: {},
// customCategoryLabels: {},
// customHiddenCategories: {},
// } satisfies ColorScaleConfigInterface

export interface ColorSchemeInterface {
name: string
Expand Down
1 change: 0 additions & 1 deletion packages/@ourworldindata/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export {
BinningStrategy,
type ColorScaleConfigInterface,
ColorSchemeName,
colorScaleConfigDefaults,
ChartTypeName,
GrapherTabOption,
StackMode,
Expand Down

0 comments on commit 810bd5f

Please sign in to comment.