diff --git a/src/lib/svg_text_utils.js b/src/lib/svg_text_utils.js index c2ddb368251..6f2a45a06d7 100644 --- a/src/lib/svg_text_utils.js +++ b/src/lib/svg_text_utils.js @@ -134,7 +134,7 @@ exports.convertToTspans = function(_context, gd, _callback) { else if(svgClass[0] === 'l') { newSvg.attr({x: _context.attr('x'), y: dy - (newSvgH / 2)}); } - else if(svgClass[0] === 'a') { + else if(svgClass[0] === 'a' && svgClass.indexOf('atitle') !== 0) { newSvg.attr({x: 0, y: dy}); } else { diff --git a/test/image/baselines/ternary-mathjax.png b/test/image/baselines/ternary-mathjax.png new file mode 100644 index 00000000000..cbf2d47d3f5 Binary files /dev/null and b/test/image/baselines/ternary-mathjax.png differ diff --git a/test/image/mocks/ternary-mathjax.json b/test/image/mocks/ternary-mathjax.json new file mode 100644 index 00000000000..3ffda077e4a --- /dev/null +++ b/test/image/mocks/ternary-mathjax.json @@ -0,0 +1,57 @@ +{ + "data": [ + { + "type": "scatterternary", + "mode": "markers", + "a": [75], + "b": [25], + "c": [0], + "text": ["point 1"], + "marker": { + "symbol": 100, + "color": "#DB7365", + "size": 14, + "line": { + "width": 2 + } + } + } + ], + "layout": { + "ternary": { + "sum": 100, + "aaxis": { + "title": { + "text": "$A^2$" + }, + "showline": true, + "showgrid": true + }, + "baxis": { + "title": { + "text": "$B^2$" + }, + "showline": true, + "showgrid": true + }, + "caxis": { + "title": { + "text": "$C^2$" + }, + "showline": true, + "showgrid": true + } + }, + "annotations": [ + { + "showarrow": false, + "text": "Simple Ternary Plot with Markers", + "x": 0.5, + "y": 1.3, + "font": { + "size": 15 + } + } + ] + } +}