Skip to content

Commit b7f9741

Browse files
nicolaskruchtendmt0
authored andcommitted
slider tweaks
1 parent 96d9e1b commit b7f9741

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

src/default_panels/StyleSlidersPanel.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Numeric,
77
Radio,
88
PlotlySection,
9+
Dropdown,
910
SliderAccordion,
1011
} from '../components';
1112

@@ -31,6 +32,41 @@ const StyleSlidersPanel = (props, {localize: _}) => (
3132
<Numeric label={_('Size')} attr="font.size" />
3233
<ColorPicker label={_('Color')} attr="font.color" />
3334
</PlotlySection>
35+
<PlotlySection name={_('Length')} attr={'len'}>
36+
<Numeric label={_('Length')} attr={'len'} step={0.02} />
37+
<Dropdown
38+
label={_('Length Mode')}
39+
attr={'lenmode'}
40+
options={[
41+
{label: _('Fraction of canvas'), value: 'fraction'},
42+
{label: _('Pixels'), value: 'pixels'},
43+
]}
44+
/>
45+
</PlotlySection>
46+
<PlotlySection name={_('Horizontal Positioning')} attr={'x'}>
47+
<Numeric label={_('Position')} attr={'x'} showSlider step={0.02} />
48+
<Radio
49+
label={_('Anchor')}
50+
attr={'xanchor'}
51+
options={[
52+
{label: _('Left'), value: 'left'},
53+
{label: _('Center'), value: 'center'},
54+
{label: _('Right'), value: 'right'},
55+
]}
56+
/>
57+
</PlotlySection>
58+
<PlotlySection name={_('Vertical Positioning')} attr={'y'}>
59+
<Numeric label={_('Position')} attr={'y'} showSlider step={0.02} />
60+
<Radio
61+
label={_('Anchor')}
62+
attr={'yanchor'}
63+
options={[
64+
{label: _('Top'), value: 'top'},
65+
{label: _('Middle'), value: 'middle'},
66+
{label: _('Bottom'), value: 'bottom'},
67+
]}
68+
/>
69+
</PlotlySection>
3470
<PlotlySection name={_('Padding')}>
3571
<Numeric label={_('Top')} attr="pad.t" units="px" />
3672
<Numeric label={_('Bottom')} attr="pad.b" units="px" />
@@ -39,7 +75,7 @@ const StyleSlidersPanel = (props, {localize: _}) => (
3975
</PlotlySection>
4076
<PlotlySection name={_('Ticks')}>
4177
<ColorPicker label={_('Color')} attr="tickcolor" />
42-
<Numeric label={_('Legth')} attr="ticklen" />
78+
<Numeric label={_('Length')} attr="ticklen" />
4379
<Numeric label={_('Width')} attr="tickwidth" />
4480
</PlotlySection>
4581
</SliderAccordion>

0 commit comments

Comments
 (0)