diff --git a/ts/graphs/calendar.ts b/ts/graphs/calendar.ts index f9214a53c..fbc2fe964 100644 --- a/ts/graphs/calendar.ts +++ b/ts/graphs/calendar.ts @@ -114,7 +114,7 @@ export function renderCalendar( maxCount = count; } } - console.log('sourceData', sourceData, dayMap) + console.log("sourceData", sourceData, dayMap); if (!maxCount) { setDataAvailable(svg, false); @@ -207,8 +207,13 @@ export function renderCalendar( showTooltip(tooltipText(d), x, y); }) .on("mouseout", hideTooltip) + .attr("class", (d: any): string => { + return d.count > 0 ? "clickable" : ""; + }) .on("click", function (this: any, d: any) { - dispatch("search", { query: `"prop:rated=${d.day}"` }); + if (d.count > 0) { + dispatch("search", { query: `"prop:rated=${d.day}"` }); + } }) .transition() .duration(800) diff --git a/ts/graphs/ease.ts b/ts/graphs/ease.ts index 05d3212fb..4f13e200f 100644 --- a/ts/graphs/ease.ts +++ b/ts/graphs/ease.ts @@ -64,7 +64,7 @@ export function prepareData( function makeQuery(data: HistogramData, binIdx: number): string { const bin = data.bins[binIdx]; const start = bin.x0!; - const end = (bin.x1! - 1); + const end = bin.x1! - 1; if (start === end) { return `"prop:ease=${start / 100}"`; @@ -85,7 +85,16 @@ export function prepareData( ]; return [ - { scale, bins, total, hoverText, makeQuery, colourScale, showArea: false, xTickFormat }, + { + scale, + bins, + total, + hoverText, + makeQuery, + colourScale, + showArea: false, + xTickFormat, + }, tableData, ]; }