@@ -3704,7 +3704,25 @@ function makePlotFramework(gd) {
3704
3704
fullLayout . _container . enter ( )
3705
3705
. insert ( 'div' , ':first-child' )
3706
3706
. classed ( 'plot-container' , true )
3707
- . classed ( 'plotly' , true ) ;
3707
+ . classed ( 'plotly' , true )
3708
+ // The plot container should always take the full with the height of its
3709
+ // parent (the graph div). This ensures that for responsive plots
3710
+ // without a height or width set, the paper div will take up the full
3711
+ // height & width of the graph div.
3712
+ // So, for responsive plots without a height or width set, if the plot
3713
+ // container's height is left to 'auto', its height will be dictated by
3714
+ // its childrens' height. (The plot container's only child is the paper
3715
+ // div.)
3716
+ // In this scenario, the paper div's height will be set to 100%,
3717
+ // which will be 100% of the plot container's auto height. That is
3718
+ // meaninglesss, so the browser will use the paper div's children to set
3719
+ // the height of the plot container instead. However, the paper div's
3720
+ // children do not have any height, because they are all positioned
3721
+ // absolutely, and therefore take up no space.
3722
+ . style ( {
3723
+ width : "100%" ,
3724
+ height : "100%"
3725
+ } ) ;
3708
3726
3709
3727
// Make the svg container
3710
3728
fullLayout . _paperdiv = fullLayout . _container . selectAll ( '.svg-container' ) . data ( [ 0 ] ) ;
0 commit comments