Skip to content

Commit 38736a2

Browse files
committed
Switch annotation svg -> g
1 parent b6d9930 commit 38736a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/annotations/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ annotations.draw = function(gd, index, opt, value) {
345345
.classed('annotation-text-g', true)
346346
.attr('data-index', String(index));
347347

348-
var ann = anng.append('svg')
349-
.call(Plotly.Drawing.setPosition, 0, 0);
348+
var ann = anng.append('g')
349+
.attr('transform', 'translate(0,0)');
350350

351351
var borderwidth = options.borderwidth,
352352
borderpad = options.borderpad,
@@ -491,10 +491,10 @@ annotations.draw = function(gd, index, opt, value) {
491491

492492
annbg.call(Plotly.Drawing.setRect, borderwidth / 2, borderwidth / 2,
493493
outerwidth-borderwidth, outerheight - borderwidth);
494-
ann.call(Plotly.Drawing.setRect,
495-
Math.round(annPosPx.x - outerwidth / 2),
496-
Math.round(annPosPx.y - outerheight / 2),
497-
outerwidth, outerheight);
494+
495+
var annX = Math.round(annPosPx.x - outerwidth / 2),
496+
annY = Math.round(annPosPx.y - outerheight / 2);
497+
ann.attr('transform', 'translate(' + annX + ', ' + annY + ')');
498498

499499
var annbase = 'annotations['+index+']';
500500

0 commit comments

Comments
 (0)