File tree Expand file tree Collapse file tree 6 files changed +34
-9
lines changed Expand file tree Collapse file tree 6 files changed +34
-9
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class EditableText extends Component {
57
57
autoFocus,
58
58
onKeyDown,
59
59
placeholder,
60
+ onWheel,
60
61
readOnly,
61
62
size,
62
63
} = this . props ;
@@ -73,6 +74,7 @@ class EditableText extends Component {
73
74
autoFocus = { autoFocus }
74
75
onKeyPress = { this . handleKeyPress }
75
76
onKeyDown = { onKeyDown }
77
+ onWheel = { onWheel }
76
78
placeholder = { placeholder }
77
79
readOnly = { readOnly }
78
80
size = { size }
@@ -91,6 +93,7 @@ EditableText.propTypes = {
91
93
// Called on input keyDown events
92
94
onKeyDown : PropTypes . func ,
93
95
96
+ onWheel : PropTypes . func ,
94
97
// Input value property ...
95
98
text : PropTypes . any ,
96
99
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export default class NumericInput extends Component {
16
16
this . onChange = this . onChange . bind ( this ) ;
17
17
this . updateValue = this . updateValue . bind ( this ) ;
18
18
this . onKeyDown = this . onKeyDown . bind ( this ) ;
19
+ this . onWheel = this . onWheel . bind ( this ) ;
19
20
}
20
21
21
22
componentWillReceiveProps ( nextProps ) {
@@ -37,6 +38,15 @@ export default class NumericInput extends Component {
37
38
}
38
39
}
39
40
41
+ onWheel ( e ) {
42
+ if ( e . deltaY > 0 ) {
43
+ this . incrementValue ( 'increase' ) ;
44
+ } else {
45
+ this . incrementValue ( 'decrease' ) ;
46
+ }
47
+ e . stopPropagation ( ) ;
48
+ }
49
+
40
50
onChange ( value ) {
41
51
this . setState ( { value} ) ;
42
52
}
@@ -145,6 +155,7 @@ export default class NumericInput extends Component {
145
155
onChange = { this . onChange }
146
156
onUpdate = { this . updateValue }
147
157
onKeyDown = { this . onKeyDown }
158
+ onWheel = { this . onWheel }
148
159
/>
149
160
{ this . renderArrows ( ) }
150
161
{ this . renderSlider ( ) }
Original file line number Diff line number Diff line change @@ -70,7 +70,12 @@ const StyleColorBarsPanel = ({localize: _}) => (
70
70
/>
71
71
</ Section >
72
72
< Section name = { _ ( 'Horizontal Positioning' ) } attr = "colorbar.x" >
73
- < Numeric label = { _ ( 'Horizontal Position' ) } attr = "colorbar.x" />
73
+ < Numeric
74
+ label = { _ ( 'Horizontal Position' ) }
75
+ attr = "colorbar.x"
76
+ showSlider
77
+ step = { 0.02 }
78
+ />
74
79
75
80
< Dropdown
76
81
label = { _ ( 'Positioning Anchor' ) }
@@ -83,7 +88,12 @@ const StyleColorBarsPanel = ({localize: _}) => (
83
88
/>
84
89
</ Section >
85
90
< Section name = { _ ( 'Vertical Positioning' ) } attr = "colorbar.y" >
86
- < Numeric label = { _ ( 'Vertical Position' ) } attr = "colorbar.y" />
91
+ < Numeric
92
+ label = { _ ( 'Vertical Position' ) }
93
+ attr = "colorbar.y"
94
+ showSlider
95
+ step = { 0.02 }
96
+ />
87
97
88
98
< Dropdown
89
99
label = { _ ( 'Positioning Anchor' ) }
Original file line number Diff line number Diff line change @@ -69,15 +69,15 @@ const StyleLegendPanel = ({localize: _}) => (
69
69
</ MenuPanel >
70
70
< Numeric
71
71
label = { _ ( 'X Position' ) }
72
- step = { 0.01 }
72
+ showSlider
73
+ step = { 0.02 }
73
74
attr = "legend.x"
74
- units = "px"
75
75
/>
76
76
< Numeric
77
77
label = { _ ( 'Y Position' ) }
78
- step = { 0.01 }
78
+ showSlider
79
+ step = { 0.02 }
79
80
attr = "legend.y"
80
- units = "px"
81
81
/>
82
82
</ Section >
83
83
< Section name = { _ ( 'Orientation' ) } >
Original file line number Diff line number Diff line change 7
7
PositioningRef ,
8
8
PositioningNumeric ,
9
9
Numeric ,
10
+ NumericFraction ,
10
11
ColorPicker ,
11
12
LineDashSelector ,
12
13
} from '../components' ;
@@ -49,7 +50,7 @@ const StyleShapesPanel = ({localize: _}) => (
49
50
</ Section >
50
51
< Section name = { _ ( 'Fill' ) } >
51
52
< ColorPicker label = { _ ( 'Color' ) } attr = "fillcolor" />
52
- < Numeric label = { _ ( 'Opacity' ) } step = { 0.1 } attr = "opacity" />
53
+ < NumericFraction label = { _ ( 'Opacity' ) } attr = "opacity" />
53
54
</ Section >
54
55
</ ShapeAccordion >
55
56
) ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const StyleTracesPanel = ({localize: _}) => (
40
40
] }
41
41
/>
42
42
43
- < Numeric label = { _ ( 'Opacity' ) } step = { 0.1 } attr = "opacity" />
43
+ < NumericFraction label = { _ ( 'Opacity' ) } attr = "opacity" />
44
44
< ColorPicker label = { _ ( 'Color' ) } attr = "color" />
45
45
46
46
< Section name = { _ ( 'Text Attributes' ) } >
@@ -135,7 +135,7 @@ const StyleTracesPanel = ({localize: _}) => (
135
135
/>
136
136
< ColorscalePicker label = { _ ( 'Colorscale' ) } attr = "marker.colorscale" />
137
137
< ColorPicker label = { _ ( 'Color' ) } attr = "marker.color" />
138
- < Numeric label = { _ ( 'Opacity' ) } step = { 0.1 } attr = "marker.opacity" />
138
+ < NumericFraction label = { _ ( 'Opacity' ) } attr = "marker.opacity" />
139
139
< Numeric label = { _ ( 'Size' ) } attr = "marker.size" />
140
140
< SymbolSelector label = { _ ( 'Symbol' ) } attr = "marker.symbol" />
141
141
< Numeric label = { _ ( 'Border Width' ) } attr = "marker.line.width" />
You can’t perform that action at this time.
0 commit comments