Skip to content

Commit 7450c83

Browse files
authored
Remove snapshoot structures for nodes and links (#118)
1 parent dcaf0d7 commit 7450c83

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/components/graph/graph.helper.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ function initializeGraphState({ data, id, config }, state) {
423423
_validateGraphData(data);
424424

425425
let graph;
426-
const nodesInputSnapshot = data.nodes.map(n => Object.assign({}, n));
427-
const linksInputSnapshot = data.links.map(l => Object.assign({}, l));
428426

429427
if (state && state.nodes) {
430428
graph = {
@@ -455,10 +453,8 @@ function initializeGraphState({ data, id, config }, state) {
455453
config: newConfig,
456454
links,
457455
d3Links,
458-
linksInputSnapshot,
459456
nodes,
460457
d3Nodes,
461-
nodesInputSnapshot,
462458
highlightedNode: '',
463459
simulation,
464460
newGraphElements: false,

test/component/graph/graph.helper.test.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,6 @@ describe('Graph Helper', () => {
434434
A: 1
435435
}
436436
},
437-
linksInputSnapshot: [
438-
{
439-
source: 'A',
440-
target: 'B'
441-
},
442-
{
443-
source: 'C',
444-
target: 'A'
445-
}
446-
],
447437
newGraphElements: false,
448438
nodes: {
449439
A: {
@@ -465,17 +455,6 @@ describe('Graph Helper', () => {
465455
y: 0
466456
}
467457
},
468-
nodesInputSnapshot: [
469-
{
470-
id: 'A'
471-
},
472-
{
473-
id: 'B'
474-
},
475-
{
476-
id: 'C'
477-
}
478-
],
479458
simulation: {
480459
force: forceStub
481460
},

0 commit comments

Comments
 (0)