8000 legend: don't require Plotly · BotAiNick/plotly.js@d625f01 · GitHub
[go: up one dir, main page]

Skip to content

Commit d625f01

Browse files
committed
legend: don't require Plotly
1 parent 0981630 commit d625f01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/legend/draw.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var Plots = require('../../plots/plots');
1717
var dragElement = require('../dragelement');
1818
var Drawing = require('../drawing');
1919
var Color = require('../color');
20+
var svgTextUtils = require('../../lib/svg_text_utils');
2021

2122
var constants = require('./constants');
2223
var getLegendData = require('./get_legend_data');
@@ -354,14 +355,14 @@ function drawTexts(g, gd) {
354355
.text(name);
355356

356357
function textLayout(s) {
357-
Plotly.util.convertToTspans(s, function() {
358+
svgTextUtils.convertToTspans(s, function() {
358359
s.selectAll('tspan.line').attr({x: s.attr('x')});
359360
g.call(computeTextDimensions, gd);
360361
});
361362
}
362363

363364
if(gd._context.editable && !isPie) {
364-
text.call(Plotly.util.makeEditable)
365+
text.call(svgTextUtils.makeEditable)
365366
.call(textLayout)
366367
.on('edit', function(text) {
367368
this.attr({'data-unformatted': text});

0 commit comments

Comments
 (0)
0