From e7a96966409c4c63e0bb6a7635c5b14c49faf578 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 7 Jan 2025 15:17:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20rename=20isConnected=20to=20plot?= =?UTF-8?q?MarkersOnlyInLineChart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/DimensionCard.tsx | 13 ++++++++----- .../grapher/src/lineCharts/LineChart.tsx | 2 +- .../grapher/src/schema/grapher-schema.006.yaml | 4 ++-- .../types/src/OwidVariableDisplayConfigInterface.ts | 2 +- packages/@ourworldindata/utils/src/OwidVariable.ts | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/adminSiteClient/DimensionCard.tsx b/adminSiteClient/DimensionCard.tsx index d812d2ba16..87f69dbcdb 100644 --- a/adminSiteClient/DimensionCard.tsx +++ b/adminSiteClient/DimensionCard.tsx @@ -51,8 +51,8 @@ export class DimensionCard< this.onChange() } - @action.bound onIsConnected(value: boolean) { - this.props.dimension.display.isConnected = value + @action.bound onPlotMarkersOnly(value: boolean) { + this.props.dimension.display.plotMarkersOnlyInLineChart = value this.onChange() } @@ -259,9 +259,12 @@ export class DimensionCard< )} {grapher.isLineChart && ( )}
diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index e49474927c..911d4fb816 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -1316,7 +1316,7 @@ export class LineChart points, seriesName, isProjection: column.isProjection, - isConnected: column.display?.isConnected ?? true, + isConnected: !column.display?.plotMarkersOnlyInLineChart, color: seriesColor, } } diff --git a/packages/@ourworldindata/grapher/src/schema/grapher-schema.006.yaml b/packages/@ourworldindata/grapher/src/schema/grapher-schema.006.yaml index 4d47e18d50..18cc124752 100644 --- a/packages/@ourworldindata/grapher/src/schema/grapher-schema.006.yaml +++ b/packages/@ourworldindata/grapher/src/schema/grapher-schema.006.yaml @@ -266,11 +266,11 @@ properties: description: | Indicates if this time series is a forward projection (if yes then this is rendered differently in e.g. line charts) - isConnected: + plotMarkersOnlyInLineChart: type: boolean default: false description: | - Indicates if this time series should be connected with a line. Only relevant for line charts. + Indicates if data points should be connected with a line in a line chart name: type: string description: The display string for this variable diff --git a/packages/@ourworldindata/types/src/OwidVariableDisplayConfigInterface.ts b/packages/@ourworldindata/types/src/OwidVariableDisplayConfigInterface.ts index f44feaf8f9..6c7c0a182c 100644 --- a/packages/@ourworldindata/types/src/OwidVariableDisplayConfigInterface.ts +++ b/packages/@ourworldindata/types/src/OwidVariableDisplayConfigInterface.ts @@ -21,7 +21,7 @@ export interface OwidVariableDisplayConfigInterface { includeInTable?: boolean tableDisplay?: OwidVariableDataTableConfigInterface color?: string - isConnected?: boolean + plotMarkersOnlyInLineChart?: boolean } // todo: flatten onto the above diff --git a/packages/@ourworldindata/utils/src/OwidVariable.ts b/packages/@ourworldindata/utils/src/OwidVariable.ts index 74201954b6..7ffbb8e894 100644 --- a/packages/@ourworldindata/utils/src/OwidVariable.ts +++ b/packages/@ourworldindata/utils/src/OwidVariable.ts @@ -29,7 +29,7 @@ class OwidVariableDisplayConfigDefaults { @observable includeInTable? = true @observable tableDisplay?: OwidVariableDataTableConfigInterface @observable color?: string = undefined - @observable isConnected?: boolean = undefined + @observable plotMarkersOnlyInLineChart?: boolean = undefined } export class OwidVariableDisplayConfig