Skip to content

Commit ab0b6bf

Browse files
committed
Switch annotation svg -> g
1 parent f213006 commit ab0b6bf

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
@@ -343,8 +343,8 @@ annotations.draw = function(gd, index, opt, value) {
343343
.classed('annotation-text-g', true)
344344
.attr('data-index', String(index));
345345

346-
var ann = anng.append('svg')
347-
.call(Plotly.Drawing.setPosition, 0, 0);
346+
var ann = anng.append('g')
347+
.attr('transform', 'translate(0,0)');
348348

349349
var borderwidth = options.borderwidth,
350350
borderpad = options.borderpad,
@@ -489,10 +489,10 @@ annotations.draw = function(gd, index, opt, value) {
489489

490490
annbg.call(Plotly.Drawing.setRect, borderwidth / 2, borderwidth / 2,
491491
outerwidth-borderwidth, outerheight - borderwidth);
492-
ann.call(Plotly.Drawing.setRect,
493-
Math.round(annPosPx.x - outerwidth / 2),
494-
Math.round(annPosPx.y - outerheight / 2),
495-
outerwidth, outerheight);
492+
493+
var annX = Math.round(annPosPx.x - outerwidth / 2),
494+
annY = Math.round(annPosPx.y - outerheight / 2);
495+
ann.attr('transform', 'translate(' + annX + ', ' + annY + ')');
496496

497497
var annbase = 'annotations['+index+']';
498498

0 commit comments

Comments
 (0)