Skip to content

Commit

Permalink
adds a unique ID to each data group (closes #466)
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Apr 19, 2016
1 parent 54d8a61 commit 7ab5715
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/viz/helpers/shapes/draw.js
Expand Up @@ -153,10 +153,14 @@ module.exports = function(vars) {
// Sets the class name for a group
//----------------------------------------------------------------------------
function className(g) {
g.attr("class", function(d){
var c = vars.class.value ? " " + fetchValue(vars, d, vars.class.value) : "";
return "d3plus_" + shape + c;
});
g
.attr("id", function(d){
return "d3plus_group_" + d.d3plus.id;
})
.attr("class", function(d){
var c = vars.class.value ? " " + fetchValue(vars, d, vars.class.value) : "";
return "d3plus_" + shape + c;
});
}

//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 7ab5715

Please sign in to comment.