refactor(core): add warning when viewport noop is triggered
This commit is contained in:
@@ -2,7 +2,7 @@ import { until } from '@vueuse/core'
|
|||||||
import { zoomIdentity } from 'd3-zoom'
|
import { zoomIdentity } from 'd3-zoom'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import type { ComputedGetters, D3Selection, GraphNode, Project, State, ViewportFunctions } from '~/types'
|
import type { ComputedGetters, D3Selection, GraphNode, Project, State, ViewportFunctions } from '~/types'
|
||||||
import { clampPosition, getRectOfNodes, getTransformForBounds, pointToRendererPoint, rendererPointToPoint } from '~/utils'
|
import { clampPosition, getRectOfNodes, getTransformForBounds, pointToRendererPoint, rendererPointToPoint, warn } from '~/utils'
|
||||||
|
|
||||||
interface ExtendedViewport extends ViewportFunctions {
|
interface ExtendedViewport extends ViewportFunctions {
|
||||||
initialized: boolean
|
initialized: boolean
|
||||||
@@ -13,6 +13,8 @@ interface ExtendedViewport extends ViewportFunctions {
|
|||||||
const DEFAULT_PADDING = 0.1
|
const DEFAULT_PADDING = 0.1
|
||||||
|
|
||||||
function noop() {
|
function noop() {
|
||||||
|
warn('Viewport not initialized yet.')
|
||||||
|
|
||||||
return Promise.resolve(false)
|
return Promise.resolve(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user