MCPcopy
hub / github.com/tdewolff/minify / doCreateOrUpdateClipPath

Function doCreateOrUpdateClipPath

_benchmarks/sample_echarts.js:71712–71742  ·  view source on GitHub ↗
(el, dataIndex, elOption, seriesModel, isInit)

Source from the content-addressed store, hash-verified

71710 }
71711
71712 function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {
71713 // Based on the "merge" principle, if no clipPath provided,
71714 // do nothing. The exists clip will be totally removed only if
71715 // `el.clipPath` is `false`. Otherwise it will be merged/replaced.
71716 var clipPathOpt = elOption.clipPath;
71717
71718 if (clipPathOpt === false) {
71719 if (el && el.getClipPath()) {
71720 el.removeClipPath();
71721 }
71722 } else if (clipPathOpt) {
71723 var clipPath = el.getClipPath();
71724
71725 if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {
71726 clipPath = null;
71727 }
71728
71729 if (!clipPath) {
71730 clipPath = createEl(clipPathOpt);
71731
71732 if ("development" !== 'production') {
71733 assert(clipPath instanceof Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');
71734 }
71735
71736 el.setClipPath(clipPath);
71737 }
71738
71739 updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);
71740 } // If not define `clipPath` in option, do nothing unnecessary.
71741
71742 }
71743
71744 function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {
71745 // group do not support textContent temporarily untill necessary.

Callers 1

doCreateOrUpdateElFunction · 0.85

Calls 4

doesElNeedRecreateFunction · 0.85
createElFunction · 0.85
updateElNormalFunction · 0.85
assertFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…