(
el: Element,
dataIndex: number,
elOption: CustomElementOption,
seriesModel: CustomSeriesModel,
isInit: boolean
)
| 1139 | } |
| 1140 | |
| 1141 | function doCreateOrUpdateClipPath( |
| 1142 | el: Element, |
| 1143 | dataIndex: number, |
| 1144 | elOption: CustomElementOption, |
| 1145 | seriesModel: CustomSeriesModel, |
| 1146 | isInit: boolean |
| 1147 | ): void { |
| 1148 | // Based on the "merge" principle, if no clipPath provided, |
| 1149 | // do nothing. The exists clip will be totally removed only if |
| 1150 | // `el.clipPath` is `false`. Otherwise it will be merged/replaced. |
| 1151 | const clipPathOpt = elOption.clipPath as CustomPathOption | false; |
| 1152 | if (clipPathOpt === false) { |
| 1153 | if (el && el.getClipPath()) { |
| 1154 | el.removeClipPath(); |
| 1155 | } |
| 1156 | } |
| 1157 | else if (clipPathOpt) { |
| 1158 | let clipPath = el.getClipPath(); |
| 1159 | if (clipPath && doesElNeedRecreate( |
| 1160 | clipPath, |
| 1161 | clipPathOpt, |
| 1162 | seriesModel |
| 1163 | )) { |
| 1164 | clipPath = null; |
| 1165 | } |
| 1166 | if (!clipPath) { |
| 1167 | clipPath = createEl(clipPathOpt) as graphicUtil.Path; |
| 1168 | if (__DEV__) { |
| 1169 | assert( |
| 1170 | isPath(clipPath), |
| 1171 | 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.' |
| 1172 | ); |
| 1173 | } |
| 1174 | el.setClipPath(clipPath); |
| 1175 | } |
| 1176 | updateElNormal( |
| 1177 | null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit |
| 1178 | ); |
| 1179 | } |
| 1180 | // If not define `clipPath` in option, do nothing unnecessary. |
| 1181 | } |
| 1182 | |
| 1183 | function doCreateOrUpdateAttachedTx( |
| 1184 | el: Element, |
no test coverage detected
searching dependent graphs…