Skip to content

styling error bars #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion src/components/fields/ErrorBars.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, {Component, Fragment} from 'react';
import {DataSelector, Radio, Numeric} from '../index';
import {DataSelector, Radio, Numeric, MultiColorPicker} from '../index';
import RadioBlocks from '../widgets/RadioBlocks';
import Field from './Field';
import {connectToContainer} from 'lib';
Expand Down Expand Up @@ -91,6 +91,36 @@ class ErrorBars extends Component {
const mode = this.getMode();
const showCustomDataControl = this.props.fullValue.type === 'data';

const styleAttrs = (
<Fragment>
<Radio
label={_('Copy Y Style')}
attr={`${this.props.attr}.copy_ystyle`}
options={[
{label: _('Yes'), value: true},
{label: _('No'), value: false},
]}
/>
<Radio
label={_('Copy Z Style')}
attr={`${this.props.attr}.copy_zstyle`}
options={[
{label: _('Yes'), value: true},
{label: _('No'), value: false},
]}
/>
<MultiColorPicker
label={_('Color')}
attr={`${this.props.attr}.color`}
/>
<Numeric label={_('Thickness')} attr={`${this.props.attr}.thickness`} />
<Numeric
label={_('Crossbar Width')}
attr={`${this.props.attr}.width`}
/>
</Fragment>
);

if (mode === 'symmetric') {
return (
<Fragment>
Expand All @@ -111,6 +141,7 @@ class ErrorBars extends Component {
attr={`${this.props.attr}.array`}
/>
) : null}
{styleAttrs}
</Fragment>
);
}
Expand Down Expand Up @@ -144,6 +175,7 @@ class ErrorBars extends Component {
/>
</Fragment>
) : null}
{styleAttrs}
</Fragment>
);
}
Expand Down