Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine barchart tooltip: more understandable tooltip #475

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export function OverallMetricsBarChart({
title="Overall Performance"
seriesNames={systemNames}
xAxisData={metricNames}
xAxisName="metric"
yAxisName="score"
seriesDataList={resultsValues}
seriesLabelsList={resultsValues}
confidenceScoresList={resultsConfidenceScores}
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/Analysis/BarChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ interface Props {
title: string;
seriesNames: string[];
xAxisData: string[];
xAxisName: string;
yAxisName: string;
seriesDataList: number[][];
seriesLabelsList: number[][];
confidenceScoresList: [number, number][][];
Expand All @@ -51,6 +53,8 @@ export function BarChart(props: Props) {
title,
seriesNames,
xAxisData,
xAxisName,
yAxisName,
seriesDataList,
seriesLabelsList,
numbersOfSamplesList,
Expand Down Expand Up @@ -189,7 +193,10 @@ export function BarChart(props: Props) {
decimalPlaces
)}, ${confidenceScores[dataIndex][1].toFixed(decimalPlaces)}]`
: "";
let ret = `name: ${param.name} <br /> value: ${data} ${confidenceScoreRange}`;
const xAxisTickLabel = param.name.replace("|", "-");
let ret = `${xAxisName}: ${xAxisTickLabel} <br />\
mean value: ${data} <br />\
confidence interval: ${confidenceScoreRange}`;
if (numbersOfSamples[dataIndex] > 0) {
ret = `${ret} <br /> sample size: ${numbersOfSamples[dataIndex]}`;
}
Expand All @@ -216,6 +223,7 @@ export function BarChart(props: Props) {
],
yAxis: [
{
name: yAxisName,
type: "value",
// TODO: get min max from SDK?
// min: 0,
Expand Down