Skip to content

Commit a8b0ce2

Browse files
committed
Misc alignment fixes
1 parent e7e1008 commit a8b0ce2

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

src/herbie/ErrorPlot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ function ErrorPlot() {
477477
</xhtml:div>
478478
</foreignObject>
479479
<foreignObject x=${xAdjusted + 40 + ""} y=${-28 + ""} height="20px" width="16px">
480-
<xhtml:a class="deselect" style="font-size: 16px;"></xhtml:a>
480+
<xhtml:a class="deselect" style="font-size: 16px;">×</xhtml:a>
481481
</foreignObject>`;
482482

483483
// Add copy functionality on click of '⧉' icon to get point values of all point variables

src/herbie/ExpressionTable.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
width: 80px; /* Fixed width to prevent resizing */
6060
display: flex;
6161
align-items: center; /* Center content vertically */
62-
justify-content: flex-end; /* Align text to the right */
6362
}
6463

6564
.speedup {
@@ -129,6 +128,13 @@
129128
padding-left: 25px;
130129
padding-right: 10px;
131130
align-items: center;
131+
button {
132+
font-size: 10px;
133+
}
134+
}
135+
136+
.expression-table .fas {
137+
vertical-align: middle;
132138
}
133139

134140
.expand-header {

src/herbie/ExpressionTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ function ExpressionTable() {
498498
setSelectedExprId(activeExp[0]);
499499
}
500500
}}>
501-
501+
×
502502
</button>
503503
</div>
504504
</div>

src/herbie/LocalError/newLocalError.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
display: none;
5050
}
5151

52+
.local-error thead {
53+
font-size: 12px;
54+
}
55+
5256
/* slightly darken the hovered row */
5357
.local-error tbody tr:hover {
5458
background-color: #f3f4f6; /* Light gray background on hover */

src/herbie/LocalError/newLocalError.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function TreeRow({
147147
</svg>
148148
)}
149149
</span>
150-
) : (<span style={{ width: '3px' , display: 'inline-block'}}></span>)}
150+
) : (<span style={{ width: '7px' , display: 'inline-block'}}></span>)}
151151
<div style={{
152152
display: "inline-block",
153153
}}>
@@ -230,6 +230,7 @@ function treeMapWithPath<T, U>(
230230
}
231231

232232
function NewLocalError({ expressionId }: { expressionId: number }) {
233+
const [selectedPoint] = HerbieContext.useGlobal(HerbieContext.SelectedPointContext);
233234
const [selectedPointsLocalError] = HerbieContext.useGlobal(HerbieContext.SelectedPointsLocalErrorContext);
234235
const [localError, setLocalError] = useState<LocalErrorTree | null>(null);
235236
const [errorPaths, setErrorPaths] = useState<number[][]>([]);
@@ -251,11 +252,19 @@ function NewLocalError({ expressionId }: { expressionId: number }) {
251252
}
252253
}, [selectedPointsLocalError, expressionId]);
253254

255+
if (!selectedPoint) {
256+
return (
257+
<div className="not-computed">
258+
<div><strong>Select a single point</strong> on the Local Error Plot to the left to compute subexpression error.</div>
259+
</div>
260+
);
261+
}
262+
254263
if (!localError || !pointErrorExp
255264
) {
256265
return (
257-
<div className="not-computed">
258-
<div>No local error computed for this expression. Select a point to compute.</div>
266+
<div className="loading">
267+
<div>Loading...</div>
259268
</div>
260269
);
261270
}

0 commit comments

Comments
 (0)