From 684d551196edcc590d16b1ab32b8da293352cc29 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 8 Dec 2014 16:10:46 +0200 Subject: reorder link labels (.linklabel) there is an existing bug where you don't see the labels for links changes on existing nodes, i.e.: (no enter on second sentence) You should have: g .linklabel isnot but instead you have an empty linklabel g .linklabel --- src/rz_core.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rz_core.js b/src/rz_core.js index 60c5231b..5ef6bdab 100644 --- a/src/rz_core.js +++ b/src/rz_core.js @@ -398,9 +398,11 @@ function update_view__graph(no_relayout) { this.link = d; }); - linktext = vis.selectAll(".linklabel").data(graph.links()); + linktext = vis.selectAll(".linklabel") + .data(graph.links(), function(d) { return d.id; }); linktext.enter() .append("text") + .attr('id', function(d){ return d.id; }) // append link id to enable data->visual mapping .attr("class", function(d) { return ["linklabel graph", selection.selected_class(d)].join(' '); }) @@ -413,6 +415,7 @@ function update_view__graph(no_relayout) { linktext .text(function(d) { + console.log(d.name); var name = d.name || ""; if (!(d.__dst.state === "temp" || d.__src.state === "chosen" || d.__dst.state === "chosen")) { @@ -480,6 +483,11 @@ function update_view__graph(no_relayout) { reparent(unselected_link_group, this); } }); + linktext.each(function (d) { + if (selection.node_selected(d)) { + ontop.push(this); + } + }); function moveToEnd(e) { e.parentNode.appendChild(e); } -- cgit v1.3.1