Skip to content

Commit

Permalink
draw in shapes, images and annotations in drawData only
Browse files Browse the repository at this point in the history
- 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!
  • Loading branch information
etpinard committed Sep 4, 2019
1 parent 0cf93f8 commit 2a9bbee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/plot_api/subroutines.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 2a9bbee

Please sign in to comment.