refactor(core): add explicit imports and remove auto-imports

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-05-25 20:48:26 +02:00
committed by Braks
parent 5a86c7cf1d
commit e3e6a03359
63 changed files with 328 additions and 508 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
import { zoomIdentity } from 'd3-zoom'
import { computed, ref } from 'vue'
import type { ComputedGetters, D3Selection, GraphNode, State, ViewportFunctions } from '~/types'
import { clampPosition, getRectOfNodes, getTransformForBounds, pointToRendererPoint } from '~/utils'
interface ExtendedViewport extends ViewportFunctions {
initialized: boolean
@@ -22,7 +24,7 @@ const initialViewportHelper: ExtendedViewport = {
initialized: false,
}
export default (state: State, getters: ComputedGetters) => {
export function useViewport(state: State, getters: ComputedGetters) {
const { nodes, d3Zoom, d3Selection, dimensions, translateExtent, minZoom, maxZoom, viewport, snapToGrid, snapGrid, hooks } =
$(state)