summaryrefslogtreecommitdiff
path: root/scripts/rhizicore.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-09-29 12:41:17 +0300
committerAlon Levy <alon@pobox.com>2014-09-29 12:41:17 +0300
commit8bda55cf4b52d0279ed48bacb2021772dc34e51f (patch)
tree101d5b8d3087fee5748e8ffb02d20bda77f9a7d3 /scripts/rhizicore.js
parent3c210c83116c5a4a646bbf274e2b9219dbf9de80 (diff)
rhizicore: myGraph: some cleanup
Diffstat (limited to 'scripts/rhizicore.js')
-rw-r--r--scripts/rhizicore.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index 4936b8cd..10a42fb7 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -514,7 +514,13 @@ function myGraph(el) {
.attr("markerHeight", 4)
.attr("orient", "auto")
.attr("class", "graph")
- .style("fill", function(d){if(d.state==="enter" || d.state==="exit") return "EDE275";else return "#aaa";})
+ .style("fill", function(d){
+ if (d.state==="enter" || d.state==="exit") {
+ return "EDE275";
+ } else {
+ return "#aaa";
+ }
+ })
.append("svg:path")
.attr("d", "M0,-5L10,0L0,5");
@@ -549,14 +555,11 @@ function myGraph(el) {
linktext
.text(function(d) {
- if (d.name) {
- if (d.name.length < 25 || d.source.state === "chosen" || d.target.state === "chosen" || d.state==="temp") {
- return d.name;
- } else {
- return d.name.substring(0, 14) + "...";
- }
+ var name = d.name || "";
+ if (name.length < 25 || d.source.state === "chosen" || d.target.state === "chosen" || d.state==="temp") {
+ return name;
} else {
- return "";
+ return name.substring(0, 14) + "...";
}
});