diff options
| author | Alon Levy <alon@pobox.com> | 2014-09-28 15:04:05 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-09-28 15:04:05 +0300 |
| commit | 9d4ada6425effb1223a74810646fe0a380c91008 (patch) | |
| tree | 043f34a462c10e1a35658c71bd00185208975906 /scripts/textanalysis-ui.js | |
| parent | 77987826027b26b528f0b3dcbdc898395bf677c1 (diff) | |
textanalysis: move graph touching function to non ui part
Diffstat (limited to 'scripts/textanalysis-ui.js')
| -rw-r--r-- | scripts/textanalysis-ui.js | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/scripts/textanalysis-ui.js b/scripts/textanalysis-ui.js index 19f1b188..d79ceb0a 100644 --- a/scripts/textanalysis-ui.js +++ b/scripts/textanalysis-ui.js @@ -22,21 +22,7 @@ function analyzeSentence(sentence, finalize) $('.typeselection').css('left', 0); break; } - //REINITIALISE GRAPH (DUMB BUT IT WORKS) - graph.removeNodes("temp"); - graph.removeLinks("temp"); - for (var k in ret.nodes) { - var n = ret.nodes[k]; - graph.addNode(n.id, n.type, n.state); - } - for (var k in ret.links) { - var l = ret.links[k]; - graph.addLink(l.sourceId, l.targetId, l.name, l.state, ret.drop_conjugator_links); - } - - //UPDATE GRAPH ONCE - graph.update(); - + ret.applyToGraph(graph); if (finalize || sentence.length == 0) { $('.typeselection').css('top', -300); $('.typeselection').css('left', 0); |
