Created
July 31, 2017 19:05
-
-
Save Reflic/733b0feb822cc0dbac5efd4f5656ca64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bubble(root); | |
const node = svg.selectAll('.node').data(root.children) | |
.enter().append('g').attr('class', 'node') | |
.attr('transform', function (d: any) { | |
return 'translate(' + d.x + ',' + d.y + ')'; | |
}); | |
node.append('title').text(function (d: any) { | |
return d.data.shortName; | |
}); | |
node.append('circle').attr('r', function (d: any) { | |
return d.r; | |
}).style('fill', function (d: any) { | |
if (d.data.value === 'GOOD') { | |
return '#5CB85C'; | |
} else if (d.data.value === 'NORMAL') { | |
return '#F0AD4E'; | |
} else if (d.data.value === 'BAD') { | |
return '#D9534F'; | |
} else { | |
return '#999'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment