Skip to content

Commit 74328f3

Browse files
committed
Make sure MathJax has finished rendering legend text before computing
legend dimensions
1 parent 2a667d0 commit 74328f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/legend/draw.js

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ module.exports = function draw(gd) {
124124
.call(setupTraceToggle, gd);
125125
});
126126

127+
Lib.syncOrAsync([Plots.previousPromises,
128+
function() {
127129
if(firstRender) {
128130
computeLegendDimensions(gd, groups, traces);
129131
expandMargin(gd);
@@ -354,6 +356,7 @@ module.exports = function draw(gd) {
354356
}
355357
});
356358
}
359+
}], gd);
357360
};
358361

359362
function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {

0 commit comments

Comments
 (0)