This file contains hidden or 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
(function() { | |
d3.force_labels = function force_labels() { | |
var labels = d3.layout.force(); | |
// Update the position of the anchor based on the center of bounding box | |
function updateAnchor() { | |
if (!labels.selection) return; | |
labels.selection.each(function(d) { | |
var bbox = this.getBBox(), | |
x = bbox.x + bbox.width / 2, |