Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
fix: height off tooltip should be element height
Browse files Browse the repository at this point in the history
  • Loading branch information
niekvanstaveren committed Feb 18, 2020
1 parent 317b93a commit ccde196
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export default function supernova(env) {
selectionsAndTransform,
selectionState,
useTransitions: expandedState.useTransitions,
element,
});
}
}, [expandedState, objectData, selectionState]);
Expand Down
4 changes: 2 additions & 2 deletions src/tree/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function box(
selectionState,
selectionsAndTransform,
navigationMode,
height
element
) {
const {
cardWidth,
Expand Down Expand Up @@ -98,7 +98,7 @@ export default function box(
function getTooltipStyle(d) {
const halfCardWidth = cardWidth / 2;
const halfTooltipWidth = tooltipWidth / 2;
return `bottom:${height -
return `bottom:${element.clientHeight -
(y(d) * selectionsAndTransform.transform.zoom + selectionsAndTransform.transform.y - tooltipPadding)}px;left:${x(
d
) *
Expand Down
3 changes: 2 additions & 1 deletion src/tree/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const paintTree = ({
selectionsAndTransform,
selectionState,
useTransitions,
element,
}) => {
const { svg, divBox, allNodes, positioning, width, height, tooltip } = objectData;
const { navigationMode } = allNodes.data;
Expand All @@ -60,7 +61,7 @@ export const paintTree = ({
selectionState,
selectionsAndTransform,
navigationMode,
height
element
);
// Create the lines (links) between the nodes
const node = svg
Expand Down

0 comments on commit ccde196

Please sign in to comment.