File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1326,3 +1326,41 @@ describe('grids', function() {
13261326 . then ( done , done . fail ) ;
13271327 } ) ;
13281328} ) ;
1329+
1330+ describe ( 'Test Plots with automargin and minreducedwidth/height' , function ( ) {
1331+ var gd ;
1332+
1333+ beforeEach ( function ( ) {
1334+ gd = createGraphDiv ( ) ;
1335+ } ) ;
1336+
1337+ afterEach ( destroyGraphDiv ) ;
1338+
1339+ it ( 'should resize the plot area when tweaking min-reduced width & height' , function ( done ) {
1340+ function assert ( attr , exp ) {
1341+ var xy = d3Select ( 'rect.nsewdrag' ) [ 0 ] [ 0 ] ;
1342+ expect ( xy . getAttribute ( attr ) ) . toEqual ( exp ) ;
1343+ }
1344+
1345+ var fig = require ( '@mocks/z-automargin-minreducedheight.json' ) ;
1346+
1347+ Plotly . newPlot ( gd , fig )
1348+ . then ( function ( ) {
1349+ assert ( 'height' , '55' ) ;
1350+ } )
1351+ . then ( function ( ) {
1352+ return Plotly . relayout ( gd , 'margin.minreducedheight' , 100 ) ;
1353+ } )
1354+ . then ( function ( ) {
1355+ assert ( 'height' , '100' ) ;
1356+ } )
1357+ . then ( function ( ) {
1358+ return Plotly . relayout ( gd , 'margin.minreducedwidth' , 100 ) ;
1359+ } )
1360+ . then ( function ( ) {
1361+ assert ( 'width' , '100' ) ;
1362+ assert ( 'height' , '100' ) ;
1363+ } )
1364+ . then ( done , done . fail ) ;
1365+ } ) ;
1366+ } ) ;
You can’t perform that action at this time.
0 commit comments