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

Function retrieveAxisBreaksOption

src/coord/axisHelper.ts:291–317  ·  view source on GitHub ↗
(
    model: Model<Pick<AxisBaseOptionCommon, 'breaks'>>,
    axisType: OptionAxisType,
    coordSysSupportAxisBreaks: boolean,
)

Source from the content-addressed store, hash-verified

289}
290
291export function retrieveAxisBreaksOption(
292 model: Model<Pick<AxisBaseOptionCommon, 'breaks'>>,
293 axisType: OptionAxisType,
294 coordSysSupportAxisBreaks: boolean,
295): AxisBaseOptionCommon['breaks'] {
296 const option = model.get('breaks', true);
297 if (option != null) {
298 if (!getScaleBreakHelper()) {
299 if (__DEV__) {
300 error(
301 'Must `import {AxisBreak} from "echarts/features"; use(AxisBreak);` first if using breaks option.'
302 );
303 }
304 return undefined;
305 }
306 if (!coordSysSupportAxisBreaks || !isAxisTypeSupportAxisBreak(axisType)) {
307 if (__DEV__) { // Users have provided `breaks` in ec option but not supported.
308 const axisInfo = (model instanceof ComponentModel)
309 ? ` ${model.type}[${model.componentIndex}]`
310 : '';
311 error(`Axis${axisInfo} does not support break.`);
312 }
313 return undefined;
314 }
315 return option;
316 }
317}
318
319function isAxisTypeSupportAxisBreak(axisType: OptionAxisType): boolean {
320 return axisType !== 'category';

Callers 2

createScaleByModelFunction · 0.85

Calls 4

getScaleBreakHelperFunction · 0.90
errorFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…