Skip to content

Commit 97a5958

Browse files
committed
AxisInterval adjustments for Axes Panel
1 parent 811a316 commit 97a5958

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/fields/AxisInterval.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ export class UnconnectedAxisInterval extends Component {
126126
const binStartValue = this.props.fullContainer[attrHead].start;
127127
const BinStartIsDate =
128128
typeof binStartValue === 'string' && (isDateTime(binStartValue) || isJSDate(binStartValue));
129+
const tick0 =
130+
this.props.fullContainer.tick0 &&
131+
(this.props.fullContainer.tick0 || this.props.fullContainer.colorbar.tick0);
132+
const tick0IsDate = tick0 && (isDateTime(tick0) || isJSDate(tick0));
129133

130-
return BinStartIsDate ? (
134+
return BinStartIsDate || tick0IsDate ? (
131135
<Field {...this.props}>
132136
<Dropdown
133137
options={[

src/default_panels/StyleAxesPanel.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
33
import {
44
AxesRange,
55
DTicks,
6+
DTicksInterval,
67
NTicks,
78
ColorPicker,
89
Dropdown,
@@ -121,7 +122,7 @@ class StyleAxesPanel extends Component {
121122
/>
122123

123124
<DTicks label={_('Step Offset')} attr="tick0" />
124-
<DTicks label={_('Step Size')} attr="dtick" />
125+
<DTicksInterval label={_('Step Size')} attr="dtick" />
125126
<NTicks label={_('Max Number of Lines')} attr="nticks" />
126127
</VisibilitySelect>
127128
</PlotlySection>
@@ -274,7 +275,7 @@ class StyleAxesPanel extends Component {
274275
/>
275276

276277
<DTicks label={_('Step Offset')} attr="tick0" />
277-
<DTicks label={_('Step Size')} attr="dtick" />
278+
<DTicksInterval label={_('Step Size')} attr="dtick" />
278279
<NTicks label={_('Max Number of Labels')} attr="nticks" />
279280
</VisibilitySelect>
280281
</PlotlySection>
@@ -310,7 +311,7 @@ class StyleAxesPanel extends Component {
310311
/>
311312

312313
<DTicks label={_('Step Offset')} attr="tick0" />
313-
<DTicks label={_('Step Size')} attr="dtick" />
314+
<DTicksInterval label={_('Step Size')} attr="dtick" />
314315
<NTicks label={_('Max Number of Markers')} attr="nticks" />
315316
</VisibilitySelect>
316317
</PlotlySection>

0 commit comments

Comments
 (0)