utils.js 593 B

12345678910111213141516171819202122
  1. import { clamp } from '@antv/util';
  2. import { isRealNumber } from '../../utils/number';
  3. /**
  4. * 获取进度条数据
  5. */
  6. export function getProgressData(percent) {
  7. var clampPercent = clamp(isRealNumber(percent) ? percent : 0, 0, 1);
  8. return [
  9. {
  10. // 用于 progressStyle 的回调方法
  11. current: "".concat(clampPercent),
  12. type: 'current',
  13. percent: clampPercent,
  14. },
  15. {
  16. current: "".concat(clampPercent),
  17. type: 'target',
  18. percent: 1,
  19. },
  20. ];
  21. }
  22. //# sourceMappingURL=utils.js.map