|
1 | 1 | import isNumeric from 'fast-isnumeric'; |
2 | 2 | import {UnconnectedDropdown} from './Dropdown'; |
| 3 | +import {UnconnectedDropdownCustom} from './DropdownCustom'; |
3 | 4 | import {UnconnectedFlaglist} from './Flaglist'; |
4 | 5 | import {UnconnectedNumeric} from './Numeric'; |
5 | 6 | import {UnconnectedAxisRangeValue} from './AxisRangeValue'; |
@@ -145,6 +146,25 @@ export const BinningDropdown = connectToContainer(UnconnectedDropdown, { |
145 | 146 | }, |
146 | 147 | }); |
147 | 148 |
|
| 149 | +export const TickFormat = connectToContainer(UnconnectedDropdownCustom, { |
| 150 | + modifyPlotProps: (props, context, plotProps) => { |
| 151 | + const {localize: _} = context; |
| 152 | + if (plotProps.fullContainer.type === 'date') { |
| 153 | + plotProps.options = [ |
| 154 | + {label: _('Default'), value: ''}, |
| 155 | + {label: _('Advanced (d3-time-format)'), value: '%x'}, |
| 156 | + ]; |
| 157 | + plotProps.customOpt = '%x'; |
| 158 | + } else { |
| 159 | + plotProps.options = [ |
| 160 | + {label: _('Simple'), value: ''}, |
| 161 | + {label: _('Advanced (d3-format)'), value: 's'}, |
| 162 | + ]; |
| 163 | + plotProps.customOpt = 's'; |
| 164 | + } |
| 165 | + }, |
| 166 | +}); |
| 167 | + |
148 | 168 | export const ShowInLegend = connectToContainer(UnconnectedVisibilitySelect, { |
149 | 169 | modifyPlotProps: (props, context, plotProps) => { |
150 | 170 | plotProps.isVisible = context.fullLayout.showlegend; |
|
0 commit comments