@@ -2346,6 +2346,46 @@ describe('legend interaction', function () {
23462346 } ) ;
23472347 } ) ;
23482348
2349+ describe ( 'shape legendgroup with showlegend:false members' , ( ) => {
2350+ beforeEach ( ( ) => Plotly . newPlot ( gd , [ ] , {
2351+ shapes : [
2352+ {
2353+ showlegend : true ,
2354+ legendgroup : 'g' ,
2355+ type : 'line' ,
2356+ xref : 'paper' , yref : 'paper' ,
2357+ x0 : 0.1 , y0 : 0.1 , x1 : 0.2 , y1 : 0.2
2358+ } ,
2359+ {
2360+ showlegend : false ,
2361+ legendgroup : 'g' ,
2362+ type : 'line' ,
2363+ xref : 'paper' , yref : 'paper' ,
2364+ x0 : 0.3 , y0 : 0.3 , x1 : 0.4 , y1 : 0.4
2365+ } ,
2366+ {
2367+ showlegend : true ,
2368+ type : 'line' ,
2369+ xref : 'paper' , yref : 'paper' ,
2370+ x0 : 0.5 , y0 : 0.5 , x1 : 0.6 , y1 : 0.6
2371+ }
2372+ ]
2373+ } ) ) ;
2374+
2375+ it ( 'toggles all group members when clicking the visible group entry' , async ( ) => {
2376+ assertVisibleShapes ( [ true , true , true ] ) ( ) ;
2377+ await click ( 0 ) ( ) ;
2378+ assertVisibleShapes ( [ 'legendonly' , 'legendonly' , true ] ) ( ) ;
2379+ await click ( 0 ) ( ) ;
2380+ assertVisibleShapes ( [ true , true , true ] ) ( ) ;
2381+ } ) ;
2382+
2383+ it ( 'isolates the group and hides showlegend:false members of other groups' , async ( ) => {
2384+ await click ( 0 , 2 ) ( ) ;
2385+ assertVisibleShapes ( [ true , true , 'legendonly' ] ) ( ) ;
2386+ } ) ;
2387+ } ) ;
2388+
23492389 describe ( 'legendgroup visibility' , function ( ) {
23502390 beforeEach ( function ( done ) {
23512391 Plotly . newPlot ( gd , [
0 commit comments