summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-11-17 13:32:29 +0200
committerAlon Levy <alon@pobox.com>2014-11-19 23:21:42 +0200
commit3d6d92ecacc3a26bb888541eafc66151a6d2de63 (patch)
treec366aa486013ff8c2a66112e133450b9827d0f4f /src
parenta2c1a7b364bc9d1092aaa4af095b495f0da1384f (diff)
new_topo_diff() default constructor - add node_set_add, link_set_add arrays
Diffstat (limited to 'src')
-rw-r--r--src/model/diff.js17
-rw-r--r--src/textanalysis.js6
2 files changed, 18 insertions, 5 deletions
diff --git a/src/model/diff.js b/src/model/diff.js
index ca9c41c9..5ac48e5a 100644
--- a/src/model/diff.js
+++ b/src/model/diff.js
@@ -108,7 +108,10 @@ define([],
/**
* Visual diff object expressing any visual change to the state of a
- * particular visualization type
+ * particular visualization type.
+ *
+ * @obj_spec if none is passed a default topo_diff is constructed
+ * with node,link add sets
*/
function Vis_Diff(obj_spec) {
}
@@ -117,8 +120,16 @@ define([],
/*
* validate obj_spec
*/
- // TODO
- var ret = new Topo_Diff(obj_spec);
+ var ret;
+ if (undefined == obj_spec) {
+ obj_spec = {
+ node_set_add : [],
+ link_set_add : [],
+ }
+ ret = new Topo_Diff(obj_spec);
+ } else {
+ ret = new Topo_Diff(obj_spec);
+ }
return ret;
}
diff --git a/src/textanalysis.js b/src/textanalysis.js
index a3e8e83d..fa195a72 100644
--- a/src/textanalysis.js
+++ b/src/textanalysis.js
@@ -1,7 +1,7 @@
"use strict";
-define(['rz_core', 'model/util', 'model/diff'],
-function(rz_core, model_util, model_diff) {
+define(['rz_core', 'model/core', 'model/util', 'model/diff'],
+function(rz_core, model_core, model_util, model_diff) {
var typeindex = 0;
var nodetypes = ["person", "project", "skill", "deliverable", "objective"];
@@ -168,6 +168,8 @@ var textAnalyser = function (newtext, finalize) {
LINK = "LINK",
START = "START";
+ var ret = model_diff.new_topo_diff();
+
function addNode(name, type, state) {
if (type === undefined) {
console.log('bug: textanalyser.addNode of type undefined');