Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

center widget on data change

Aykut Saraçc76da1fb22fe
diff --git a/src/components/Graph/index.tsx b/src/components/Graph/index.tsx
index 2882d823..74a0f72b 100644
--- a/src/components/Graph/index.tsx
+++ b/src/components/Graph/index.tsx
@@ -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(() => {