summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-12-08 16:10:46 +0200
committerAlon Levy <alon@pobox.com>2014-12-08 16:26:22 +0200
commit684d551196edcc590d16b1ab32b8da293352cc29 (patch)
treed5be73670d529d9b3f4800e4ff6661d4da806418 /src
parentb19184409dd60269c4176b004f9a2e18668b8cd9 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/rz_core.js10
1 files changed, 9 insertions, 1 deletions
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);
}