From f57bef5317f47dfc59a5bac64eddf78cf1a695a2 Mon Sep 17 00:00:00 2001 From: Paul Pestov <10750176+paulpestov@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:04:11 +0100 Subject: [PATCH] fix: display tooltips in workflow metric charts --- .../timeline/MetricAverageChart.vue | 11 ++-------- src/components/timeline/MetricChart.vue | 8 +++++++- src/helpers/metric-chart-tooltip-content.ts | 20 +++++++++++++++++++ src/i18n.ts | 8 ++++++++ src/locales/de.json | 3 ++- src/locales/en.json | 3 ++- src/main.js | 8 +------- 7 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 src/helpers/metric-chart-tooltip-content.ts create mode 100644 src/i18n.ts diff --git a/src/components/timeline/MetricAverageChart.vue b/src/components/timeline/MetricAverageChart.vue index 92e2df6..fd246ca 100644 --- a/src/components/timeline/MetricAverageChart.vue +++ b/src/components/timeline/MetricAverageChart.vue @@ -5,7 +5,7 @@ import TimelineChart from "@/components/timeline/TimelineChart.vue" import type {EvaluationResultsDocumentWide, EvaluationRun, TimelineChartDataPoint, Workflow} from "@/types" import { getMaxValueOfMetric } from '@/helpers/metrics' import {useI18n} from "vue-i18n"; -import {createReadableMetricValue} from "@/helpers/utils"; +import { metricChartTooltipContent } from "@/helpers/metric-chart-tooltip-content"; const { t } = useI18n() @@ -61,14 +61,7 @@ function getTimelineData(runs: EvaluationRun[], metric: string): TimelineChartDa } function tooltipContent(d: TimelineChartDataPoint) { - return ` -