/
githubmirror
/
Chart.js
Обзор
Документация
Войти
/
githubmirror
/
Chart.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/plugins/plugin.filler/filler.helper.js
38 строк
973 B
Dan Onoshko
refactor: move to esm in sources (#10879)
17 ноя 2022, 16:08
Не верифицирован
17 ноя 2022, 16:08
5144127
Код
Авторство
О чём код?
/** * @typedef { import('../../core/core.controller.js').default } Chart * @typedef { import('../../core/core.scale.js').default } Scale * @typedef { import('../../elements/element.point.js').default } PointElement */ import {LineElement} from '../../elements/index.js'; import {isArray} from '../../helpers/index.js'; import {_pointsFromSegments} from './filler.segment.js'; /** * @param {PointElement[] | { x: number; y: number; }} boundary * @param {LineElement} line * @return {LineElement?} */ export function _createBoundaryLine(boundary, line) { let points = []; let _loop = false; if (isArray(boundary)) { _loop = true; // @ts-ignore points = boundary; } else { points = _pointsFromSegments(boundary, line); } return points.length ? new LineElement({ points, options: {tension: 0}, _loop, _fullLoop: _loop }) : null; } export function _shouldApplyFill(source) { return source && source.fill !== false; }