File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,17 @@ const LayoutSection = connectLayoutToPlot(PlotlySection);
10
10
11
11
const TraceTypeSection = ( props , context ) => {
12
12
const { fullContainer, fullData} = context ;
13
+ const { mode, traceTypes} = props ;
13
14
14
15
const ifConnectedToTrace =
15
- fullContainer && props . traceTypes . includes ( fullContainer . type ) ;
16
+ mode === 'trace' &&
17
+ fullContainer &&
18
+ traceTypes . includes ( fullContainer . type ) ;
16
19
17
20
const ifConnectedToLayout =
18
- fullData && fullData . some ( t => props . traceTypes . includes ( t . type ) ) ;
21
+ mode === 'layout' &&
22
+ fullData &&
23
+ fullData . some ( t => traceTypes . includes ( t . type ) ) ;
19
24
20
25
if ( ifConnectedToTrace || ifConnectedToLayout ) {
21
26
return < PlotlySection { ...props } /> ;
@@ -29,10 +34,12 @@ TraceTypeSection.propTypes = {
29
34
children : PropTypes . node ,
30
35
name : PropTypes . string ,
31
36
traceTypes : PropTypes . array ,
37
+ mode : PropTypes . string ,
32
38
} ;
33
39
34
40
TraceTypeSection . defaultProps = {
35
41
traceTypes : [ ] ,
42
+ mode : 'layout' ,
36
43
} ;
37
44
38
45
export { LayoutPanel , LayoutSection , TraceTypeSection } ;
Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ const GraphCreatePanel = (props, {localize: _}) => {
83
83
< DataSelector label = { _ ( 'Headers' ) } attr = "header.values" />
84
84
< DataSelector label = { _ ( 'Columns' ) } attr = "cells.values" />
85
85
86
- < TraceTypeSection traceTypes = { [ 'scatterpolar' , 'scatterpolargl' ] } >
86
+ < TraceTypeSection
87
+ traceTypes = { [ 'scatterpolar' , 'scatterpolargl' ] }
88
+ mode = "trace"
89
+ >
87
90
< DataSelector label = { _ ( 'Radius' ) } attr = "r" />
88
91
< DataSelector label = { _ ( 'Theta' ) } attr = "theta" />
89
92
< Dropdown
You can’t perform that action at this time.
0 commit comments