@@ -389,71 +389,6 @@ describe('sankey tests', function () {
389389 } ) ;
390390 } ) ;
391391
392- describe ( 'node.pad clamp warning (issue 7832)' , function ( ) {
393- var gd ;
394- beforeEach ( function ( ) {
395- gd = createGraphDiv ( ) ;
396- } ) ;
397- afterEach ( destroyGraphDiv ) ;
398-
399- function padWarnings ( ) {
400- var warnings = [ ] ;
401- spyOn ( Lib , 'warn' ) . and . callFake ( function ( msg ) {
402- warnings . push ( msg ) ;
403- } ) ;
404- return warnings ;
405- }
406-
407- it ( 'fires when node.pad is clamped to fit the figure' , function ( done ) {
408- var warnings = padWarnings ( ) ;
409- var labels = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' ] ;
410- // 8 sibling nodes cannot fit in a ~300px-high domain with
411- // node.pad: 40 -> d3-sankey clamps the padding
412- Plotly . newPlot ( gd , [ {
413- type : 'sankey' ,
414- domain : { x : [ 0 , 1 ] , y : [ 0 , 0.5 ] } ,
415- node : {
416- label : labels ,
417- pad : 40 ,
418- thickness : 15
419- } ,
420- link : {
421- source : [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ,
422- target : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ,
423- value : [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]
424- }
425- } ] )
426- . then ( function ( ) {
427- expect ( warnings . length ) . toBe ( 1 ) ;
428- expect ( warnings [ 0 ] ) . toContain ( 'node.pad was reduced' ) ;
429- } )
430- . then ( done , done . fail ) ;
431- } ) ;
432-
433- it ( 'does not fire when node.pad fits' , function ( done ) {
434- var warnings = padWarnings ( ) ;
435-
436- Plotly . newPlot ( gd , [ {
437- type : 'sankey' ,
438- domain : { x : [ 0 , 1 ] , y : [ 0 , 1 ] } ,
439- node : {
440- label : [ 'a' , 'b' , 'c' , 'd' ] ,
441- pad : 20 ,
442- thickness : 10
443- } ,
444- link : {
445- source : [ 0 , 0 , 0 ] ,
446- target : [ 1 , 2 , 3 ] ,
447- value : [ 1 , 1 , 1 ]
448- }
449- } ] )
450- . then ( function ( ) {
451- expect ( warnings . length ) . toBe ( 0 ) ;
452- } )
453- . then ( done , done . fail ) ;
454- } ) ;
455- } ) ;
456-
457392 describe ( 'lifecycle methods' , function ( ) {
458393 var gd ;
459394 beforeEach ( function ( ) {
0 commit comments