@bokeh/bokehjs
Version:
Interactive, novel data visualization
34 lines • 1.03 kB
JavaScript
import { NumericalRangeSlider, NumericalRangeSliderView } from "./numerical_range_slider";
import { isString } from "../../../core/util/types";
import { datetime } from "../../../core/util/templating";
export class DateRangeSliderView extends NumericalRangeSliderView {
static __name__ = "DateRangeSliderView";
behaviour = "drag";
connected = [false, true, false];
_calc_to() {
const spec = super._calc_to();
spec.step *= 86_400_000;
return spec;
}
_formatter(value, format) {
if (isString(format)) {
return datetime(value, format);
}
else {
return format.compute(value);
}
}
}
export class DateRangeSlider extends NumericalRangeSlider {
static __name__ = "DateRangeSlider";
constructor(attrs) {
super(attrs);
}
static {
this.prototype.default_view = DateRangeSliderView;
this.override({
format: "%d %b %Y",
});
}
}
//# sourceMappingURL=date_range_slider.js.map