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

Function createIcon

_benchmarks/sample_echarts.js:14658–14676  ·  view source on GitHub ↗
(iconStr, // Support 'image://' or 'path://' or direct svg path.
    opt, rect)

Source from the content-addressed store, hash-verified

14656 }
14657 }
14658 function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path.
14659 opt, rect) {
14660 var innerOpts = extend({
14661 rectHover: true
14662 }, opt);
14663 var style = innerOpts.style = {
14664 strokeNoScale: true
14665 };
14666 rect = rect || {
14667 x: -1,
14668 y: -1,
14669 width: 2,
14670 height: 2
14671 };
14672
14673 if (iconStr) {
14674 return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');
14675 }
14676 }
14677 /**
14678 * Return `true` if the given line (line `a`) and the given polygon
14679 * are intersect.

Callers 4

sample_echarts.jsFile · 0.85
createIconPathsFunction · 0.85
makeControlIconFunction · 0.85
createPageButtonFunction · 0.85

Calls 3

makePathFunction · 0.85
extendFunction · 0.70
defaultsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…