From 4c73b356b894928f79395586758a792f4ba8531c Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 19 Feb 2024 12:56:07 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20(grapher)=20rename=20dodMarker?= =?UTF-8?q?=20->=20detailsMarker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/MarkdownTextWrap/MarkdownTextWrap.tsx | 8 ++++---- .../grapher/src/axis/AxisViews.tsx | 20 +++++++++---------- .../grapher/src/footer/Footer.tsx | 2 +- .../grapher/src/header/Header.tsx | 2 +- .../grapher/src/lineCharts/LineChart.tsx | 2 +- .../src/scatterCharts/ScatterPlotChart.tsx | 2 +- .../src/stackedCharts/MarimekkoChart.tsx | 2 +- .../src/stackedCharts/StackedAreaChart.tsx | 2 +- .../src/stackedCharts/StackedBarChart.tsx | 2 +- .../types/src/grapherTypes/GrapherTypes.ts | 10 ++++++---- 10 files changed, 27 insertions(+), 25 deletions(-) diff --git a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx index 39162079d6a..d00ac03367e 100644 --- a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx +++ b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx @@ -642,15 +642,15 @@ export class MarkdownTextWrap extends React.Component { y: number, { textProps, - dodMarker = "superscript", + detailsMarker = "superscript", }: { textProps?: React.SVGProps - dodMarker?: DetailsMarker + detailsMarker?: DetailsMarker } = {} ): JSX.Element | null { const { fontSize, lineHeight } = this const lines = - dodMarker === "superscript" + detailsMarker === "superscript" ? this.svgLinesWithDodReferenceNumbers : this.svgLines if (lines.length === 0) return null @@ -690,7 +690,7 @@ export class MarkdownTextWrap extends React.Component { ))} {/* SVG doesn't support dotted underlines, so we draw them manually */} - {dodMarker === "underline" && + {detailsMarker === "underline" && lines.map((line, lineIndex) => { const y = (getLineY(lineIndex) + 2).toFixed(1) let currWidth = 0 diff --git a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx index c9aeef06acf..12dc378a726 100644 --- a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx +++ b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx @@ -157,7 +157,7 @@ interface DualAxisViewProps { labelColor?: string tickColor?: string lineWidth?: number - dodMarker?: DetailsMarker + detailsMarker?: DetailsMarker } @observer @@ -169,7 +169,7 @@ export class DualAxisComponent extends React.Component { labelColor, tickColor, lineWidth, - dodMarker, + detailsMarker, } = this.props const { bounds, horizontalAxis, verticalAxis, innerBounds } = dualAxis @@ -195,7 +195,7 @@ export class DualAxisComponent extends React.Component { verticalAxis={verticalAxis} labelColor={labelColor} tickColor={tickColor} - dodMarker={dodMarker} + detailsMarker={detailsMarker} /> ) @@ -208,7 +208,7 @@ export class DualAxisComponent extends React.Component { labelColor={labelColor} tickColor={tickColor} tickMarkWidth={lineWidth} - dodMarker={dodMarker} + detailsMarker={detailsMarker} /> ) @@ -229,10 +229,10 @@ export class VerticalAxisComponent extends React.Component<{ verticalAxis: VerticalAxis labelColor?: string tickColor?: string - dodMarker?: DetailsMarker + detailsMarker?: DetailsMarker }> { render(): JSX.Element { - const { bounds, verticalAxis, labelColor, tickColor, dodMarker } = + const { bounds, verticalAxis, labelColor, tickColor, detailsMarker } = this.props const { tickLabels, labelTextWrap } = verticalAxis @@ -247,7 +247,7 @@ export class VerticalAxisComponent extends React.Component<{ transform: "rotate(-90)", fill: labelColor || GRAPHER_DARK_TEXT, }, - dodMarker, + detailsMarker, } )} {tickLabels.map((label, i) => { @@ -285,7 +285,7 @@ export class HorizontalAxisComponent extends React.Component<{ labelColor?: string tickColor?: string tickMarkWidth?: number - dodMarker?: DetailsMarker + detailsMarker?: DetailsMarker }> { @computed get scaleType(): ScaleType { return this.props.axis.scaleType @@ -312,7 +312,7 @@ export class HorizontalAxisComponent extends React.Component<{ labelColor, tickColor, tickMarkWidth, - dodMarker, + detailsMarker, } = this.props const { tickLabels, labelTextWrap: label, labelOffset, orient } = axis const horizontalAxisLabelsOnTop = orient === Position.top @@ -348,7 +348,7 @@ export class HorizontalAxisComponent extends React.Component<{ textProps: { fill: labelColor || GRAPHER_DARK_TEXT, }, - dodMarker, + detailsMarker, } )} {tickMarks} diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.tsx index 60989fdc3f9..41e74cb021e 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.tsx @@ -771,7 +771,7 @@ export class StaticFooter extends Footer { note.renderSVG( targetX, targetY + sources.height + this.verticalPadding, - { dodMarker: this.manager.detailsMarkerInSvg } + { detailsMarker: this.manager.detailsMarkerInSvg } )} {showLicenseNextToSources ? licenseAndOriginUrl.render( diff --git a/packages/@ourworldindata/grapher/src/header/Header.tsx b/packages/@ourworldindata/grapher/src/header/Header.tsx index c9c5a97a6b0..353dd39c113 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.tsx @@ -305,7 +305,7 @@ export class StaticHeader extends Header { textProps: { fill: manager.secondaryColorInStaticCharts, }, - dodMarker: this.manager.detailsMarkerInSvg, + detailsMarker: this.manager.detailsMarkerInSvg, } )} diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index 8fd54a294b0..748e8af3694 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -796,7 +796,7 @@ export class LineChart ? GRAPHER_AXIS_LINE_WIDTH_THICK : GRAPHER_AXIS_LINE_WIDTH_DEFAULT } - dodMarker={manager.detailsMarkerInSvg} + detailsMarker={manager.detailsMarkerInSvg} /> {comparisonLines.map((line, index) => ( diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx index 06e47b51521..72f05d7b42d 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx @@ -791,7 +791,7 @@ export class ScatterPlotChart ? GRAPHER_AXIS_LINE_WIDTH_THICK : GRAPHER_AXIS_LINE_WIDTH_DEFAULT } - dodMarker={manager.detailsMarkerInSvg} + detailsMarker={manager.detailsMarkerInSvg} /> {comparisonLines && comparisonLines.map((line, i) => ( diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx index 31da4deb744..e9446b247b8 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx @@ -1008,7 +1008,7 @@ export class MarimekkoChart ? GRAPHER_AXIS_LINE_WIDTH_THICK : GRAPHER_AXIS_LINE_WIDTH_DEFAULT } - dodMarker={manager.detailsMarkerInSvg} + detailsMarker={manager.detailsMarkerInSvg} /> {this.renderBars()} diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx index 90c3dd95968..5025c8a2d4b 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx @@ -542,7 +542,7 @@ export class StackedAreaChart ? GRAPHER_AXIS_LINE_WIDTH_THICK : GRAPHER_AXIS_LINE_WIDTH_DEFAULT } - dodMarker={manager.detailsMarkerInSvg} + detailsMarker={manager.detailsMarkerInSvg} /> {showLegend && } diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx index 1c5079ccc92..c59f5ac01e9 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx @@ -450,7 +450,7 @@ export class StackedBarChart bounds={bounds} verticalAxis={verticalAxis} labelColor={manager.secondaryColorInStaticCharts} - dodMarker={manager.detailsMarkerInSvg} + detailsMarker={manager.detailsMarkerInSvg} />