refactor(nodes): only use node internals
This commit is contained in:
@@ -41,8 +41,9 @@ const useZoomPanHelper = (): ZoomPanHelperFunctions => {
|
||||
d3Zoom.transform(d3Selection, nextTransform);
|
||||
},
|
||||
fitView: (options: FitViewParams = { padding: DEFAULT_PADDING, includeHiddenNodes: false }) => {
|
||||
const { nodes, width, height, minZoom, maxZoom } = store.getState();
|
||||
|
||||
const { nodeInternals, width, height, minZoom, maxZoom } = store.getState();
|
||||
// @TODO: work with nodeInternals instead of converting it to an array
|
||||
const nodes = Array.from(nodeInternals).map(([_, node]) => node);
|
||||
if (!nodes.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user