Skip to content

Commit cc64292

Browse files
Merge pull request #651 from plotly/errorstyle
styling error bars
2 parents 410870e + cccad1d commit cc64292

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/components/fields/ErrorBars.js

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React, {Component, Fragment} from 'react';
3-
import {DataSelector, Radio, Numeric} from '../index';
3+
import {DataSelector, Radio, Numeric, MultiColorPicker} from '../index';
44
import RadioBlocks from '../widgets/RadioBlocks';
55
import Field from './Field';
66
import {connectToContainer} from 'lib';
@@ -91,6 +91,36 @@ class ErrorBars extends Component {
9191
const mode = this.getMode();
9292
const showCustomDataControl = this.props.fullValue.type === 'data';
9393

94+
const styleAttrs = (
95+
<Fragment>
96+
<Radio
97+
label={_('Copy Y Style')}
98+
attr={`${this.props.attr}.copy_ystyle`}
99+
options={[
100+
{label: _('Yes'), value: true},
101+
{label: _('No'), value: false},
102+
]}
103+
/>
104+
<Radio
105+
label={_('Copy Z Style')}
106+
attr={`${this.props.attr}.copy_zstyle`}
107+
options={[
108+
{label: _('Yes'), value: true},
109+
{label: _('No'), value: false},
110+
]}
111+
/>
112+
<MultiColorPicker
113+
label={_('Color')}
114+
attr={`${this.props.attr}.color`}
115+
/>
116+
<Numeric label={_('Thickness')} attr={`${this.props.attr}.thickness`} />
117+
<Numeric
118+
label={_('Crossbar Width')}
119+
attr={`${this.props.attr}.width`}
120+
/>
121+
</Fragment>
122+
);
123+
94124
if (mode === 'symmetric') {
95125
return (
96126
<Fragment>
@@ -111,6 +141,7 @@ class ErrorBars extends Component {
111141
attr={`${this.props.attr}.array`}
112142
/>
113143
) : null}
144+
{styleAttrs}
114145
</Fragment>
115146
);
116147
}
@@ -144,6 +175,7 @@ class ErrorBars extends Component {
144175
/>
145176
</Fragment>
146177
) : null}
178+
{styleAttrs}
147179
</Fragment>
148180
);
149181
}

0 commit comments

Comments
 (0)