MCPcopy Index your code
hub / github.com/apache/echarts / normalizeDashArrayY

Function normalizeDashArrayY

src/util/decal.ts:402–413  ·  view source on GitHub ↗

* Convert dash input into dashArray * * @param {DecalDashArrayY} dash dash input * @return {number[]} normolized dash array

(dash: DecalDashArrayY)

Source from the content-addressed store, hash-verified

400 * @return {number[]} normolized dash array
401 */
402function normalizeDashArrayY(dash: DecalDashArrayY): number[] {
403 if (!dash || typeof dash === 'object' && dash.length === 0) {
404 return [0, 0];
405 }
406 if (isNumber(dash)) {
407 const dashValue = Math.ceil(dash);
408 return [dashValue, dashValue];
409 }
410
411 const dashValue = map(dash as number[], n => Math.ceil(n));
412 return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;
413}
414
415/**
416 * Get block length of each line. A block is the length of dash line and space.

Callers 1

setPatternnSourceFunction · 0.85

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…