MCPcopy Index your code
hub / github.com/apache/echarts / convertNormalEmphasis

Function convertNormalEmphasis

src/preprocessor/helper/compatStyle.ts:72–108  ·  view source on GitHub ↗
(opt: Dictionary<any>, optType: string, useExtend?: boolean)

Source from the content-addressed store, hash-verified

70}
71
72function convertNormalEmphasis(opt: Dictionary<any>, optType: string, useExtend?: boolean) {
73 if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
74 const normalOpt = opt[optType].normal;
75 const emphasisOpt = opt[optType].emphasis;
76
77 if (normalOpt) {
78 if (__DEV__) {
79 // eslint-disable-next-line max-len
80 deprecateLog(`'normal' hierarchy in ${optType} has been removed since 4.0. All style properties are configured in ${optType} directly now.`);
81 }
82 // Timeline controlStyle has other properties besides normal and emphasis
83 if (useExtend) {
84 opt[optType].normal = opt[optType].emphasis = null;
85 zrUtil.defaults(opt[optType], normalOpt);
86 }
87 else {
88 opt[optType] = normalOpt;
89 }
90 }
91 if (emphasisOpt) {
92 if (__DEV__) {
93 deprecateLog(`${optType}.emphasis has been changed to emphasis.${optType} since 4.0`);
94 }
95 opt.emphasis = opt.emphasis || {};
96 opt.emphasis[optType] = emphasisOpt;
97
98 // Also compat the case user mix the style and focus together in ec3 style
99 // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }
100 if (emphasisOpt.focus) {
101 opt.emphasis.focus = emphasisOpt.focus;
102 }
103 if (emphasisOpt.blurScope) {
104 opt.emphasis.blurScope = emphasisOpt.blurScope;
105 }
106 }
107 }
108}
109
110function removeEC3NormalStatus(opt: Dictionary<any>) {
111 convertNormalEmphasis(opt, 'itemStyle');

Callers 3

removeEC3NormalStatusFunction · 0.85
processSeriesFunction · 0.85
globalCompatStyleFunction · 0.85

Calls 1

deprecateLogFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…