refactor(graphview): put resize handling in its own hook

This commit is contained in:
moklick
2020-08-02 18:34:03 +02:00
parent 94a47ef97f
commit f6f3202b57
4 changed files with 50 additions and 44 deletions
+4 -2
View File
@@ -365,8 +365,10 @@ export const storeModel: StoreModel = {
}),
updateSize: action((state, size) => {
state.width = size.width;
state.height = size.height;
// when parent has no size we use these default values
// so that the calculations don't throw any errors
state.width = size.width || 500;
state.height = size.height || 500;
}),
initD3: action((state, zoomPaneNode) => {