resolve circulair import (#10247)

This commit is contained in:
Jacco van den Berg 2022-03-18 22:39:55 +01:00 committed by GitHub
parent acc7d9e04a
commit e9ce6ce60d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 29 deletions

View 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;
}

View File

@ -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

View File

@ -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