fix(ui) - path analysis hover issue

This commit is contained in:
Shekar Siri 2023-10-23 15:50:45 +02:00
parent 13827e3607
commit de2faa7fbd
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ import NodeButton from './NodeButton';
import NodeDropdown from './NodeDropdown';
function CustomNode(props: any) {
const { x, y, width, height, index, payload, containerWidth } = props;
const { x, y, width, height, index, payload, containerWidth, activeNodes } = props;
const isOut = x + width + 6 > containerWidth;
return (

View file

@ -79,7 +79,7 @@ const SankeyChart: React.FC<Props> = ({
const { payload } = linkData;
const pathFromLinkId = findPathFromLinkId(payload.id);
setHoveredLinks(pathFromLinkId);
setHoveredLinks(pathFromLinkId.reverse());
};
@ -125,7 +125,7 @@ const SankeyChart: React.FC<Props> = ({
<Sankey
data={data}
iterations={128}
node={<CustomNode />}
node={<CustomNode activeNodes={highlightedLinks.map(index => data.nodes[data.links[index].target])} />}
sort={true}
onClick={clickHandler}
link={({ source, target, ...linkProps }, index) => (