Skip to content

Commit 2a9bbee

Browse files
committed
draw in shapes, images and annotations in drawData only
- need to draw them (again) in finalDraw, by the time we get to drawData we have the correct auto-margin and auto-range info required to draw them correctly!
1 parent 0cf93f8 commit 2a9bbee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/plot_api/subroutines.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,11 @@ exports.drawData = function(gd) {
599599
// styling separate from drawing
600600
Plots.style(gd);
601601

602-
// show annotations and shapes
602+
// draw components that can be drawn on axes,
603+
// and that do not push the margins
603604
Registry.getComponentMethod('shapes', 'draw')(gd);
604605
Registry.getComponentMethod('annotations', 'draw')(gd);
606+
Registry.getComponentMethod('images', 'draw')(gd);
605607

606608
// Mark the first render as complete
607609
fullLayout._replotting = false;
@@ -717,9 +719,6 @@ exports.doAutoRangeAndConstraints = function(gd) {
717719
// correctly sized and the whole plot re-margined. fullLayout._replotting must
718720
// be set to false before these will work properly.
719721
exports.finalDraw = function(gd) {
720-
Registry.getComponentMethod('shapes', 'draw')(gd);
721-
Registry.getComponentMethod('images', 'draw')(gd);
722-
Registry.getComponentMethod('annotations', 'draw')(gd);
723722
// TODO: rangesliders really belong in marginPushers but they need to be
724723
// drawn after data - can we at least get the margin pushing part separated
725724
// out and done earlier?

0 commit comments

Comments
 (0)