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

Function makeDefaultEncode

src/chart/parallel/ParallelSeries.ts:160–182  ·  view source on GitHub ↗
(seriesModel: ParallelSeriesModel)

Source from the content-addressed store, hash-verified

158}
159
160function makeDefaultEncode(seriesModel: ParallelSeriesModel): OptionEncode {
161 // The mapping of parallelAxis dimension to data dimension can
162 // be specified in parallelAxis.option.dim. For example, if
163 // parallelAxis.option.dim is 'dim3', it mapping to the third
164 // dimension of data. But `data.encode` has higher priority.
165 // Moreover, parallelModel.dimension should not be regarded as data
166 // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];
167
168 const parallelModel = seriesModel.ecModel.getComponent(
169 'parallel', seriesModel.get('parallelIndex')
170 ) as ParallelModel;
171 if (!parallelModel) {
172 return;
173 }
174
175 const encodeDefine: Dictionary<OptionEncodeValue> = {};
176 each(parallelModel.dimensions, function (axisDim) {
177 const dataDimIndex = convertDimNameToNumber(axisDim);
178 encodeDefine[axisDim] = dataDimIndex;
179 });
180
181 return encodeDefine;
182}
183
184function convertDimNameToNumber(dimName: DimensionName): number {
185 return +dimName.replace('dim', '');

Callers

nothing calls this directly

Calls 4

convertDimNameToNumberFunction · 0.85
getComponentMethod · 0.80
eachFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…