Removed comments
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
0f19008405
commit
4ad86c67d8
|
@ -68,28 +68,18 @@ function getTooltipPosition(
|
|||
console.error("Failed to find parent SVG for tooltip!");
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
console.log(eventElement);
|
||||
console.log(rootSVG);
|
||||
console.log("parent is ", rootSVG.parentElement);
|
||||
const rootSVGLeft = rootSVG.getBoundingClientRect().left ?? 0;
|
||||
console.log(rootSVGLeft);
|
||||
|
||||
const parentDivLeft =
|
||||
rootSVG.parentElement?.getBoundingClientRect().left ?? 0;
|
||||
console.log(parentDivLeft);
|
||||
// const parentParentDivLeft =
|
||||
// eventElement.parentElement?.parentElement?.parentElement?.parentElement?.getBoundingClientRect()
|
||||
// .left ?? 0;
|
||||
// console.log(parentParentDivLeft);
|
||||
|
||||
// visx localPoint does not account for the horizontal shift due to centering of the parent element,
|
||||
// so manually add any shift from that
|
||||
const alignmentOffset = rootSVGLeft - parentDivLeft;
|
||||
console.log(alignmentOffset);
|
||||
|
||||
return {
|
||||
x: eventSvgCoords.x + alignmentOffset,
|
||||
y: eventSvgCoords.y,
|
||||
};
|
||||
}
|
||||
|
||||
export { TooltipWrapper, getTooltipPosition };
|
||||
|
|
Loading…
Reference in New Issue