Skip to content

Commit f1d6d43

Browse files
committed
CSS fixes
1 parent d91693e commit f1d6d43

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

src/herbie/LocalError/newLocalError.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
font-size: 14px;
77
}
88

9-
.local-error {
9+
/* .local-error {
1010
padding: 2px 6px;
1111
border-radius: 4px;
12-
}
12+
} */
1313

1414
.high-error {
1515
background-color: rgba(255, 0, 0, 0.2); /* Light red for high errors */
@@ -29,4 +29,8 @@
2929
background-color: #fdf2f2; /* Very subtle pink background */
3030
border-radius: 3px;
3131
padding: 2px 4px;
32+
}
33+
34+
.local-error td:not(.program-col) {
35+
text-align: right;
3236
}

src/herbie/LocalError/newLocalError.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { LocalErrorTree } from "../HerbieTypes";
55
import "./newLocalError.css";
66

77
const opMap: Record<string,string> = {
8-
"+": "add",
9-
"-": "sub",
10-
"*": "mul",
11-
"/": "div"
8+
"+": "add (+)",
9+
"-": "subtract (-)",
10+
"*": "multiply (*)",
11+
"/": "divide (/)",
1212
};
1313

1414
function mapOp(e: string) {
@@ -98,7 +98,7 @@ function TreeRow({
9898
<span className="toggle-button">
9999
{isExpanded ? (
100100
<svg
101-
style={{ width: '15px', stroke: "var(--action-color)", transform: "rotate(180deg)" }}
101+
style={{ width: '15px', stroke: "var(--action-color)", transform: "rotate(180deg)", verticalAlign: "middle" }}
102102
viewBox="0 0 24 24"
103103
fill="none"
104104
xmlns="http://www.w3.org/2000/svg"
@@ -107,7 +107,7 @@ function TreeRow({
107107
</svg>
108108
) : (
109109
<svg
110-
style={{ width: '15px', stroke: "var(--action-color)" }}
110+
style={{ width: '15px', stroke: "var(--action-color)", verticalAlign: "middle" }}
111111
viewBox="0 0 24 24"
112112
fill="none"
113113
xmlns="http://www.w3.org/2000/svg"
@@ -120,14 +120,14 @@ function TreeRow({
120120
{isExpanded ? mapOp(node.e) : collapsedExpression}
121121
</span>
122122
</td>
123-
<td className="border px-4 py-2">{renderValue(node["actual-value"])}</td>
124-
<td className="border px-4 py-2">{renderValue(node["exact-value"])}</td>
125-
<td className="border px-4 py-2 emphasize-diff">{renderValue(node["abs-error-difference"])}</td>
126-
<td className="border px-4 py-2">
123+
<td>{renderValue(node["actual-value"])}</td>
124+
<td>{renderValue(node["exact-value"])}</td>
125+
<td>{renderValue(node["abs-error-difference"])}</td>
126+
<td>
127127
{parseFloat(node["percent-accuracy"]).toFixed(1)}%
128128
</td>
129-
<td className="border px-4 py-2">
130-
<span className={`local-error ${parseFloat(node["percent-accuracy"]) < 100 ? "high-error" : ""}`}>
129+
<td>
130+
<span className={`${parseFloat(node["percent-accuracy"]) < 100 ? "high-error" : ""}`}>
131131
{parseFloat(node["ulps-error"]).toFixed(1)}
132132
</span>
133133
</td>
@@ -167,25 +167,25 @@ function NewLocalError({ expressionId }: { expressionId: number }) {
167167

168168
if (!localError) {
169169
return (
170-
<div className="local-error not-computed">
170+
<div className="not-computed">
171171
<div>No local error computed for this expression. Select a point to compute.</div>
172172
</div>
173173
);
174174
}
175175

176176
return (
177-
<div className="overflow-x-auto p-4">
178-
<table className="min-w-full border border-gray-300 bg-white">
179-
<thead className="bg-gray-100">
177+
<div className="local-error">
178+
<table>
179+
<thead>
180180
<tr>
181-
<th className="border px-4 py-2 text-left program-col">Program</th>
182-
<th className="border px-4 py-2 text-left">R Value</th>
183-
<th className="border px-4 py-2 text-left">FP Value</th>
184-
<th className="border px-4 py-2 text-left emphasize-diff" title="Difference between R and FP values" >
181+
<th className="program-col">Program</th>
182+
<th>R Value</th>
183+
<th>FP Value</th>
184+
<th title="Difference between R and FP values" >
185185
Difference
186186
</th>
187-
<th className="border px-4 py-2 text-left">Accuracy</th>
188-
<th className="border px-4 py-2 text-left">Local Error</th>
187+
<th>Accuracy</th>
188+
<th>Local Error</th>
189189
</tr>
190190
</thead>
191191
<tbody>

0 commit comments

Comments
 (0)