From 1f3c2d96885fa7a8afdff685c8947c874202481b Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Mon, 2 Sep 2024 13:20:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(tooltip):=20add=20explanation?= =?UTF-8?q?=20test=20for=20tolerance=20notice=20(#3919)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/stackedCharts/MarimekkoChart.tsx | 6 +++++- .../grapher/src/stackedCharts/StackedDiscreteBarChart.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx index de44bc0db73..cf1b21edc9d 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx @@ -52,6 +52,7 @@ import { TooltipValue, TooltipState, makeTooltipRoundingNotice, + makeTooltipToleranceNotice, } from "../tooltip/Tooltip" import { HorizontalCategoricalColorLegend, @@ -992,7 +993,10 @@ export class MarimekkoChart ? timeColumn.formatValue(endTime) : undefined const toleranceNotice = targetNotice - ? { icon: TooltipFooterIcon.notice, text: targetNotice } + ? { + icon: TooltipFooterIcon.notice, + text: makeTooltipToleranceNotice(targetNotice), + } : undefined const columns = excludeUndefined([xColumn, yColumn]) diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx index e2120575f46..045b689bf47 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx @@ -56,6 +56,7 @@ import { TooltipState, TooltipTable, makeTooltipRoundingNotice, + makeTooltipToleranceNotice, } from "../tooltip/Tooltip" import { StackedPoint, StackedSeries } from "./StackedConstants" import { ColorSchemes } from "../color/ColorSchemes" @@ -813,7 +814,10 @@ export class StackedDiscreteBarChart : undefined const toleranceNotice = targetNotice - ? { icon: TooltipFooterIcon.notice, text: targetNotice } + ? { + icon: TooltipFooterIcon.notice, + text: makeTooltipToleranceNotice(targetNotice), + } : undefined const roundingNotice = this.formatColumn.roundsToSignificantFigures ? {