Skip to content

Commit 788c53a

Browse files
committed
Fix D3FC exception path formatting nulls, fix 4.0.0 CI regression
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent e429a78 commit 788c53a

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

packages/viewer-d3fc/src/ts/axis/valueFormatter.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ export const getValueFormatterForRange = (min: number, max: number) => {
1818
let precision = Math.ceil(Math.abs(Math.log10(max - min))) + 1;
1919

2020
return (d: number) => {
21-
return Math.abs(d) >= SI_MIN
22-
? d3.format(".3s")(d)
23-
: Number.isInteger(d)
24-
? d3.format(",.0f")(d)
25-
: d3.format(`,.${precision}f`)(d);
21+
try {
22+
return Math.abs(d) >= SI_MIN
23+
? d3.format(".3s")(d)
24+
: Number.isInteger(d)
25+
? d3.format(",.0f")(d)
26+
: d3.format(`,.${precision}f`)(d);
27+
} catch (e) {
28+
console.warn(e);
29+
return "<err>";
30+
}
2631
};
2732
};

tools/scripts/bench.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import sh from "./sh.mjs";
1515
import { get_scope } from "./sh_perspective.mjs";
1616

1717
dotenv.config({ path: "./.perspectiverc", quiet: true });
18-
1918
const scope = get_scope();
20-
if (scope.includes("perspective")) {
21-
sh`pnpm run --recursive --filter perspective-bench bench_js`.runSync();
22-
} else if (scope.includes("perspective-python")) {
23-
sh`pnpm run --recursive --filter perspective-bench bench_python`.runSync();
19+
if (scope.includes("client")) {
20+
sh`pnpm run --recursive --filter bench bench_js`.runSync();
21+
} else if (scope.includes("python")) {
22+
sh`pnpm run --recursive --filter bench bench_python`.runSync();
2423
}

0 commit comments

Comments
 (0)