File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class DefaultEditor extends Component {
2929 this . hasMenus = this . hasMenus . bind ( this ) ;
3030 this . hasSliders = this . hasSliders . bind ( this ) ;
3131 this . hasColorbars = this . hasColorbars . bind ( this ) ;
32+ this . hasLegend = this . hasLegend . bind ( this ) ;
3233 }
3334
3435 hasTransforms ( ) {
@@ -65,6 +66,10 @@ class DefaultEditor extends Component {
6566 return this . context . fullData . some ( d => traceHasColorbar ( { } , d ) ) ;
6667 }
6768
69+ hasLegend ( ) {
70+ return this . context . fullData . some ( t => t . showlegend !== undefined ) ; // eslint-disable-line no-undefined
71+ }
72+
6873 hasMaps ( ) {
6974 const {
7075 layout : { geo, mapbox} ,
@@ -89,7 +94,7 @@ class DefaultEditor extends Component {
8994 < StyleTracesPanel group = { _ ( 'Style' ) } name = { _ ( 'Traces' ) } />
9095 { this . hasAxes ( ) && < StyleAxesPanel group = { _ ( 'Style' ) } name = { _ ( 'Axes' ) } /> }
9196 { this . hasMaps ( ) && < StyleMapsPanel group = { _ ( 'Style' ) } name = { _ ( 'Maps' ) } /> }
92- < StyleLegendPanel group = { _ ( 'Style' ) } name = { _ ( 'Legend' ) } />
97+ { this . hasLegend ( ) && < StyleLegendPanel group = { _ ( 'Style' ) } name = { _ ( 'Legend' ) } /> }
9398 { this . hasColorbars ( ) && < StyleColorbarsPanel group = { _ ( 'Style' ) } name = { _ ( 'Color Bars' ) } /> }
9499 < StyleNotesPanel group = { _ ( 'Style' ) } name = { _ ( 'Annotation' ) } />
95100 < StyleShapesPanel group = { _ ( 'Style' ) } name = { _ ( 'Shapes' ) } />
You can’t perform that action at this time.
0 commit comments