From 5d95e32fa3d386a373355c7dbb87166296235cea Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 27 May 2014 20:30:37 -0700 Subject: [PATCH] fix some chord graph issues --- .../admin/dashboard/slice_interactions.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/planetstack/templates/admin/dashboard/slice_interactions.html b/planetstack/templates/admin/dashboard/slice_interactions.html index 6fafc5c..3ddaa1f 100644 --- a/planetstack/templates/admin/dashboard/slice_interactions.html +++ b/planetstack/templates/admin/dashboard/slice_interactions.html @@ -305,6 +305,16 @@ function updateChords( users, matrix, objectName ) { //.transition().duration(100).attr("opacity", 1) //reset opacity ; + // XXX SMBAKER: The way the text was added with newGroups, it's only + // computed when a node is created. This is a problem if we redraw the + // graph with a different set of nodes, because the old labels will + // stick. So, I added this, which *seems* to cause the labels to be + // recomputed. + groupG.selectAll("text") + .text(function (d) { + return users[d.index].name; + }); + //add the mouseover/fade out behaviour to the groups //this is reset on every update, so it will use the latest //chordPaths selection @@ -326,6 +336,12 @@ function updateChords( users, matrix, objectName ) { }); */ + // XXX smbaker: there's a bug where if you hilight a slice of the chord + // graph, and then update the data, the freshly drawn graph is missing + // some of the chords. Flipping the fade bit seems to fix that. + chordPaths.classed("fade", true); + chordPaths.classed("fade", false); + last_layout = layout; //save for next update // }); //end of d3.json -- 2.43.0