From ae6cd35c1b419244b647bcbf1da5c88cca1f2c38 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 3 Oct 2023 19:52:57 +0800 Subject: [PATCH] Double clicking can make a node on canvas, although not at clicking position --- .../GraphVisualizer/Graph/GraphEventHandlerModel.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts b/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts index 1f78d403eb4..563eac7e4d6 100644 --- a/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts +++ b/src/neo4j-arc/graph-visualization/GraphVisualizer/Graph/GraphEventHandlerModel.ts @@ -230,7 +230,10 @@ export class GraphEventHandlerModel { } onCanvasDblClicked(): void { - console.log('You have double clicked the canvas!') + this.graph.addNodes([new NodeModel('New Node', [], {}, {})]) + this.visualization.update({ updateNodes: true, updateRelationships: true }) + + // this will persist node to Neo4J DB... this.onGraphInteraction(NODE_ON_CANVAS_CREATE) }