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

Function findAxisModels

src/coord/cartesian/cartesianAxisHelper.ts:129–157  ·  view source on GitHub ↗
(seriesModel: SeriesModel)

Source from the content-addressed store, hash-verified

127}
128
129export function findAxisModels(seriesModel: SeriesModel): {
130 xAxisModel: CartesianAxisModel;
131 yAxisModel: CartesianAxisModel;
132} {
133 const axisModelMap = {
134 xAxisModel: null,
135 yAxisModel: null
136 } as ReturnType<typeof findAxisModels>;
137 zrUtil.each(axisModelMap, function (v, key) {
138 const axisType = key.replace(/Model$/, '');
139 const axisModel = seriesModel.getReferringComponents(
140 axisType, SINGLE_REFERRING
141 ).models[0] as CartesianAxisModel;
142
143 if (__DEV__) {
144 if (!axisModel) {
145 throw new Error(axisType + ' "' + zrUtil.retrieve3(
146 seriesModel.get(axisType + 'Index' as any),
147 seriesModel.get(axisType + 'Id' as any),
148 0
149 ) + '" not found');
150 }
151 }
152
153 axisModelMap[key] = axisModel;
154 });
155
156 return axisModelMap;
157}
158
159export function createCartesianAxisViewCommonPartBuilder(
160 gridRect: LayoutRect,

Callers 1

coordSysProviderMethod · 0.90

Calls 3

eachMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…