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

Function updateModelAxisBreak

src/component/axis/axisBreakHelperImpl.ts:524–562  ·  view source on GitHub ↗
(
    model: ComponentModel<AxisBaseOption>,
    payload: BaseAxisBreakPayload
)

Source from the content-addressed store, hash-verified

522}
523
524function updateModelAxisBreak(
525 model: ComponentModel<AxisBaseOption>,
526 payload: BaseAxisBreakPayload
527): AxisBreakUpdateResult {
528 const result: AxisBreakUpdateResult = {breaks: []};
529
530 each(payload.breaks, inputBrk => {
531 if (!inputBrk) {
532 return;
533 }
534 const breakOption = find(
535 model.get('breaks', true),
536 brkOption => getScaleBreakHelper()!.identifyAxisBreak(brkOption, inputBrk)
537 );
538 if (!breakOption) {
539 if (__DEV__) {
540 warn(`Can not find axis break by start: ${inputBrk.start}, end: ${inputBrk.end}`);
541 }
542 return;
543 }
544 const actionType = payload.type;
545 const old = {
546 isExpanded: !!breakOption.isExpanded
547 };
548 breakOption.isExpanded =
549 actionType === AXIS_BREAK_EXPAND_ACTION_TYPE ? true
550 : actionType === AXIS_BREAK_COLLAPSE_ACTION_TYPE ? false
551 : actionType === AXIS_BREAK_TOGGLE_ACTION_TYPE ? !breakOption.isExpanded
552 : breakOption.isExpanded;
553 result.breaks.push({
554 start: breakOption.start,
555 end: breakOption.end,
556 isExpanded: !!breakOption.isExpanded,
557 old,
558 });
559 });
560
561 return result;
562}
563
564
565export function installAxisBreakHelper(): void {

Callers

nothing calls this directly

Calls 4

getScaleBreakHelperFunction · 0.90
warnFunction · 0.90
eachFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…