Skip to content

Commit ca4c4e6

Browse files
committed
Style General and Style Axes - folds folded by default
1 parent 8097fbd commit ca4c4e6

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/DefaultEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ class DefaultEditor extends Component {
8888
{this.hasTransforms() && (
8989
<GraphTransformsPanel group={_('Structure')} name={_('Transforms')} />
9090
)}
91-
<StyleLayoutPanel group={_('Style')} name={_('General')} />
91+
<StyleLayoutPanel group={_('Style')} name={_('General')} collapsedOnStart />
9292
<StyleTracesPanel group={_('Style')} name={_('Traces')} />
93-
{this.hasAxes() && <StyleAxesPanel group={_('Style')} name={_('Axes')} />}
93+
{this.hasAxes() && <StyleAxesPanel group={_('Style')} name={_('Axes')} collapsedOnStart />}
9494
{this.hasMaps() && <StyleMapsPanel group={_('Style')} name={_('Maps')} />}
9595
{this.hasLegend() && <StyleLegendPanel group={_('Style')} name={_('Legend')} />}
9696
{this.hasColorbars() && <StyleColorbarsPanel group={_('Style')} name={_('Color Bars')} />}

src/components/containers/PlotlyPanel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Panel extends Component {
6868
});
6969

7070
if (this.state.individualFoldStates.length !== numFolds) {
71-
const newFoldStates = new Array(numFolds).fill(false);
71+
const newFoldStates = new Array(numFolds).fill(this.props.collapsedOnStart);
7272
this.setState({
7373
individualFoldStates: this.props.addAction
7474
? newFoldStates.map((e, i) => i !== numFolds - 1)
@@ -129,10 +129,12 @@ Panel.propTypes = {
129129
noPadding: PropTypes.bool,
130130
showExpandCollapse: PropTypes.bool,
131131
canReorder: PropTypes.bool,
132+
collapsedOnStart: PropTypes.bool,
132133
};
133134

134135
Panel.defaultProps = {
135136
showExpandCollapse: true,
137+
collapsedOnStart: false,
136138
};
137139

138140
Panel.contextTypes = {

src/default_panels/StyleAxesPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class StyleAxesPanel extends Component {
2727
render() {
2828
const {localize: _} = this.context;
2929
return (
30-
<LayoutPanel>
30+
<LayoutPanel {...this.props}>
3131
<AxesFold
3232
name={_('Titles')}
3333
axisFilter={(axis) => !(axis._name.includes('angular') || axis._subplot.includes('geo'))}

src/default_panels/StyleLayoutPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {HoverColor} from '../components/fields/derived';
2121
import DataSelector from '../components/fields/DataSelector';
2222

2323
const StyleLayoutPanel = (props, {localize: _}) => (
24-
<LayoutPanel>
24+
<LayoutPanel {...props}>
2525
<PlotlyFold name={_('Defaults')}>
2626
<ColorPicker label={_('Plot Background')} attr="plot_bgcolor" />
2727
<ColorPicker label={_('Margin Color')} attr="paper_bgcolor" />

0 commit comments

Comments
 (0)