Skip to content

Commit 8c14a21

Browse files
authored
feat: Use three sigfigs for histogram mouse hover (#37)
1 parent a3551da commit 8c14a21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/utils/CrossfilterHistogramPlot.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ export function CrossfilterHistogramPlot(
115115
.attr("height", 20)
116116
.style("fill", "white");
117117

118+
const fmt = type === "number"
119+
? d3.format(".3s")
120+
: tickFormatterForBins(type, bins);
118121
// `hovered` signal gets updated in mousemove event
119122
effect(() => {
120-
const fmt = tickFormatterForBins(type, bins);
121123
hoveredTick
122124
.attr("transform", `translate(${x(hovered.value || 0)},0)`)
123125
.attr("visibility", hovered.value ? "visible" : "hidden");

0 commit comments

Comments
 (0)