Skip to content

Commit 903e38c

Browse files
committed
Improve bias tag popup for two devices mode
1 parent f469415 commit 903e38c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

client/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@
14271427
font-family: var(--body-family);
14281428
font-size: var(--UI-Typography-body-xsmall-size);
14291429
line-height: var(--UI-Typography-body-xsmall-line-height);
1430-
white-space: pre-line;
1430+
white-space: pre-wrap;
14311431
text-align: left;
14321432
min-width: 200px;
14331433
max-width: 300px;

client/src/probability-lab/ui/render.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ function generateBiasTooltipText(def) {
7373

7474
// Check if uniform
7575
if (isUniformProbabilities(probabilities)) {
76-
return 'All outcomes are equally likely.';
76+
return ' All outcomes are equally likely.';
7777
}
7878

7979
// Check if one outcome is certain (probability = 1.0)
8080
const certainIndex = probabilities.findIndex((p) => nearlyEqual(p, 1.0));
8181
if (certainIndex !== -1) {
82-
return `Certain outcome: ${labels[certainIndex]}\nAll other outcomes are impossible.`;
82+
return ` Certain outcome: ${labels[certainIndex]}\n All other outcomes are impossible.`;
8383
}
8484

8585
// Find most and least likely outcomes
@@ -94,7 +94,7 @@ function generateBiasTooltipText(def) {
9494
}
9595
}
9696

97-
return `Most likely outcome: ${labels[maxIndex]}\nLeast likely outcome: ${labels[minIndex]}`;
97+
return ` Most likely outcome: ${labels[maxIndex]}\n Least likely outcome: ${labels[minIndex]}`;
9898
}
9999

100100
export function renderExperimentSetup(els, state) {
@@ -135,11 +135,11 @@ export function renderExperimentSetup(els, state) {
135135
const tooltipB = defB ? generateBiasTooltipText(defB) : '';
136136
let tooltipText = '';
137137
if (tooltipA && tooltipB) {
138-
tooltipText = `Device A: ${tooltipA}\nDevice B: ${tooltipB}`;
138+
tooltipText = `Device A:\n${tooltipA}\nDevice B:\n${tooltipB}`;
139139
} else if (tooltipA) {
140-
tooltipText = `Device A: ${tooltipA}`;
140+
tooltipText = `Device A:\n${tooltipA}`;
141141
} else if (tooltipB) {
142-
tooltipText = `Device B: ${tooltipB}`;
142+
tooltipText = `Device B:\n${tooltipB}`;
143143
}
144144
if (tooltipText) {
145145
els.biasSummary.setAttribute('data-tooltip', tooltipText);

0 commit comments

Comments
 (0)