From 8bda55cf4b52d0279ed48bacb2021772dc34e51f Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 29 Sep 2014 12:41:17 +0300 Subject: rhizicore: myGraph: some cleanup --- scripts/rhizicore.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'scripts') 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) + "..."; } }); -- cgit v1.3.1