pattern-fill.src.js 27 KB

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