Skip to content

Commit

Permalink
find the non-empty edge when to panTo
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyunw-uber committed Sep 5, 2023
1 parent 053c6e1 commit a7a1e19
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/graph-view-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1943,9 +1943,11 @@ class GraphViewV2 extends React.Component<IGraphViewProps, IGraphViewState> {
return;
}

const edge = this.entities.querySelector(
`[id='edge-${source}-${target}-container']`
);
const edge =
this.entities
.querySelectorAll(`[id='edge-${source}-${target}-container']`)
.find(element => !!element.innerHTML) ||
this.entities.querySelector(`[id='edge-${source}-${target}-container']`);

this.panToEntity(edge, zoom);
}
Expand Down

0 comments on commit a7a1e19

Please sign in to comment.