Closed bogdancss closed 6 years ago
I am trying to get the current word coordinates, so I can place a rect behind it on hover.
rect
text.on('mouseover', function(d) { let word = d3.select(this); let bbox = word.node().getBBox(); let boundRect = word.node().getBoundingClientRect(); }
text.on('mouseover', function(d) {
let word = d3.select(this);
let bbox = word.node().getBBox();
let boundRect = word.node().getBoundingClientRect();
}
I trying to make sense of these coordinates, but they all seem to be very hectic. Can someone provide any sort of pointers on how to get the current word coordinates in relation the the svg?
Sorry, these GitHub issues are for bug reports/feature requests only. Please try StackOverflow if you need general help.
I am trying to get the current word coordinates, so I can place a
rect
behind it on hover.text.on('mouseover', function(d) {
let word = d3.select(this);
let bbox = word.node().getBBox();
let boundRect = word.node().getBoundingClientRect();
}
I trying to make sense of these coordinates, but they all seem to be very hectic. Can someone provide any sort of pointers on how to get the current word coordinates in relation the the svg?