From 21e931e964079de1a6b686399b25e0f2f61db491 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 1 Mar 2015 00:09:32 +0200 Subject: client/text_analysis: provide function to retrieve existing_nodes --- src/client/textanalysis.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/client/textanalysis.js') diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 5855ae31..c4f5053f 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -502,6 +502,11 @@ var textAnalyser = function (spec) { // textanalysis.ui uses this. should make this more explicit ret.thirds = thirds; + ret.existing_nodes = function (main_graph) { + function not_null(x) { return x !== null; }; + return nodes.map(obj_take('name')).map(main_graph.find_node__by_name).filter(not_null); + } + ret.applyToGraph = function(spec) { var edit_graph = spec.edit_graph, backend_commit = spec.backend_commit, -- cgit v1.3.1