File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,18 @@ module.exports = function draw(gd) {
102102 var ly = gs . t + gs . h * ( 1 - opts . y ) - FROM_TL [ getYanchor ( opts ) ] * opts . _effHeight ;
103103
104104 if ( fullLayout . margin . autoexpand ) {
105+ var lx0 = lx ;
106+ var ly0 = ly ;
107+
105108 lx = Lib . constrain ( lx , 0 , fullLayout . width - opts . _width ) ;
106109 ly = Lib . constrain ( ly , 0 , fullLayout . height - opts . _effHeight ) ;
110+
111+ if ( lx !== lx0 ) {
112+ Lib . log ( 'Constrain legend.x to make legend fit inside graph' ) ;
113+ }
114+ if ( ly !== ly0 ) {
115+ Lib . log ( 'Constrain legend.y to make legend fit inside graph' ) ;
116+ }
107117 }
108118
109119 // Set size and position of all the elements that make up a legend:
Original file line number Diff line number Diff line change @@ -945,6 +945,7 @@ describe('Test splom interactions:', function() {
945945
946946 it ( '@gl should clear graph and replot when canvas and WebGL context dimensions do not match' , function ( done ) {
947947 var fig = Lib . extendDeep ( { } , require ( '@mocks/splom_iris.json' ) ) ;
948+ fig . layout . showlegend = false ;
948949
949950 function assertDims ( msg , w , h ) {
950951 var canvas = gd . _fullLayout . _glcanvas ;
You can’t perform that action at this time.
0 commit comments