(min: number, max: number)
| 33 | const month = year / 12; |
| 34 | |
| 35 | function getD3TimeFormat(min: number, max: number) { |
| 36 | const span = max - min; |
| 37 | if (span > year) return '%Y'; |
| 38 | if (span > month) return '%b %Y'; |
| 39 | if (span > day) return '%d %b %y'; |
| 40 | if (span > hour) return '%d %b %H:%M'; |
| 41 | if (span > second) return '%H:%M:%S'; |
| 42 | return '%S.%L'; |
| 43 | } |
| 44 | |
| 45 | function vegaTimeFormat(values: [number, number][], d3TimeFormat: string) { |
| 46 | const name = 'timeFormat'; |