@@ -31,6 +31,7 @@ const spec1: BasicSeriesSpec = {
3131 yAccessors : [ 'y' ] ,
3232 yScaleToDataExtent : false ,
3333 data : [ ] ,
34+ hideInLegend : false ,
3435} ;
3536const spec2 : BasicSeriesSpec = {
3637 id : getSpecId ( 'spec2' ) ,
@@ -42,6 +43,7 @@ const spec2: BasicSeriesSpec = {
4243 yAccessors : [ 'y' ] ,
4344 yScaleToDataExtent : false ,
4445 data : [ ] ,
46+ hideInLegend : false ,
4547} ;
4648
4749describe ( 'Legends' , ( ) => {
@@ -65,7 +67,8 @@ describe('Legends', () => {
6567 color : 'red' ,
6668 label : 'Spec 1 title' ,
6769 value : { colorValues : [ ] , specId : 'spec1' } ,
68- isVisible : true ,
70+ isSeriesVisible : true ,
71+ isLegendItemVisible : true ,
6972 key : 'colorSeries1a' ,
7073 } ,
7174 ] ;
@@ -80,14 +83,16 @@ describe('Legends', () => {
8083 color : 'red' ,
8184 label : 'Spec 1 title' ,
8285 value : { colorValues : [ ] , specId : 'spec1' } ,
83- isVisible : true ,
86+ isSeriesVisible : true ,
87+ isLegendItemVisible : true ,
8488 key : 'colorSeries1a' ,
8589 } ,
8690 {
8791 color : 'blue' ,
8892 label : 'a - b' ,
8993 value : { colorValues : [ 'a' , 'b' ] , specId : 'spec1' } ,
90- isVisible : true ,
94+ isSeriesVisible : true ,
95+ isLegendItemVisible : true ,
9196 key : 'colorSeries1b' ,
9297 } ,
9398 ] ;
@@ -102,14 +107,16 @@ describe('Legends', () => {
102107 color : 'red' ,
103108 label : 'Spec 1 title' ,
104109 value : { colorValues : [ ] , specId : 'spec1' } ,
105- isVisible : true ,
110+ isSeriesVisible : true ,
111+ isLegendItemVisible : true ,
106112 key : 'colorSeries1a' ,
107113 } ,
108114 {
109115 color : 'green' ,
110116 label : 'spec2' ,
111117 value : { colorValues : [ ] , specId : 'spec2' } ,
112- isVisible : true ,
118+ isSeriesVisible : true ,
119+ isLegendItemVisible : true ,
113120 key : 'colorSeries2a' ,
114121 } ,
115122 ] ;
@@ -129,7 +136,8 @@ describe('Legends', () => {
129136 color : 'violet' ,
130137 label : 'Spec 1 title' ,
131138 value : { colorValues : [ ] , specId : 'spec1' } ,
132- isVisible : true ,
139+ isSeriesVisible : true ,
140+ isLegendItemVisible : true ,
133141 key : 'colorSeries1a' ,
134142 } ,
135143 ] ;
@@ -146,9 +154,9 @@ describe('Legends', () => {
146154
147155 const legend = computeLegend ( seriesColor , emptyColorMap , specs , 'violet' , deselectedDataSeries ) ;
148156
149- const visibility = [ ...legend . values ( ) ] . map ( ( item ) => item . isVisible ) ;
157+ const visibility = [ ...legend . values ( ) ] . map ( ( item ) => item . isSeriesVisible ) ;
150158
151- expect ( visibility ) . toEqual ( [ true , true , true , true ] ) ;
159+ expect ( visibility ) . toEqual ( [ true , true , true ] ) ;
152160 } ) ;
153161 it ( 'selectively sets series to visible when there are deselectedDataSeries items' , ( ) => {
154162 seriesColor . set ( 'colorSeries1a' , colorValues1a ) ;
@@ -161,8 +169,8 @@ describe('Legends', () => {
161169
162170 const legend = computeLegend ( seriesColor , emptyColorMap , specs , 'violet' , deselectedDataSeries ) ;
163171
164- const visibility = [ ...legend . values ( ) ] . map ( ( item ) => item . isVisible ) ;
165- expect ( visibility ) . toEqual ( [ false , false , true , true ] ) ;
172+ const visibility = [ ...legend . values ( ) ] . map ( ( item ) => item . isSeriesVisible ) ;
173+ expect ( visibility ) . toEqual ( [ false , false , true ] ) ;
166174 } ) ;
167175 it ( 'returns the right series label for a color series' , ( ) => {
168176 let label = getSeriesColorLabel ( [ ] , true ) ;
0 commit comments