On the plotted graph there are samopisny tooltips that work quite smoothly without any transformations:
Example of working without transformations
When it comes to transformations, it’s not clear how to lay out the position for the tooltips , so the following happens:
The function itself for calculating the position looks like this:
function setPosition(element) { let tooltip = document.getElementById('relation-chart__tooltip'); let zoomTransform = document .getElementById('zoom-wrapper') .getAttribute('transform'); let translate = []; let transform = []; let scale = 0; if (zoomTransform) { translate = zoomTransform.split(' '); scale = translate[1].match(/[+-]?\d+(\.\d+)?/g)[0]; transform = translate[0].match(/[+-]?\d+(\.\d+)?/g); } else { scale = 1; transform = [0, 0] } let coords = { x: element.getAttribute('cx') - (tooltip.offsetWidth / 2) + (parseFloat(transform[0]) / 6), y: element.getAttribute('cy') - tooltip.offsetHeight - 20 + (parseFloat(transform[1]) / 6) }; tooltip.style.transform = `translate(${coords.x}px, ${coords.y}px) scale(${scale})`; } where through zoomTransform checked whether the transformation is applied. The formulas themselves are appropriately in the coords object.
I put the project on hosting: Schedule Bandler used Webpack, in the console on hovering the circle will display an object with a link to the function itself:
where coordX, coordY are coordinates coordinatess.x coords.x, coords.y , scale and transform are transformations respectively.
The g.zoom-wrapper element is g.zoom-wrapper :
Actually, the question is how to calculate the position for the tooltips
PS I tried to explain everything as accessible and understandable as possible. I hope it turned out :)

