@@ -2646,6 +2646,8 @@ function makePlotFramework(gd) {
2646
2646
. classed ( 'layer-below' , true ) ;
2647
2647
fullLayout . _shapeLowerLayer = layerBelow . append ( 'g' )
2648
2648
. classed ( 'shapelayer' , true ) ;
2649
+ fullLayout . _imageLowerLayer = layerBelow . append ( 'g' )
2650
+ . classed ( 'imagelayer' , true ) ;
2649
2651
2650
2652
var subplots = Plotly . Axes . getSubplots ( gd ) ;
2651
2653
if ( subplots . join ( '' ) !== Object . keys ( gd . _fullLayout . _plots || { } ) . join ( '' ) ) {
@@ -2658,15 +2660,18 @@ function makePlotFramework(gd) {
2658
2660
fullLayout . _ternarylayer = fullLayout . _paper . append ( 'g' ) . classed ( 'ternarylayer' , true ) ;
2659
2661
2660
2662
// shape layers in subplots
2661
- fullLayout . _subplotShapeLayer = fullLayout . _paper
2662
- . selectAll ( '.shapelayer-subplot' ) ;
2663
+ var layerSubplot = fullLayout . _paper . selectAll ( '.layer-subplot' ) ;
2664
+ fullLayout . _shapeSubplotLayer = layerSubplot . selectAll ( '.shapelayer' ) ;
2665
+ fullLayout . _imageSubplotLayer = layerSubplot . selectAll ( '.imagelayer' ) ;
2663
2666
2664
2667
// upper shape layer
2665
2668
// (only for shapes to be drawn above the whole plot, including subplots)
2666
2669
var layerAbove = fullLayout . _paper . append ( 'g' )
2667
2670
. classed ( 'layer-above' , true ) ;
2668
2671
fullLayout . _shapeUpperLayer = layerAbove . append ( 'g' )
2669
2672
. classed ( 'shapelayer' , true ) ;
2673
+ fullLayout . _imageUpperLayer = layerAbove . append ( 'g' )
2674
+ . classed ( 'imagelayer' , true ) ;
2670
2675
2671
2676
// single pie layer for the whole plot
2672
2677
fullLayout . _pielayer = fullLayout . _paper . append ( 'g' ) . classed ( 'pielayer' , true ) ;
@@ -2797,10 +2802,16 @@ function makeCartesianPlotFramwork(gd, subplots) {
2797
2802
// the plot and containers for overlays
2798
2803
plotinfo . bg = plotgroup . append ( 'rect' )
2799
2804
. style ( 'stroke-width' , 0 ) ;
2800
- // shape layer
2801
- // (only for shapes to be drawn below a subplot)
2802
- plotinfo . shapelayer = plotgroup . append ( 'g' )
2803
- . classed ( 'shapelayer shapelayer-subplot' , true ) ;
2805
+
2806
+ // back layer for shapes and images to
2807
+ // be drawn below a subplot
2808
+ var backlayer = plotgroup . append ( 'g' )
2809
+ . classed ( 'layer-subplot' , true ) ;
2810
+
2811
+ plotinfo . shapelayer = backlayer . append ( 'g' )
2812
+ . classed ( 'shapelayer' , true ) ;
2813
+ plotinfo . imagelayer = backlayer . append ( 'g' )
2814
+ . classed ( 'imagelayer' , true ) ;
2804
2815
plotinfo . gridlayer = plotgroup . append ( 'g' ) ;
2805
2816
plotinfo . overgrid = plotgroup . append ( 'g' ) ;
2806
2817
plotinfo . zerolinelayer = plotgroup . append ( 'g' ) ;
0 commit comments