Skip to content

Commit c5502ad

Browse files
fix weird legacy bug
1 parent e06b6c0 commit c5502ad

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/components/containers/derived.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ const LayoutSection = connectLayoutToPlot(PlotlySection);
1010

1111
const TraceTypeSection = (props, context) => {
1212
const {fullContainer, fullData} = context;
13+
const {mode, traceTypes} = props;
1314

1415
const ifConnectedToTrace =
15-
fullContainer && props.traceTypes.includes(fullContainer.type);
16+
mode === 'trace' &&
17+
fullContainer &&
18+
traceTypes.includes(fullContainer.type);
1619

1720
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));
1924

2025
if (ifConnectedToTrace || ifConnectedToLayout) {
2126
return <PlotlySection {...props} />;
@@ -29,10 +34,12 @@ TraceTypeSection.propTypes = {
2934
children: PropTypes.node,
3035
name: PropTypes.string,
3136
traceTypes: PropTypes.array,
37+
mode: PropTypes.string,
3238
};
3339

3440
TraceTypeSection.defaultProps = {
3541
traceTypes: [],
42+
mode: 'layout',
3643
};
3744

3845
export {LayoutPanel, LayoutSection, TraceTypeSection};

src/default_panels/GraphCreatePanel.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ const GraphCreatePanel = (props, {localize: _}) => {
8383
<DataSelector label={_('Headers')} attr="header.values" />
8484
<DataSelector label={_('Columns')} attr="cells.values" />
8585

86-
<TraceTypeSection traceTypes={['scatterpolar', 'scatterpolargl']}>
86+
<TraceTypeSection
87+
traceTypes={['scatterpolar', 'scatterpolargl']}
88+
mode="trace"
89+
>
8790
<DataSelector label={_('Radius')} attr="r" />
8891
<DataSelector label={_('Theta')} attr="theta" />
8992
<Dropdown

0 commit comments

Comments
 (0)