Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Created March 11, 2015 14:53
Show Gist options
  • Save mbroadst/4fcd38a7c0326e9d8b85 to your computer and use it in GitHub Desktop.
Save mbroadst/4fcd38a7c0326e9d8b85 to your computer and use it in GitHub Desktop.
var path_group = d3.select(selector + ' .path_group');
var paths = path_group.selectAll("path")
.data(pie(Object.keys(data.status)))
.enter().append("path")
.style("fill", function(d, i) {
console.log(data.status[d.data]);
switch (data.status[d.data]) {
case 'enabled':
return '#98df8a';
case 'disabled':
return '#ff9896';
}
})
.attr("d", arc)
.attr("id", function(d, i) { return "path" + i; });
paths.exit().remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment