diff --git a/src/main/scripts/neo4jd3.js b/src/main/scripts/neo4jd3.js index 0e53f349..6ca2c7b3 100644 --- a/src/main/scripts/neo4jd3.js +++ b/src/main/scripts/neo4jd3.js @@ -683,6 +683,12 @@ function Neo4jD3(_selector, _options) { var icons = Object.keys(options.iconMap); return icons[icons.length * Math.random() << 0]; } + + function resetWithNeo4jData(neo4jData) { + // Call the init method again with new data + var newOptions = Object.assign(_options, { neo4jData: neo4jData, neo4jDataUrl: undefined }); + init(_selector, newOptions); + } function rotate(cx, cy, x, y, angle) { var radians = (Math.PI / 180) * angle, @@ -962,6 +968,7 @@ function Neo4jD3(_selector, _options) { appendRandomDataToNode: appendRandomDataToNode, neo4jDataToD3Data: neo4jDataToD3Data, randomD3Data: randomD3Data, + resetWithNeo4jData: resetWithNeo4jData, size: size, updateWithD3Data: updateWithD3Data, updateWithNeo4jData: updateWithNeo4jData,