Fix raster example tooltips

This commit is contained in:
Maximilian Krög
2021-05-23 17:05:28 +02:00
parent 7511d9c324
commit b49d94ce90

View File

@@ -195,18 +195,18 @@ function plot(resolution, counts, threshold) {
} }
tip.html(message(counts.min + index * counts.delta, area)); tip.html(message(counts.min + index * counts.delta, area));
tip.style('display', 'block'); tip.style('display', 'block');
tip.transition().style({ tip
left: chartRect.left + index * barWidth + barWidth / 2 + 'px', .transition()
top: d3.event.y - 60 + 'px', .style('left', chartRect.left + index * barWidth + barWidth / 2 + 'px')
opacity: 1, .style('top', d3.event.y - 60 + 'px')
}); .style('opacity', 1);
}); });
bar.on('mouseout', function () { bar.on('mouseout', function () {
tip tip
.transition() .transition()
.style('opacity', 0) .style('opacity', 0)
.each('end', function () { .on('end', function () {
tip.style('display', 'none'); tip.style('display', 'none');
}); });
}); });