* The meanings of the input parameter `dim`: * * + If dim is a number (e.g., `1`), it means the index of the dimension. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. * + If dim is a number-like string (e.g., `"1"`): * + If there is the same con
(dim: DimensionLoose)
| 432 | * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`). |
| 433 | */ |
| 434 | private _recognizeDimIndex(dim: DimensionLoose): DimensionIndex { |
| 435 | if (zrUtil.isNumber(dim) |
| 436 | // If being a number-like string but not being defined as a dimension name. |
| 437 | || ( |
| 438 | dim != null |
| 439 | && !isNaN(dim as any) |
| 440 | && !this._getDimInfo(dim) |
| 441 | && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0) |
| 442 | ) |
| 443 | ) { |
| 444 | return +dim; |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | private _getStoreDimIndex(dim: DimensionLoose): DimensionIndex { |
| 449 | const dimIdx = this.getDimensionIndex(dim); |
no test coverage detected