diff --git a/app/components/chat.tsx b/app/components/chat.tsx index ff99e169..a01da514 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -97,7 +97,7 @@ export function Chat({ messages, setMessages, query, setQuery, selectedPath, set if (!canvas) return setSelectedPath(prev => { if (prev) { - if (isPathResponse && paths.some((path) => [...path.nodes, ...path.links].every((e: any) => [...prev.nodes, ...prev.links].some((e: any) => e.id === e.id)))) { + if (isPathResponse && paths.some((path) => [...path.nodes, ...path.links].every((e: any) => [...prev.nodes, ...prev.links].some((el: any) => el.id === e.id)))) { graph.getElements().forEach(link => { const { id } = link diff --git a/app/components/code-graph.tsx b/app/components/code-graph.tsx index b75f9ef1..84bb739f 100644 --- a/app/components/code-graph.tsx +++ b/app/components/code-graph.tsx @@ -105,7 +105,7 @@ export function CodeGraph({ useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Delete') { - if (selectedObj && selectedObjects.length === 0) return + if (selectedObjects.length === 0 && !selectedObj) return handleRemove([...selectedObjects.map(obj => obj.id), selectedObj?.id].filter(id => id !== undefined), "nodes"); } }; diff --git a/app/components/dataPanel.tsx b/app/components/dataPanel.tsx index b1d84e38..4a50434f 100644 --- a/app/components/dataPanel.tsx +++ b/app/components/dataPanel.tsx @@ -18,7 +18,6 @@ const excludedProperties = [ "expand", "collapsed", "isPath", - "isPathSelected", "visible", "index", "curve", diff --git a/app/components/graphView.tsx b/app/components/graphView.tsx index aefda794..9ea3a2fe 100644 --- a/app/components/graphView.tsx +++ b/app/components/graphView.tsx @@ -164,7 +164,10 @@ export default function GraphView({ }, [zoomedNodes, cooldownTicks, canvasRef]) const nodeCanvasObject = useCallback((node: GraphNode, ctx: CanvasRenderingContext2D) => { - if (!node.x || !node.y) return + if (node.x === undefined || node.y === undefined) { + node.x = 0; + node.y = 0; + } const isHovered = !!hoverElement && !('source' in hoverElement) && hoverElement.id === node.id const isSelected = selectedObjects.some(obj => obj.id === node.id) || selectedObj?.id === node.id @@ -231,7 +234,10 @@ export default function GraphView({ }, [selectedObj, selectedObjects, isPathResponse, hoverElement]) const nodePointerAreaPaint = useCallback((node: GraphNode, color: string, ctx: CanvasRenderingContext2D) => { - if (!node.x || !node.y) return + if (node.x === undefined || node.y === undefined) { + node.x = 0; + node.y = 0; + } ctx.fillStyle = color; ctx.beginPath(); diff --git a/app/components/model.ts b/app/components/model.ts index 61626443..7253fa26 100644 --- a/app/components/model.ts +++ b/app/components/model.ts @@ -210,6 +210,8 @@ export class Graph { } this.nodesMap.set(edgeData.src_node, source) + this.elements.nodes.push(source) + newElements.nodes.push(source) } if (!target) { @@ -227,6 +229,8 @@ export class Graph { } } this.nodesMap.set(edgeData.dest_node, target) + this.elements.nodes.push(target) + newElements.nodes.push(target) } let label = this.labelsMap.get(edgeData.relation) diff --git a/app/globals.css b/app/globals.css index 26324540..1a377faf 100644 --- a/app/globals.css +++ b/app/globals.css @@ -127,13 +127,4 @@ ::-webkit-scrollbar-thumb:hover { background-color: #a8bbbf; -} - -@layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } } \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index f8f465c5..3a5c91de 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -368,7 +368,7 @@ export default function Home() {
- + FalkorDB

@@ -376,15 +376,15 @@ export default function Home() {

- + FalkorDB