Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acc7d9e
commit e9ce6ce
Showing
3 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters