2
0

feat(editor): ️ Optimize graph navigation

This commit is contained in:
Baptiste Arnaud
2022-06-26 16:12:28 +02:00
parent d7b9bda5d5
commit fc4db575ac
17 changed files with 497 additions and 311 deletions

View File

@ -1,5 +1,5 @@
import { BoxProps, Flex } from '@chakra-ui/react'
import { useGraph } from 'contexts/GraphContext'
import { useGraph, useGroupsCoordinates } from 'contexts/GraphContext'
import { Source } from 'models'
import React, { MouseEvent, useEffect, useRef, useState } from 'react'
@ -10,12 +10,9 @@ export const SourceEndpoint = ({
source: Source
}) => {
const [ranOnce, setRanOnce] = useState(false)
const {
setConnectingIds,
addSourceEndpoint,
groupsCoordinates,
previewingEdge,
} = useGraph()
const { setConnectingIds, addSourceEndpoint, previewingEdge } = useGraph()
const { groupsCoordinates } = useGroupsCoordinates()
const ref = useRef<HTMLDivElement | null>(null)
const handleMouseDown = (e: MouseEvent<HTMLDivElement>) => {