(
model: Model<Pick<AxisBaseOptionCommon, 'breaks'>>,
axisType: OptionAxisType,
coordSysSupportAxisBreaks: boolean,
)
| 289 | } |
| 290 | |
| 291 | export 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 | |
| 319 | function isAxisTypeSupportAxisBreak(axisType: OptionAxisType): boolean { |
| 320 | return axisType !== 'category'; |
no test coverage detected
searching dependent graphs…