Update d3 to v6.7.0

This commit is contained in:
Maximilian Krög
2021-05-23 17:06:00 +02:00
parent b49d94ce90
commit ad8c704e4a
3 changed files with 7 additions and 5 deletions

View File

@@ -180,7 +180,8 @@ function plot(resolution, counts, threshold) {
})
.attr('height', yScale);
bar.on('mousemove', function (count, index) {
bar.on('mousemove', function () {
const index = bar.nodes().indexOf(this);
const threshold = counts.min + index * counts.delta;
if (raster.get('threshold') !== threshold) {
raster.set('threshold', threshold);
@@ -188,7 +189,8 @@ function plot(resolution, counts, threshold) {
}
});
bar.on('mouseover', function (count, index) {
bar.on('mouseover', function (event) {
const index = bar.nodes().indexOf(this);
let area = 0;
for (let i = counts.values.length - 1; i >= index; --i) {
area += resolution * resolution * counts.values[i];
@@ -198,7 +200,7 @@ function plot(resolution, counts, threshold) {
tip
.transition()
.style('left', chartRect.left + index * barWidth + barWidth / 2 + 'px')
.style('top', d3.event.y - 60 + 'px')
.style('top', event.y - 60 + 'px')
.style('opacity', 1);
});