MCPcopy
hub / github.com/apache/echarts / getDimension

Method getDimension

src/data/SeriesData.ts:369–391  ·  view source on GitHub ↗

* * Get concrete dimension name by dimension name or dimension index. * If input a dimension name, do not validate whether the dimension name exits. * * @caution * @param dim Must make sure the dimension is `SeriesDimensionLoose`. * Because only those dimensions will ha

(dim: SeriesDimensionLoose)

Source from the content-addressed store, hash-verified

367 * @return Concrete dim name.
368 */
369 getDimension(dim: SeriesDimensionLoose): DimensionName {
370 let dimIdx = this._recognizeDimIndex(dim);
371 if (dimIdx == null) {
372 return dim as DimensionName;
373 }
374 dimIdx = dim as DimensionIndex;
375
376 if (!this._dimOmitted) {
377 return this.dimensions[dimIdx];
378 }
379
380 // Retrieve from series dimension definition because it probably contains
381 // generated dimension name (like 'x', 'y').
382 const dimName = this._dimIdxToName.get(dimIdx);
383 if (dimName != null) {
384 return dimName;
385 }
386
387 const sourceDimDef = this._schema.getSourceDimension(dimIdx);
388 if (sourceDimDef) {
389 return sourceDimDef.name;
390 }
391 }
392
393 /**
394 * Get dimension index in data store. Return -1 if not found.

Callers 3

getDimensionInfoMethod · 0.95
setApproximateExtentMethod · 0.95

Calls 3

_recognizeDimIndexMethod · 0.95
getSourceDimensionMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected