mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
resolve circulair import (#10247)
This commit is contained in:
parent
acc7d9e04a
commit
e9ce6ce60d
34
src/plugins/plugin.filler/filler.helper.js
Normal file
34
src/plugins/plugin.filler/filler.helper.js
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @typedef { import('../../core/core.controller').default } Chart
|
||||
* @typedef { import('../../core/core.scale').default } Scale
|
||||
* @typedef { import('../../elements/element.point').default } PointElement
|
||||
*/
|
||||
|
||||
import {LineElement} from '../../elements';
|
||||
import {isArray} from '../../helpers';
|
||||
import {_pointsFromSegments} from './filler.segment';
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
import {LineElement} from '../../elements';
|
||||
import {isArray, isFinite} from '../../helpers';
|
||||
import {isFinite} from '../../helpers';
|
||||
import {_createBoundaryLine} from './filler.helper';
|
||||
import {_getTargetPixel, _getTargetValue} from './filler.options';
|
||||
import {_pointsFromSegments} from './filler.segment';
|
||||
import {_buildStackLine} from './filler.target.stack';
|
||||
import {simpleArc} from './simpleArc';
|
||||
|
||||
@ -35,31 +34,6 @@ export function _getTarget(source) {
|
||||
return _createBoundaryLine(boundary, line);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Chart} chart
|
||||
* @param {number} index
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import {LineElement} from '../../elements';
|
||||
import {_isBetween} from '../../helpers';
|
||||
import {_createBoundaryLine} from './filler.target';
|
||||
import {_createBoundaryLine} from './filler.helper';
|
||||
|
||||
/**
|
||||
* @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source
|
||||
|
Loading…
Reference in New Issue
Block a user