From cb15f223774beaf86154b3dddf0ba350087a095f Mon Sep 17 00:00:00 2001 From: Noel Chen Date: Mon, 31 Oct 2022 21:58:16 -0400 Subject: [PATCH] more understandable tooltip --- .../FineGrainedAnalysis/FineGrainedBarChart.tsx | 2 ++ .../Analysis/AnalysisReport/OverallMetricsBarChart.tsx | 2 ++ frontend/src/components/Analysis/BarChart/index.tsx | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Analysis/AnalysisReport/FineGrainedAnalysis/FineGrainedBarChart.tsx b/frontend/src/components/Analysis/AnalysisReport/FineGrainedAnalysis/FineGrainedBarChart.tsx index 20e4ea28..ff9ca424 100644 --- a/frontend/src/components/Analysis/AnalysisReport/FineGrainedAnalysis/FineGrainedBarChart.tsx +++ b/frontend/src/components/Analysis/AnalysisReport/FineGrainedAnalysis/FineGrainedBarChart.tsx @@ -83,6 +83,8 @@ export function FineGrainedBarChart(props: Props) { title={title} seriesNames={systemNames} xAxisData={bucketNames} + xAxisName={resultFirst.featureDescription} + yAxisName={resultFirst.metricName} seriesDataList={resultsValues} seriesLabelsList={resultsValues} numbersOfSamplesList={resultsNumbersOfSamples} diff --git a/frontend/src/components/Analysis/AnalysisReport/OverallMetricsBarChart.tsx b/frontend/src/components/Analysis/AnalysisReport/OverallMetricsBarChart.tsx index 73e328f3..bfe86b8f 100644 --- a/frontend/src/components/Analysis/AnalysisReport/OverallMetricsBarChart.tsx +++ b/frontend/src/components/Analysis/AnalysisReport/OverallMetricsBarChart.tsx @@ -49,6 +49,8 @@ export function OverallMetricsBarChart({ title="Overall Performance" seriesNames={systemNames} xAxisData={metricNames} + xAxisName="metric" + yAxisName="score" seriesDataList={resultsValues} seriesLabelsList={resultsValues} confidenceScoresList={resultsConfidenceScores} diff --git a/frontend/src/components/Analysis/BarChart/index.tsx b/frontend/src/components/Analysis/BarChart/index.tsx index 559f515c..c31e39d0 100644 --- a/frontend/src/components/Analysis/BarChart/index.tsx +++ b/frontend/src/components/Analysis/BarChart/index.tsx @@ -39,6 +39,8 @@ interface Props { title: string; seriesNames: string[]; xAxisData: string[]; + xAxisName: string; + yAxisName: string; seriesDataList: number[][]; seriesLabelsList: number[][]; confidenceScoresList: [number, number][][]; @@ -51,6 +53,8 @@ export function BarChart(props: Props) { title, seriesNames, xAxisData, + xAxisName, + yAxisName, seriesDataList, seriesLabelsList, numbersOfSamplesList, @@ -189,7 +193,10 @@ export function BarChart(props: Props) { decimalPlaces )}, ${confidenceScores[dataIndex][1].toFixed(decimalPlaces)}]` : ""; - let ret = `name: ${param.name}
value: ${data} ${confidenceScoreRange}`; + const xAxisTickLabel = param.name.replace("|", "-"); + let ret = `${xAxisName}: ${xAxisTickLabel}
\ + mean value: ${data}
\ + confidence interval: ${confidenceScoreRange}`; if (numbersOfSamples[dataIndex] > 0) { ret = `${ret}
sample size: ${numbersOfSamples[dataIndex]}`; } @@ -216,6 +223,7 @@ export function BarChart(props: Props) { ], yAxis: [ { + name: yAxisName, type: "value", // TODO: get min max from SDK? // min: 0,