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

Function getDataDimensionsOnAxis

src/coord/axisHelper.ts:265–281  ·  view source on GitHub ↗
(data: SeriesData, axisDim: string)

Source from the content-addressed store, hash-verified

263}
264
265export function getDataDimensionsOnAxis(data: SeriesData, axisDim: string): DimensionName[] {
266 // Remove duplicated dat dimensions caused by `getStackedDimension`.
267 const dataDimMap = {} as Dictionary<boolean>;
268 // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult').
269 // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since
270 // there has been stacked result dim?
271 zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {
272 // For example, the extent of the original dimension
273 // is [0.1, 0.5], the extent of the `stackResultDimension`
274 // is [7, 9], the final extent should NOT include [0.1, 0.5],
275 // because there is no graphic corresponding to [0.1, 0.5].
276 // See the case in `test/area-stack.html` `main1`, where area line
277 // stack needs `yAxis` not start from 0.
278 dataDimMap[getStackedDimension(data, dataDim)] = true;
279 });
280 return zrUtil.keys(dataDimMap);
281}
282
283export function isNameLocationCenter(nameLocation: AxisBaseOptionCommon['nameLocation']) {
284 return nameLocation === 'middle' || nameLocation === 'center';

Callers 1

Calls 3

getStackedDimensionFunction · 0.90
mapDimensionsAllMethod · 0.80
eachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…