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

Method _recognizeDimIndex

src/data/SeriesData.ts:434–446  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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);

Callers 2

getDimensionMethod · 0.95
getDimensionIndexMethod · 0.95

Calls 1

Tested by

no test coverage detected