function toggleTooltip(d, bShow) {
if (bShow) {
let tpl = `Sentiment Mean: ${tooltipValueFormat(
d.sentiment_mean
)}<br>Frequency: ${tooltipValueFormat(d.freq)}`,
x = d3.event.pageX > width / 2 ? d3.event.pageX - 200 : d3.event.pageX;
elTooltip
.html(`<b>${d.ngrams}</b><br/><small>${tpl}</small>`)
.style("visibility", "visible")
.style("top", d3.event.pageY - 10 + "px")
.style("left", x + 10 + "px");
} else {
elTooltip.style("visibility", "hidden");
}
}