diff --git a/labeler.js b/labeler.js index dbe5108..155262a 100644 --- a/labeler.js +++ b/labeler.js @@ -248,6 +248,12 @@ d3.labeler = function() { // users insert label positions if (!arguments.length) return lab; lab = x; + // default anchor: same x,y, and r=0 + for (i in lab) { + if (typeof anc[i] == 'undefined') { + anc[i] = { x: lab[i].x, y: lab[i].y, r:0 }; + } + } return labeler; };