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

Function globalCompatStyle

src/preprocessor/helper/compatStyle.ts:259–355  ·  view source on GitHub ↗
(option: any, isTheme?: boolean)

Source from the content-addressed store, hash-verified

257}
258
259export default function globalCompatStyle(option: any, isTheme?: boolean) {
260 each(toArr(option.series), function (seriesOpt) {
261 isObject(seriesOpt) && processSeries(seriesOpt);
262 });
263
264 const axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];
265 isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');
266
267 each(
268 axes,
269 function (axisName) {
270 each(toArr(option[axisName]), function (axisOpt) {
271 if (axisOpt) {
272 compatTextStyle(axisOpt, 'axisLabel');
273 compatTextStyle(axisOpt.axisPointer, 'label');
274 }
275 });
276 }
277 );
278
279 each(toArr(option.parallel), function (parallelOpt) {
280 const parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;
281 compatTextStyle(parallelAxisDefault, 'axisLabel');
282 compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');
283 });
284
285 each(toArr(option.calendar), function (calendarOpt) {
286 convertNormalEmphasis(calendarOpt, 'itemStyle');
287 compatTextStyle(calendarOpt, 'dayLabel');
288 compatTextStyle(calendarOpt, 'monthLabel');
289 compatTextStyle(calendarOpt, 'yearLabel');
290 });
291
292 // radar.name.textStyle
293 each(toArr(option.radar), function (radarOpt) {
294 compatTextStyle(radarOpt, 'name');
295 // Use axisName instead of name because component has name property
296 if (radarOpt.name && radarOpt.axisName == null) {
297 radarOpt.axisName = radarOpt.name;
298 delete radarOpt.name;
299 if (__DEV__) {
300 deprecateLog('name property in radar component has been changed to axisName');
301 }
302 }
303 if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {
304 radarOpt.axisNameGap = radarOpt.nameGap;
305 delete radarOpt.nameGap;
306 if (__DEV__) {
307 deprecateLog('nameGap property in radar component has been changed to axisNameGap');
308 }
309 }
310 if (__DEV__) {
311 each(radarOpt.indicator, function (indicatorOpt: any) {
312 if (indicatorOpt.text) {
313 deprecateReplaceLog('text', 'name', 'radar.indicator');
314 }
315 });
316 }

Callers

nothing calls this directly

Calls 11

deprecateLogFunction · 0.90
deprecateReplaceLogFunction · 0.90
toArrFunction · 0.85
processSeriesFunction · 0.85
compatTextStyleFunction · 0.85
convertNormalEmphasisFunction · 0.85
compatEC3CommonStylesFunction · 0.85
toObjFunction · 0.85
eachFunction · 0.50
isObjectFunction · 0.50
eachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…