Skip to content

Commit

Permalink
center widget on data change
Browse files Browse the repository at this point in the history
  • Loading branch information
Aykut Saraç committed Oct 26, 2022
1 parent e7fe70e commit c76da1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ const GraphComponent = ({
requestAnimationFrame(() => {
setTimeout(() => {
setLoading(false);
setTimeout(() => changeRatio > 100 && centerView(), 0);
setTimeout(() => (changeRatio > 100 || isWidget) && centerView(), 0);
}, 0);
});
}
},
[centerView, setLoading, size.height, size.width]
[centerView, isWidget, setLoading, size.height, size.width]
);

const onCanvasClick = React.useCallback(() => {
Expand Down

0 comments on commit c76da1f

Please sign in to comment.