@progress/kendo-charts
Version:
Kendo UI platform-independent Charts library
12 lines (9 loc) • 399 B
JavaScript
import { defined } from '../../common';
import { MIN_VALUE, MAX_VALUE } from '../../common/constants';
export default function getRange(range, min, max) {
const from = defined(range.from) ? range.from : MIN_VALUE;
const to = defined(range.to) ? range.to : MAX_VALUE;
range.from = Math.max(Math.min(to, from), min);
range.to = Math.min(Math.max(to, from), max);
return range;
}