pattern-fill.src.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /**
  2. * @license Highcharts JS v8.1.2 (2020-06-16)
  3. *
  4. * Module for adding patterns and images as point fills.
  5. *
  6. * (c) 2010-2019 Highsoft AS
  7. * Author: Torstein Hønsi, Øystein Moseng
  8. *
  9. * License: www.highcharts.com/license
  10. */
  11. 'use strict';
  12. (function (factory) {
  13. if (typeof module === 'object' && module.exports) {
  14. factory['default'] = factory;
  15. module.exports = factory;
  16. } else if (typeof define === 'function' && define.amd) {
  17. define('highcharts/modules/pattern-fill', ['highcharts'], function (Highcharts) {
  18. factory(Highcharts);
  19. factory.Highcharts = Highcharts;
  20. return factory;
  21. });
  22. } else {
  23. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  24. }
  25. }(function (Highcharts) {
  26. var _modules = Highcharts ? Highcharts._modules : {};
  27. function _registerModule(obj, path, args, fn) {
  28. if (!obj.hasOwnProperty(path)) {
  29. obj[path] = fn.apply(null, args);
  30. }
  31. }
  32. _registerModule(_modules, 'modules/pattern-fill.src.js', [_modules['parts/Globals.js'], _modules['parts/Point.js'], _modules['parts/SVGRenderer.js'], _modules['parts/Utilities.js']], function (H, Point, SVGRenderer, U) {
  33. /* *
  34. *
  35. * Module for using patterns or images as point fills.
  36. *
  37. * (c) 2010-2020 Highsoft AS
  38. * Author: Torstein Hønsi, Øystein Moseng
  39. *
  40. * License: www.highcharts.com/license
  41. *
  42. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  43. *
  44. * */
  45. var addEvent = U.addEvent, animObject = U.animObject, erase = U.erase, getOptions = U.getOptions, merge = U.merge, pick = U.pick, removeEvent = U.removeEvent, wrap = U.wrap;
  46. /**
  47. * Pattern options
  48. *
  49. * @interface Highcharts.PatternOptionsObject
  50. */ /**
  51. * Background color for the pattern if a `path` is set (not images).
  52. * @name Highcharts.PatternOptionsObject#backgroundColor
  53. * @type {Highcharts.ColorString}
  54. */ /**
  55. * URL to an image to use as the pattern.
  56. * @name Highcharts.PatternOptionsObject#image
  57. * @type {string}
  58. */ /**
  59. * Width of the pattern. For images this is automatically set to the width of
  60. * the element bounding box if not supplied. For non-image patterns the default
  61. * is 32px. Note that automatic resizing of image patterns to fill a bounding
  62. * box dynamically is only supported for patterns with an automatically
  63. * calculated ID.
  64. * @name Highcharts.PatternOptionsObject#width
  65. * @type {number}
  66. */ /**
  67. * Analogous to pattern.width.
  68. * @name Highcharts.PatternOptionsObject#height
  69. * @type {number}
  70. */ /**
  71. * For automatically calculated width and height on images, it is possible to
  72. * set an aspect ratio. The image will be zoomed to fill the bounding box,
  73. * maintaining the aspect ratio defined.
  74. * @name Highcharts.PatternOptionsObject#aspectRatio
  75. * @type {number}
  76. */ /**
  77. * Horizontal offset of the pattern. Defaults to 0.
  78. * @name Highcharts.PatternOptionsObject#x
  79. * @type {number|undefined}
  80. */ /**
  81. * Vertical offset of the pattern. Defaults to 0.
  82. * @name Highcharts.PatternOptionsObject#y
  83. * @type {number|undefined}
  84. */ /**
  85. * Either an SVG path as string, or an object. As an object, supply the path
  86. * string in the `path.d` property. Other supported properties are standard SVG
  87. * attributes like `path.stroke` and `path.fill`. If a path is supplied for the
  88. * pattern, the `image` property is ignored.
  89. * @name Highcharts.PatternOptionsObject#path
  90. * @type {string|Highcharts.SVGAttributes}
  91. */ /**
  92. * SVG `patternTransform` to apply to the entire pattern.
  93. * @name Highcharts.PatternOptionsObject#patternTransform
  94. * @type {string}
  95. * @see [patternTransform demo](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/series/pattern-fill-transform)
  96. */ /**
  97. * Pattern color, used as default path stroke.
  98. * @name Highcharts.PatternOptionsObject#color
  99. * @type {Highcharts.ColorString}
  100. */ /**
  101. * Opacity of the pattern as a float value from 0 to 1.
  102. * @name Highcharts.PatternOptionsObject#opacity
  103. * @type {number}
  104. */ /**
  105. * ID to assign to the pattern. This is automatically computed if not added, and
  106. * identical patterns are reused. To refer to an existing pattern for a
  107. * Highcharts color, use `color: "url(#pattern-id)"`.
  108. * @name Highcharts.PatternOptionsObject#id
  109. * @type {string|undefined}
  110. */
  111. /**
  112. * Holds a pattern definition.
  113. *
  114. * @sample highcharts/series/pattern-fill-area/
  115. * Define a custom path pattern
  116. * @sample highcharts/series/pattern-fill-pie/
  117. * Default patterns and a custom image pattern
  118. * @sample maps/demo/pattern-fill-map/
  119. * Custom images on map
  120. *
  121. * @example
  122. * // Pattern used as a color option
  123. * color: {
  124. * pattern: {
  125. * path: {
  126. * d: 'M 3 3 L 8 3 L 8 8 Z',
  127. * fill: '#102045'
  128. * },
  129. * width: 12,
  130. * height: 12,
  131. * color: '#907000',
  132. * opacity: 0.5
  133. * }
  134. * }
  135. *
  136. * @interface Highcharts.PatternObject
  137. */ /**
  138. * Pattern options
  139. * @name Highcharts.PatternObject#pattern
  140. * @type {Highcharts.PatternOptionsObject}
  141. */ /**
  142. * Animation options for the image pattern loading.
  143. * @name Highcharts.PatternObject#animation
  144. * @type {boolean|Highcharts.AnimationOptionsObject|undefined}
  145. */ /**
  146. * Optionally an index referencing which pattern to use. Highcharts adds
  147. * 10 default patterns to the `Highcharts.patterns` array. Additional
  148. * pattern definitions can be pushed to this array if desired. This option
  149. * is an index into this array.
  150. * @name Highcharts.PatternObject#patternIndex
  151. * @type {number|undefined}
  152. */
  153. ''; // detach doclets above
  154. // Add the predefined patterns
  155. H.patterns = (function () {
  156. var patterns = [], colors = getOptions().colors;
  157. [
  158. 'M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11',
  159. 'M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9',
  160. 'M 3 0 L 3 10 M 8 0 L 8 10',
  161. 'M 0 3 L 10 3 M 0 8 L 10 8',
  162. 'M 0 3 L 5 3 L 5 0 M 5 10 L 5 7 L 10 7',
  163. 'M 3 3 L 8 3 L 8 8 L 3 8 Z',
  164. 'M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0',
  165. 'M 10 3 L 5 3 L 5 0 M 5 10 L 5 7 L 0 7',
  166. 'M 2 5 L 5 2 L 8 5 L 5 8 Z',
  167. 'M 0 0 L 5 10 L 10 0'
  168. ].forEach(function (pattern, i) {
  169. patterns.push({
  170. path: pattern,
  171. color: colors[i],
  172. width: 10,
  173. height: 10
  174. });
  175. });
  176. return patterns;
  177. })();
  178. /**
  179. * Utility function to compute a hash value from an object. Modified Java
  180. * String.hashCode implementation in JS. Use the preSeed parameter to add an
  181. * additional seeding step.
  182. *
  183. * @private
  184. * @function hashFromObject
  185. *
  186. * @param {object} obj
  187. * The javascript object to compute the hash from.
  188. *
  189. * @param {boolean} [preSeed=false]
  190. * Add an optional preSeed stage.
  191. *
  192. * @return {string}
  193. * The computed hash.
  194. */
  195. function hashFromObject(obj, preSeed) {
  196. var str = JSON.stringify(obj), strLen = str.length || 0, hash = 0, i = 0, char, seedStep;
  197. if (preSeed) {
  198. seedStep = Math.max(Math.floor(strLen / 500), 1);
  199. for (var a = 0; a < strLen; a += seedStep) {
  200. hash += str.charCodeAt(a);
  201. }
  202. hash = hash & hash;
  203. }
  204. for (; i < strLen; ++i) {
  205. char = str.charCodeAt(i);
  206. hash = ((hash << 5) - hash) + char;
  207. hash = hash & hash;
  208. }
  209. return hash.toString(16).replace('-', '1');
  210. }
  211. /**
  212. * Set dimensions on pattern from point. This function will set internal
  213. * pattern._width/_height properties if width and height are not both already
  214. * set. We only do this on image patterns. The _width/_height properties are set
  215. * to the size of the bounding box of the point, optionally taking aspect ratio
  216. * into account. If only one of width or height are supplied as options, the
  217. * undefined option is calculated as above.
  218. *
  219. * @private
  220. * @function Highcharts.Point#calculatePatternDimensions
  221. *
  222. * @param {Highcharts.PatternOptionsObject} pattern
  223. * The pattern to set dimensions on.
  224. *
  225. * @return {void}
  226. *
  227. * @requires modules/pattern-fill
  228. */
  229. Point.prototype.calculatePatternDimensions = function (pattern) {
  230. if (pattern.width && pattern.height) {
  231. return;
  232. }
  233. var bBox = this.graphic && (this.graphic.getBBox &&
  234. this.graphic.getBBox(true) ||
  235. this.graphic.element &&
  236. this.graphic.element.getBBox()) || {}, shapeArgs = this.shapeArgs;
  237. // Prefer using shapeArgs, as it is animation agnostic
  238. if (shapeArgs) {
  239. bBox.width = shapeArgs.width || bBox.width;
  240. bBox.height = shapeArgs.height || bBox.height;
  241. bBox.x = shapeArgs.x || bBox.x;
  242. bBox.y = shapeArgs.y || bBox.y;
  243. }
  244. // For images we stretch to bounding box
  245. if (pattern.image) {
  246. // If we do not have a bounding box at this point, simply add a defer
  247. // key and pick this up in the fillSetter handler, where the bounding
  248. // box should exist.
  249. if (!bBox.width || !bBox.height) {
  250. pattern._width = 'defer';
  251. pattern._height = 'defer';
  252. return;
  253. }
  254. // Handle aspect ratio filling
  255. if (pattern.aspectRatio) {
  256. bBox.aspectRatio = bBox.width / bBox.height;
  257. if (pattern.aspectRatio > bBox.aspectRatio) {
  258. // Height of bBox will determine width
  259. bBox.aspectWidth = bBox.height * pattern.aspectRatio;
  260. }
  261. else {
  262. // Width of bBox will determine height
  263. bBox.aspectHeight = bBox.width / pattern.aspectRatio;
  264. }
  265. }
  266. // We set the width/height on internal properties to differentiate
  267. // between the options set by a user and by this function.
  268. pattern._width = pattern.width ||
  269. Math.ceil(bBox.aspectWidth || bBox.width);
  270. pattern._height = pattern.height ||
  271. Math.ceil(bBox.aspectHeight || bBox.height);
  272. }
  273. // Set x/y accordingly, centering if using aspect ratio, otherwise adjusting
  274. // so bounding box corner is 0,0 of pattern.
  275. if (!pattern.width) {
  276. pattern._x = pattern.x || 0;
  277. pattern._x += bBox.x - Math.round(bBox.aspectWidth ?
  278. Math.abs(bBox.aspectWidth - bBox.width) / 2 :
  279. 0);
  280. }
  281. if (!pattern.height) {
  282. pattern._y = pattern.y || 0;
  283. pattern._y += bBox.y - Math.round(bBox.aspectHeight ?
  284. Math.abs(bBox.aspectHeight - bBox.height) / 2 :
  285. 0);
  286. }
  287. };
  288. /* eslint-disable no-invalid-this */
  289. /**
  290. * Add a pattern to the renderer.
  291. *
  292. * @private
  293. * @function Highcharts.SVGRenderer#addPattern
  294. *
  295. * @param {Highcharts.PatternObject} options
  296. * The pattern options.
  297. *
  298. * @param {boolean|Highcharts.AnimationOptionsObject} [animation]
  299. * The animation options.
  300. *
  301. * @return {Highcharts.SVGElement|undefined}
  302. * The added pattern. Undefined if the pattern already exists.
  303. *
  304. * @requires modules/pattern-fill
  305. */
  306. SVGRenderer.prototype.addPattern = function (options, animation) {
  307. var pattern, animate = pick(animation, true), animationOptions = animObject(animate), path, defaultSize = 32, width = options.width || options._width || defaultSize, height = (options.height || options._height || defaultSize), color = options.color || '#343434', id = options.id, ren = this, rect = function (fill) {
  308. ren.rect(0, 0, width, height)
  309. .attr({ fill: fill })
  310. .add(pattern);
  311. }, attribs;
  312. if (!id) {
  313. this.idCounter = this.idCounter || 0;
  314. id = 'highcharts-pattern-' + this.idCounter + '-' + (this.chartIndex || 0);
  315. ++this.idCounter;
  316. }
  317. if (this.forExport) {
  318. id += '-export';
  319. }
  320. // Do nothing if ID already exists
  321. this.defIds = this.defIds || [];
  322. if (this.defIds.indexOf(id) > -1) {
  323. return;
  324. }
  325. // Store ID in list to avoid duplicates
  326. this.defIds.push(id);
  327. // Calculate pattern element attributes
  328. var attrs = {
  329. id: id,
  330. patternUnits: 'userSpaceOnUse',
  331. patternContentUnits: options.patternContentUnits || 'userSpaceOnUse',
  332. width: width,
  333. height: height,
  334. x: options._x || options.x || 0,
  335. y: options._y || options.y || 0
  336. };
  337. if (options.patternTransform) {
  338. attrs.patternTransform = options.patternTransform;
  339. }
  340. pattern = this.createElement('pattern').attr(attrs).add(this.defs);
  341. // Set id on the SVGRenderer object
  342. pattern.id = id;
  343. // Use an SVG path for the pattern
  344. if (options.path) {
  345. path = options.path;
  346. // The background
  347. if (options.backgroundColor) {
  348. rect(options.backgroundColor);
  349. }
  350. // The pattern
  351. attribs = {
  352. 'd': path.d || path
  353. };
  354. if (!this.styledMode) {
  355. attribs.stroke = path.stroke || color;
  356. attribs['stroke-width'] = pick(path.strokeWidth, 2);
  357. attribs.fill = path.fill || 'none';
  358. }
  359. if (path.transform) {
  360. attribs.transform = path.transform;
  361. }
  362. this.createElement('path').attr(attribs).add(pattern);
  363. pattern.color = color;
  364. // Image pattern
  365. }
  366. else if (options.image) {
  367. if (animate) {
  368. this.image(options.image, 0, 0, width, height, function () {
  369. // Onload
  370. this.animate({
  371. opacity: pick(options.opacity, 1)
  372. }, animationOptions);
  373. removeEvent(this.element, 'load');
  374. }).attr({ opacity: 0 }).add(pattern);
  375. }
  376. else {
  377. this.image(options.image, 0, 0, width, height).add(pattern);
  378. }
  379. }
  380. // For non-animated patterns, set opacity now
  381. if (!(options.image && animate) && typeof options.opacity !== 'undefined') {
  382. [].forEach.call(pattern.element.childNodes, function (child) {
  383. child.setAttribute('opacity', options.opacity);
  384. });
  385. }
  386. // Store for future reference
  387. this.patternElements = this.patternElements || {};
  388. this.patternElements[id] = pattern;
  389. return pattern;
  390. };
  391. // Make sure we have a series color
  392. wrap(H.Series.prototype, 'getColor', function (proceed) {
  393. var oldColor = this.options.color;
  394. // Temporarely remove color options to get defaults
  395. if (oldColor &&
  396. oldColor.pattern &&
  397. !oldColor.pattern.color) {
  398. delete this.options.color;
  399. // Get default
  400. proceed.apply(this, Array.prototype.slice.call(arguments, 1));
  401. // Replace with old, but add default color
  402. oldColor.pattern.color =
  403. this.color;
  404. this.color = this.options.color = oldColor;
  405. }
  406. else {
  407. // We have a color, no need to do anything special
  408. proceed.apply(this, Array.prototype.slice.call(arguments, 1));
  409. }
  410. });
  411. // Calculate pattern dimensions on points that have their own pattern.
  412. addEvent(H.Series, 'render', function () {
  413. var isResizing = this.chart.isResizing;
  414. if (this.isDirtyData || isResizing || !this.chart.hasRendered) {
  415. (this.points || []).forEach(function (point) {
  416. var colorOptions = point.options && point.options.color;
  417. if (colorOptions &&
  418. colorOptions.pattern) {
  419. // For most points we want to recalculate the dimensions on
  420. // render, where we have the shape args and bbox. But if we
  421. // are resizing and don't have the shape args, defer it, since
  422. // the bounding box is still not resized.
  423. if (isResizing &&
  424. !(point.shapeArgs &&
  425. point.shapeArgs.width &&
  426. point.shapeArgs.height)) {
  427. colorOptions.pattern._width =
  428. 'defer';
  429. colorOptions.pattern._height =
  430. 'defer';
  431. }
  432. else {
  433. point.calculatePatternDimensions(colorOptions.pattern);
  434. }
  435. }
  436. });
  437. }
  438. });
  439. // Merge series color options to points
  440. addEvent(Point, 'afterInit', function () {
  441. var point = this, colorOptions = point.options.color;
  442. // Only do this if we have defined a specific color on this point. Otherwise
  443. // we will end up trying to re-add the series color for each point.
  444. if (colorOptions && colorOptions.pattern) {
  445. // Move path definition to object, allows for merge with series path
  446. // definition
  447. if (typeof colorOptions.pattern.path === 'string') {
  448. colorOptions.pattern.path = {
  449. d: colorOptions.pattern.path
  450. };
  451. }
  452. // Merge with series options
  453. point.color = point.options.color = merge(point.series.options.color, colorOptions);
  454. }
  455. });
  456. // Add functionality to SVG renderer to handle patterns as complex colors
  457. addEvent(SVGRenderer, 'complexColor', function (args) {
  458. var color = args.args[0], prop = args.args[1], element = args.args[2], chartIndex = (this.chartIndex || 0);
  459. var pattern = color.pattern, value = '#343434';
  460. // Handle patternIndex
  461. if (typeof color.patternIndex !== 'undefined' && H.patterns) {
  462. pattern = H.patterns[color.patternIndex];
  463. }
  464. // Skip and call default if there is no pattern
  465. if (!pattern) {
  466. return true;
  467. }
  468. // We have a pattern.
  469. if (pattern.image ||
  470. typeof pattern.path === 'string' ||
  471. pattern.path && pattern.path.d) {
  472. // Real pattern. Add it and set the color value to be a reference.
  473. // Force Hash-based IDs for legend items, as they are drawn before
  474. // point render, meaning they are drawn before autocalculated image
  475. // width/heights. We don't want them to highjack the width/height for
  476. // this ID if it is defined by users.
  477. var forceHashId = element.parentNode &&
  478. element.parentNode.getAttribute('class');
  479. forceHashId = forceHashId &&
  480. forceHashId.indexOf('highcharts-legend') > -1;
  481. // If we don't have a width/height yet, handle it. Try faking a point
  482. // and running the algorithm again.
  483. if (pattern._width === 'defer' || pattern._height === 'defer') {
  484. Point.prototype.calculatePatternDimensions.call({ graphic: { element: element } }, pattern);
  485. }
  486. // If we don't have an explicit ID, compute a hash from the
  487. // definition and use that as the ID. This ensures that points with
  488. // the same pattern definition reuse existing pattern elements by
  489. // default. We combine two hashes, the second with an additional
  490. // preSeed algorithm, to minimize collision probability.
  491. if (forceHashId || !pattern.id) {
  492. // Make a copy so we don't accidentally edit options when setting ID
  493. pattern = merge({}, pattern);
  494. pattern.id = 'highcharts-pattern-' + chartIndex + '-' +
  495. hashFromObject(pattern) + hashFromObject(pattern, true);
  496. }
  497. // Add it. This function does nothing if an element with this ID
  498. // already exists.
  499. this.addPattern(pattern, !this.forExport && pick(pattern.animation, this.globalAnimation, { duration: 100 }));
  500. value = "url(" + this.url + "#" + (pattern.id + (this.forExport ? '-export' : '')) + ")";
  501. }
  502. else {
  503. // Not a full pattern definition, just add color
  504. value = pattern.color || value;
  505. }
  506. // Set the fill/stroke prop on the element
  507. element.setAttribute(prop, value);
  508. // Allow the color to be concatenated into tooltips formatters etc.
  509. color.toString = function () {
  510. return value;
  511. };
  512. // Skip default handler
  513. return false;
  514. });
  515. // When animation is used, we have to recalculate pattern dimensions after
  516. // resize, as the bounding boxes are not available until then.
  517. addEvent(H.Chart, 'endResize', function () {
  518. if ((this.renderer && this.renderer.defIds || []).filter(function (id) {
  519. return (id &&
  520. id.indexOf &&
  521. id.indexOf('highcharts-pattern-') === 0);
  522. }).length) {
  523. // We have non-default patterns to fix. Find them by looping through
  524. // all points.
  525. this.series.forEach(function (series) {
  526. series.points.forEach(function (point) {
  527. var colorOptions = point.options && point.options.color;
  528. if (colorOptions &&
  529. colorOptions.pattern) {
  530. colorOptions.pattern._width =
  531. 'defer';
  532. colorOptions.pattern._height =
  533. 'defer';
  534. }
  535. });
  536. });
  537. // Redraw without animation
  538. this.redraw(false);
  539. }
  540. });
  541. // Add a garbage collector to delete old patterns with autogenerated hashes that
  542. // are no longer being referenced.
  543. addEvent(H.Chart, 'redraw', function () {
  544. var usedIds = {}, renderer = this.renderer,
  545. // Get the autocomputed patterns - these are the ones we might delete
  546. patterns = (renderer.defIds || []).filter(function (pattern) {
  547. return (pattern.indexOf &&
  548. pattern.indexOf('highcharts-pattern-') === 0);
  549. });
  550. if (patterns.length) {
  551. // Look through the DOM for usage of the patterns. This can be points,
  552. // series, tooltips etc.
  553. [].forEach.call(this.renderTo.querySelectorAll('[color^="url("], [fill^="url("], [stroke^="url("]'), function (node) {
  554. var id = node.getAttribute('fill') ||
  555. node.getAttribute('color') ||
  556. node.getAttribute('stroke');
  557. if (id) {
  558. var sanitizedId = id.replace(renderer.url, '').replace('url(#', '').replace(')', '');
  559. usedIds[sanitizedId] = true;
  560. }
  561. });
  562. // Loop through the patterns that exist and see if they are used
  563. patterns.forEach(function (id) {
  564. if (!usedIds[id]) {
  565. // Remove id from used id list
  566. erase(renderer.defIds, id);
  567. // Remove pattern element
  568. if (renderer.patternElements[id]) {
  569. renderer.patternElements[id].destroy();
  570. delete renderer.patternElements[id];
  571. }
  572. }
  573. });
  574. }
  575. });
  576. });
  577. _registerModule(_modules, 'masters/modules/pattern-fill.src.js', [], function () {
  578. });
  579. }));