MCPcopy
hub / github.com/apache/echarts / parseAxisBreakOptionInwardTransform

Function parseAxisBreakOptionInwardTransform

src/scale/breakImpl.ts:715–754  ·  view source on GitHub ↗
(
    breakOptionList: AxisBreakOption[] | NullUndefined,
    scale: Scale,
    parseOpt: ParseBreakOptionOpt,
    lookupStartIdx: number,
    out: {
        lookup: ValueTransformLookupOpt['lookup'];
        original?: AxisBreakParsingResult;
        transformed?: AxisBreakParsingResult;
    }
)

Source from the content-addressed store, hash-verified

713}
714
715function parseAxisBreakOptionInwardTransform(
716 breakOptionList: AxisBreakOption[] | NullUndefined,
717 scale: Scale,
718 parseOpt: ParseBreakOptionOpt,
719 lookupStartIdx: number,
720 out: {
721 lookup: ValueTransformLookupOpt['lookup'];
722 original?: AxisBreakParsingResult;
723 transformed?: AxisBreakParsingResult;
724 }
725): void {
726 out.original = parseAxisBreakOption(breakOptionList, scale, parseOpt);
727 const transformed = out.transformed = parseAxisBreakOption(breakOptionList, scale, parseOpt);
728 const lookup = out.lookup;
729
730 transformed.breaks = map(transformed.breaks, (brk, idx) => {
731 const transOpt = {depth: SCALE_MAPPER_DEPTH_OUT_OF_BREAK} as const;
732 const vmin = scale.transformIn(brk.vmin, transOpt);
733 const vmax = scale.transformIn(brk.vmax, transOpt);
734 const gapParsed = {
735 type: brk.gapParsed.type,
736 val: brk.gapParsed.type === 'tpAbs'
737 ? scale.transformIn(brk.vmin + brk.gapParsed.val, transOpt) - vmin
738 : brk.gapParsed.val,
739 };
740
741 lookup.from[lookupStartIdx + idx] = vmin;
742 lookup.to[lookupStartIdx + idx] = brk.vmin;
743 lookup.from[lookupStartIdx + idx + 1] = vmax;
744 lookup.to[lookupStartIdx + idx + 1] = brk.vmax;
745
746 return {
747 vmin,
748 vmax,
749 gapParsed,
750 gapReal: brk.gapReal,
751 breakOption: brk.breakOption
752 };
753 });
754}
755
756const BREAK_MIN_MAX_TO_PARAM = {vmin: 'start', vmax: 'end'} as const;
757function makeAxisLabelFormatterParamBreak(

Callers

nothing calls this directly

Calls 2

parseAxisBreakOptionFunction · 0.85
transformInMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…