refactor(core): remove initialized from graph-nodes (#1457)
* refactor(core): remove `initialized` from graph-nodes * chore(changeset): add * refactor(node-resizer): replace node initialized check * chore(changeset): add
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { zoomIdentity } from 'd3-zoom'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import { nextTick } from 'vue'
|
||||
import { until } from '@vueuse/core'
|
||||
import type {
|
||||
Actions,
|
||||
@@ -163,7 +162,6 @@ export function useActions(
|
||||
node.dimensions = dimensions
|
||||
node.handleBounds.source = getHandleBounds('.source', update.nodeElement, nodeBounds, zoom)
|
||||
node.handleBounds.target = getHandleBounds('.target', update.nodeElement, nodeBounds, zoom)
|
||||
node.initialized = true
|
||||
|
||||
changes[i] = {
|
||||
id: node.id,
|
||||
@@ -175,10 +173,8 @@ export function useActions(
|
||||
}
|
||||
|
||||
if (!state.fitViewOnInitDone && state.fitViewOnInit) {
|
||||
nextTick(() => {
|
||||
viewportHelper.value.fitView()
|
||||
state.fitViewOnInitDone = true
|
||||
})
|
||||
viewportHelper.value.fitView()
|
||||
state.fitViewOnInitDone = true
|
||||
}
|
||||
|
||||
if (changes.length) {
|
||||
@@ -813,7 +809,6 @@ export function useActions(
|
||||
isParent: _____,
|
||||
resizing: ______,
|
||||
dragging: _______,
|
||||
initialized: ________,
|
||||
events: _________,
|
||||
...rest
|
||||
} = node
|
||||
|
||||
@@ -134,7 +134,7 @@ export function useGetters(
|
||||
const initializedNodes: GraphNode[] = []
|
||||
|
||||
for (const node of state.nodes) {
|
||||
if (node.initialized && node.handleBounds !== undefined) {
|
||||
if (!!node.dimensions.width && !!node.dimensions.height && node.handleBounds !== undefined) {
|
||||
initializedNodes.push(node)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user