From 2a9bbee15b036b8734f36769d43b2bf5f0b93431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Tue, 20 Aug 2019 17:36:01 -0400 Subject: [PATCH] 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! --- src/plot_api/subroutines.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plot_api/subroutines.js b/src/plot_api/subroutines.js index cfbe969a434..df87fbcd474 100644 --- a/src/plot_api/subroutines.js +++ b/src/plot_api/subroutines.js @@ -599,9 +599,11 @@ exports.drawData = function(gd) { // styling separate from drawing Plots.style(gd); - // show annotations and shapes + // draw components that can be drawn on axes, + // and that do not push the margins Registry.getComponentMethod('shapes', 'draw')(gd); Registry.getComponentMethod('annotations', 'draw')(gd); + Registry.getComponentMethod('images', 'draw')(gd); // Mark the first render as complete fullLayout._replotting = false; @@ -717,9 +719,6 @@ exports.doAutoRangeAndConstraints = function(gd) { // correctly sized and the whole plot re-margined. fullLayout._replotting must // be set to false before these will work properly. exports.finalDraw = function(gd) { - Registry.getComponentMethod('shapes', 'draw')(gd); - Registry.getComponentMethod('images', 'draw')(gd); - Registry.getComponentMethod('annotations', 'draw')(gd); // TODO: rangesliders really belong in marginPushers but they need to be // drawn after data - can we at least get the margin pushing part separated // out and done earlier?