Sankey Tooltip fix (#1748) (#1750)

.layer{X,Y} gives viewport offset, moved to node offset using .offset{X,Y}
This commit is contained in:
David Dolphin 2016-12-02 22:14:39 -08:00 committed by GitHub
parent 09d597f3ad
commit b045075a96

View File

@ -89,8 +89,8 @@ function sankeyVis(slice) {
.html(function () { return getTooltipHtml(d); })
.transition()
.duration(200)
.style('left', (d3.event.layerX + 10) + 'px')
.style('top', (d3.event.layerY + 10) + 'px')
.style('left', (d3.event.offsetX + 10) + 'px')
.style('top', (d3.event.offsetY + 10) + 'px')
.style('opacity', 0.95);
}