MCPcopy Create free account
hub / github.com/apache/echarts / actionHandler

Function actionHandler

src/component/axis/axisAction.ts:126–146  ·  view source on GitHub ↗
(payload: BaseAxisBreakPayload, ecModel: GlobalModel)

Source from the content-addressed store, hash-verified

124 registers.registerAction(toggleAxisBreakActionInfo, actionHandler);
125
126 function actionHandler(payload: BaseAxisBreakPayload, ecModel: GlobalModel) {
127 const eventBreaks: AxisBreakChangedEventBreak[] = [];
128 const finderResult = parseFinder(ecModel, payload);
129
130 function dealUpdate(modelProp: string, indexProp: string) {
131 each(finderResult[modelProp], (axisModel: AxisBaseModel) => {
132 const result = axisModel.updateAxisBreaks(payload);
133 each(result.breaks, item => {
134 eventBreaks.push(
135 defaults({[indexProp]: axisModel.componentIndex}, item)
136 );
137 });
138 });
139 }
140
141 dealUpdate('xAxisModels', 'xAxisIndex');
142 dealUpdate('yAxisModels', 'yAxisIndex');
143 dealUpdate('singleAxisModels', 'singleAxisIndex');
144
145 return {eventBreaks};
146 }
147}

Callers

nothing calls this directly

Calls 2

parseFinderFunction · 0.90
dealUpdateFunction · 0.85

Tested by

no test coverage detected