summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOwen <despito@MacBook-Pro-de-Despito.local>2014-08-07 15:22:31 +0300
committerOwen <despito@MacBook-Pro-de-Despito.local>2014-08-07 15:22:41 +0300
commit038e4ed146e5a29933cc8dc34004f0962d1c9987 (patch)
tree586a516cd52897f8fe239f699796af81c40a2430 /scripts
parentbf2f0bf85ff9cc287b69fa8a2a67e735ffee130b (diff)
Issue #26
nodes didn't appear because the type selection index was undefined in the 0 to N_1 loop
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gant.js4
-rw-r--r--scripts/rhizicore.js4
-rw-r--r--scripts/textanalysis.js12
3 files changed, 15 insertions, 5 deletions
diff --git a/scripts/gant.js b/scripts/gant.js
index cabca200..ae849dd6 100644
--- a/scripts/gant.js
+++ b/scripts/gant.js
@@ -10,7 +10,7 @@ function checkSwitch(checkswitch) {
$('body').scrollLeft(0);
graphstate = "GRAPH";
- graph.updateGraph();
+ graph.update();
$('.status').fadeOut(600);
@@ -27,7 +27,7 @@ function checkSwitch(checkswitch) {
graphstate = "GANTT";
- graph.updateGraph();
+ graph.update();
$('.status').fadeIn(600);
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index 481a8ed7..6937201c 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -347,13 +347,15 @@ function myGraph(el) {
}
function dragged(d) {
+
+ d3.select(this).classed("fixed", true);
d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y);
}
function dragended(d) {
d3.select(this).classed("dragging", false);
d3.select(this).classed("fixed", true);
- d3.select(this).attr("dx", d3.event.x).attr("dy", d3.event.y);
+ //d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y);
}
var force = d3.layout.force()
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index cde4c937..77c158be 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -225,6 +225,9 @@ function TextAnalyser2(newtext, finalize) {
//0-N ORDER STACK
for (var m = 0; m < orderStack.length - 1; m++) {
switch (orderStack[m]) {
+ case "START":
+ if(!typeStack[nodeindex])typeStack[nodeindex]=nodetypes[typeindex];
+ break;
case "NODE":
graph.addNode(newnodes[nodeindex], typeStack[nodeindex], typesetter);
if (!abnormalGraph) graph.addLink(newnodes[nodeindex - 1], newnodes[nodeindex], newlinks[linkindex], typesetter);
@@ -254,7 +257,7 @@ function TextAnalyser2(newtext, finalize) {
case "LINK":
linkindex++;
graph.addNode("new node", "empty", "temp");
- if (!abnormalGraph) graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp");
+ if (!abnormalGraph)graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp");
ANDcase = ANDconnect("new node");
break;
}
@@ -265,12 +268,17 @@ function TextAnalyser2(newtext, finalize) {
if (newnodes[nodeindex - 2])
if (newlinks[linkindex - 1].replace(/ /g, "") == "and" && newlinks[linkindex].replace(/ /g, "") !== "and") {
if (!abnormalGraph)
- if(finalize)graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], typesetter);
+ //if(finalize)graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], typesetter);
+ if(finalize)graph.editLink(newnodes[nodeindex - 2], newnodes[nodeindex - 1], completeSentence);
else graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], "temp");
return true;
}
}
+ console.log(sentence);
+ console.log(completeSentence);
+ console.log(orderStack);
+
//STAR CASE
var verb = "";
if (abnormalGraph) {