From cef92ad554f6fa6cab74a3de0065af30a78ac692 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Tue, 26 Jan 2021 13:48:36 +0100 Subject: [PATCH] No clicking on empty bins in the Histogram --- ts/graphs/histogram-graph.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/graphs/histogram-graph.ts b/ts/graphs/histogram-graph.ts index 4cf1a0d76..8d3a32caf 100644 --- a/ts/graphs/histogram-graph.ts +++ b/ts/graphs/histogram-graph.ts @@ -162,6 +162,9 @@ export function histogramGraph( .on("mouseout", hideTooltip); if (data.onClick) { - hoverzone.attr("class", "clickable").on("click", data.onClick); + hoverzone + .filter((d: Bin) => d.length > 0) + .attr("class", "clickable") + .on("click", data.onClick); } }