(outPieceList)
| 441 | const resetMethods: Dictionary<ResetMethod> & ThisType<PiecewiseModel> = { |
| 442 | |
| 443 | splitNumber(outPieceList) { |
| 444 | const thisOption = this.option; |
| 445 | let precision = Math.min(thisOption.precision, 20); |
| 446 | const dataExtent = this.getExtent(); |
| 447 | let splitNumber = thisOption.splitNumber; |
| 448 | splitNumber = Math.max(parseInt(splitNumber as unknown as string, 10), 1); |
| 449 | thisOption.splitNumber = splitNumber; |
| 450 | |
| 451 | let splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; |
| 452 | // Precision auto-adaption |
| 453 | while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { |
| 454 | precision++; |
| 455 | } |
| 456 | thisOption.precision = precision; |
| 457 | splitStep = +splitStep.toFixed(precision); |
| 458 | |
| 459 | if (thisOption.minOpen) { |
| 460 | outPieceList.push({ |
| 461 | interval: [-Infinity, dataExtent[0]], |
| 462 | close: [0, 0] |
| 463 | }); |
| 464 | } |
| 465 | |
| 466 | for ( |
| 467 | let index = 0, curr = dataExtent[0]; |
| 468 | index < splitNumber; |
| 469 | curr += splitStep, index++ |
| 470 | ) { |
| 471 | const max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep); |
| 472 | |
| 473 | outPieceList.push({ |
| 474 | interval: [curr, max], |
| 475 | close: [1, 1] |
| 476 | }); |
| 477 | } |
| 478 | |
| 479 | if (thisOption.maxOpen) { |
| 480 | outPieceList.push({ |
| 481 | interval: [dataExtent[1], Infinity], |
| 482 | close: [0, 0] |
| 483 | }); |
| 484 | } |
| 485 | |
| 486 | reformIntervals(outPieceList as Required<InnerVisualPiece>[]); |
| 487 | |
| 488 | zrUtil.each(outPieceList, function (piece, index) { |
| 489 | piece.index = index; |
| 490 | piece.text = this.formatValueText(piece.interval); |
| 491 | }, this); |
| 492 | }, |
| 493 | |
| 494 | categories(outPieceList) { |
| 495 | const thisOption = this.option; |
nothing calls this directly
no test coverage detected
searching dependent graphs…