Skip to content

Commit

Permalink
fix click event and clear network
Browse files Browse the repository at this point in the history
  • Loading branch information
thebestnom committed Feb 21, 2021
1 parent 5ef90dc commit 1930353
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/neovis-without-dependencies.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/neovis-without-dependencies.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/neovis.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/neovis.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neovis.js",
"version": "2.0.0-alpha.2",
"version": "2.0.0-alpha.3",
"description": "Graph visualizations powered by vis.js with data from Neo4j.",
"main": "./dist/neovis.js",
"module": "./dist/neovis-without-dependencies.js",
Expand Down
11 changes: 4 additions & 7 deletions src/neovis.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,13 @@ export default class NeoVis {
let nodeId = this.getNodeAt(params.pointer.DOM);
neoVis.#events.generateEvent(ClickNodeEvent, {
nodeId: nodeId,
node: neoVis._nodes[nodeId]
node: neoVis._data.nodes.get(nodeId)
});
} else if (params.edges.length > 0) {
let edgeId = this.getEdgeAt(params.pointer.DOM);
neoVis.#events.generateEvent(ClickEdgeEvent, {
edgeId: edgeId,
edge: neoVis._edges[edgeId]
edge: neoVis._data.edges.get(edgeId)
});
}
});
Expand All @@ -417,11 +417,8 @@ export default class NeoVis {
* Clear the data for the visualization
*/
clearNetwork() {
this._neo4jNodes = {};
this._neo4jEdges = {};
this._nodes = {};
this._edges = {};
this.#network.setData([]);
this._data.nodes.clear();
this._data.edges.clear();
}


Expand Down

0 comments on commit 1930353

Please sign in to comment.