(
data: SeriesData<BarSeriesModel, DefaultDataVisual>,
orderMapping: OrderMapping,
baseAxis: Axis2D
)
| 545 | } |
| 546 | |
| 547 | private _isOrderChangedWithinSameData( |
| 548 | data: SeriesData<BarSeriesModel, DefaultDataVisual>, |
| 549 | orderMapping: OrderMapping, |
| 550 | baseAxis: Axis2D |
| 551 | ): boolean { |
| 552 | const scale = baseAxis.scale as OrdinalScale; |
| 553 | const ordinalDataDim = data.mapDimension(baseAxis.dim); |
| 554 | |
| 555 | let lastValue = Number.MAX_VALUE; |
| 556 | for (let tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) { |
| 557 | const rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum)); |
| 558 | const value = rawIdx < 0 |
| 559 | // If some tick have no bar, the tick will be treated as min. |
| 560 | ? Number.MIN_VALUE |
| 561 | // PENDING: if dataZoom on baseAxis exits, is it a performance issue? |
| 562 | : orderMapping(data.indexOfRawIndex(rawIdx)); |
| 563 | if (value > lastValue) { |
| 564 | return true; |
| 565 | } |
| 566 | lastValue = value; |
| 567 | } |
| 568 | return false; |
| 569 | } |
| 570 | |
| 571 | /* |
| 572 | * Consider the case when A and B changed order, whose representing |
no test coverage detected