wordcloud.src.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281
  1. /**
  2. * @license Highcharts JS v8.0.0 (2019-12-10)
  3. *
  4. * (c) 2016-2019 Highsoft AS
  5. * Authors: Jon Arild Nygard
  6. *
  7. * License: www.highcharts.com/license
  8. */
  9. 'use strict';
  10. (function (factory) {
  11. if (typeof module === 'object' && module.exports) {
  12. factory['default'] = factory;
  13. module.exports = factory;
  14. } else if (typeof define === 'function' && define.amd) {
  15. define('highcharts/modules/wordcloud', ['highcharts'], function (Highcharts) {
  16. factory(Highcharts);
  17. factory.Highcharts = Highcharts;
  18. return factory;
  19. });
  20. } else {
  21. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  22. }
  23. }(function (Highcharts) {
  24. var _modules = Highcharts ? Highcharts._modules : {};
  25. function _registerModule(obj, path, args, fn) {
  26. if (!obj.hasOwnProperty(path)) {
  27. obj[path] = fn.apply(null, args);
  28. }
  29. }
  30. _registerModule(_modules, 'mixins/draw-point.js', [], function () {
  31. /* *
  32. *
  33. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  34. *
  35. * */
  36. var isFn = function (x) {
  37. return typeof x === 'function';
  38. };
  39. /* eslint-disable no-invalid-this, valid-jsdoc */
  40. /**
  41. * Handles the drawing of a component.
  42. * Can be used for any type of component that reserves the graphic property, and
  43. * provides a shouldDraw on its context.
  44. *
  45. * @private
  46. * @function draw
  47. * @param {DrawPointParams} params
  48. * Parameters.
  49. *
  50. * @todo add type checking.
  51. * @todo export this function to enable usage
  52. */
  53. var draw = function draw(params) {
  54. var component = this, graphic = component.graphic, animatableAttribs = params.animatableAttribs, onComplete = params.onComplete, css = params.css, renderer = params.renderer;
  55. if (component.shouldDraw()) {
  56. if (!graphic) {
  57. component.graphic = graphic =
  58. renderer[params.shapeType](params.shapeArgs)
  59. .add(params.group);
  60. }
  61. graphic
  62. .css(css)
  63. .attr(params.attribs)
  64. .animate(animatableAttribs, params.isNew ? false : void 0, onComplete);
  65. }
  66. else if (graphic) {
  67. var destroy = function () {
  68. component.graphic = graphic = graphic.destroy();
  69. if (isFn(onComplete)) {
  70. onComplete();
  71. }
  72. };
  73. // animate only runs complete callback if something was animated.
  74. if (Object.keys(animatableAttribs).length) {
  75. graphic.animate(animatableAttribs, void 0, function () {
  76. destroy();
  77. });
  78. }
  79. else {
  80. destroy();
  81. }
  82. }
  83. };
  84. /**
  85. * An extended version of draw customized for points.
  86. * It calls additional methods that is expected when rendering a point.
  87. * @private
  88. * @param {Highcharts.Dictionary<any>} params Parameters
  89. */
  90. var drawPoint = function drawPoint(params) {
  91. var point = this, attribs = params.attribs = params.attribs || {};
  92. // Assigning class in dot notation does go well in IE8
  93. // eslint-disable-next-line dot-notation
  94. attribs['class'] = point.getClassName();
  95. // Call draw to render component
  96. draw.call(point, params);
  97. };
  98. return drawPoint;
  99. });
  100. _registerModule(_modules, 'mixins/polygon.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) {
  101. /* *
  102. *
  103. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  104. *
  105. * */
  106. /**
  107. * @private
  108. * @interface Highcharts.PolygonPointObject
  109. */ /**
  110. * @name Highcharts.PolygonPointObject#0
  111. * @type {number}
  112. */ /**
  113. * @name Highcharts.PolygonPointObject#1
  114. * @type {number}
  115. */
  116. /**
  117. * @private
  118. * @interface Highcharts.PolygonObject
  119. * @extends Array<Highcharts.PolygonPointObject>
  120. */ /**
  121. * @name Highcharts.PolygonObject#axes
  122. * @type {Array<PolygonPointObject>}
  123. */
  124. var isArray = U.isArray, isNumber = U.isNumber;
  125. var deg2rad = H.deg2rad, find = H.find;
  126. /* eslint-disable no-invalid-this, valid-jsdoc */
  127. /**
  128. * Alternative solution to correctFloat.
  129. * E.g Highcharts.correctFloat(123, 2) returns 120, when it should be 123.
  130. *
  131. * @private
  132. * @function correctFloat
  133. * @param {number} number
  134. * @param {number} [precision]
  135. * @return {number}
  136. */
  137. var correctFloat = function (number, precision) {
  138. var p = isNumber(precision) ? precision : 14, magnitude = Math.pow(10, p);
  139. return Math.round(number * magnitude) / magnitude;
  140. };
  141. /**
  142. * Calculates the normals to a line between two points.
  143. *
  144. * @private
  145. * @function getNormals
  146. * @param {Highcharts.PolygonPointObject} p1
  147. * Start point for the line. Array of x and y value.
  148. * @param {Highcharts.PolygonPointObject} p2
  149. * End point for the line. Array of x and y value.
  150. * @return {Highcharts.PolygonObject}
  151. * Returns the two normals in an array.
  152. */
  153. var getNormals = function getNormal(p1, p2) {
  154. var dx = p2[0] - p1[0], // x2 - x1
  155. dy = p2[1] - p1[1]; // y2 - y1
  156. return [
  157. [-dy, dx],
  158. [dy, -dx]
  159. ];
  160. };
  161. /**
  162. * Calculates the dot product of two coordinates. The result is a scalar value.
  163. *
  164. * @private
  165. * @function dotProduct
  166. * @param {Highcharts.PolygonPointObject} a
  167. * The x and y coordinates of the first point.
  168. *
  169. * @param {Highcharts.PolygonPointObject} b
  170. * The x and y coordinates of the second point.
  171. *
  172. * @return {number}
  173. * Returns the dot product of a and b.
  174. */
  175. var dotProduct = function dotProduct(a, b) {
  176. var ax = a[0], ay = a[1], bx = b[0], by = b[1];
  177. return ax * bx + ay * by;
  178. };
  179. /**
  180. * Projects a polygon onto a coordinate.
  181. *
  182. * @private
  183. * @function project
  184. * @param {Highcharts.PolygonObject} polygon
  185. * Array of points in a polygon.
  186. * @param {Highcharts.PolygonPointObject} target
  187. * The coordinate of pr
  188. * @return {Highcharts.RangeObject}
  189. */
  190. var project = function project(polygon, target) {
  191. var products = polygon.map(function (point) {
  192. return dotProduct(point, target);
  193. });
  194. return {
  195. min: Math.min.apply(this, products),
  196. max: Math.max.apply(this, products)
  197. };
  198. };
  199. /**
  200. * Rotates a point clockwise around the origin.
  201. *
  202. * @private
  203. * @function rotate2DToOrigin
  204. * @param {Highcharts.PolygonPointObject} point
  205. * The x and y coordinates for the point.
  206. * @param {number} angle
  207. * The angle of rotation.
  208. * @return {Highcharts.PolygonPointObject}
  209. * The x and y coordinate for the rotated point.
  210. */
  211. var rotate2DToOrigin = function (point, angle) {
  212. var x = point[0], y = point[1], rad = deg2rad * -angle, cosAngle = Math.cos(rad), sinAngle = Math.sin(rad);
  213. return [
  214. correctFloat(x * cosAngle - y * sinAngle),
  215. correctFloat(x * sinAngle + y * cosAngle)
  216. ];
  217. };
  218. /**
  219. * Rotate a point clockwise around another point.
  220. *
  221. * @private
  222. * @function rotate2DToPoint
  223. * @param {Highcharts.PolygonPointObject} point
  224. * The x and y coordinates for the point.
  225. * @param {Highcharts.PolygonPointObject} origin
  226. * The point to rotate around.
  227. * @param {number} angle
  228. * The angle of rotation.
  229. * @return {Highcharts.PolygonPointObject}
  230. * The x and y coordinate for the rotated point.
  231. */
  232. var rotate2DToPoint = function (point, origin, angle) {
  233. var x = point[0] - origin[0], y = point[1] - origin[1], rotated = rotate2DToOrigin([x, y], angle);
  234. return [
  235. rotated[0] + origin[0],
  236. rotated[1] + origin[1]
  237. ];
  238. };
  239. /**
  240. * @private
  241. */
  242. var isAxesEqual = function (axis1, axis2) {
  243. return (axis1[0] === axis2[0] &&
  244. axis1[1] === axis2[1]);
  245. };
  246. /**
  247. * @private
  248. */
  249. var getAxesFromPolygon = function (polygon) {
  250. var points, axes = polygon.axes;
  251. if (!isArray(axes)) {
  252. axes = [];
  253. points = points = polygon.concat([polygon[0]]);
  254. points.reduce(function findAxis(p1, p2) {
  255. var normals = getNormals(p1, p2), axis = normals[0]; // Use the left normal as axis.
  256. // Check that the axis is unique.
  257. if (!find(axes, function (existing) {
  258. return isAxesEqual(existing, axis);
  259. })) {
  260. axes.push(axis);
  261. }
  262. // Return p2 to be used as p1 in next iteration.
  263. return p2;
  264. });
  265. polygon.axes = axes;
  266. }
  267. return axes;
  268. };
  269. /**
  270. * @private
  271. */
  272. var getAxes = function (polygon1, polygon2) {
  273. // Get the axis from both polygons.
  274. var axes1 = getAxesFromPolygon(polygon1), axes2 = getAxesFromPolygon(polygon2);
  275. return axes1.concat(axes2);
  276. };
  277. /**
  278. * @private
  279. */
  280. var getPolygon = function (x, y, width, height, rotation) {
  281. var origin = [x, y], left = x - (width / 2), right = x + (width / 2), top = y - (height / 2), bottom = y + (height / 2), polygon = [
  282. [left, top],
  283. [right, top],
  284. [right, bottom],
  285. [left, bottom]
  286. ];
  287. return polygon.map(function (point) {
  288. return rotate2DToPoint(point, origin, -rotation);
  289. });
  290. };
  291. /**
  292. * @private
  293. */
  294. var getBoundingBoxFromPolygon = function (points) {
  295. return points.reduce(function (obj, point) {
  296. var x = point[0], y = point[1];
  297. obj.left = Math.min(x, obj.left);
  298. obj.right = Math.max(x, obj.right);
  299. obj.bottom = Math.max(y, obj.bottom);
  300. obj.top = Math.min(y, obj.top);
  301. return obj;
  302. }, {
  303. left: Number.MAX_VALUE,
  304. right: -Number.MAX_VALUE,
  305. bottom: -Number.MAX_VALUE,
  306. top: Number.MAX_VALUE
  307. });
  308. };
  309. /**
  310. * @private
  311. */
  312. var isPolygonsOverlappingOnAxis = function (axis, polygon1, polygon2) {
  313. var projection1 = project(polygon1, axis), projection2 = project(polygon2, axis), isOverlapping = !(projection2.min > projection1.max ||
  314. projection2.max < projection1.min);
  315. return !isOverlapping;
  316. };
  317. /**
  318. * Checks wether two convex polygons are colliding by using the Separating Axis
  319. * Theorem.
  320. *
  321. * @private
  322. * @function isPolygonsColliding
  323. * @param {Highcharts.PolygonObject} polygon1
  324. * First polygon.
  325. *
  326. * @param {Highcharts.PolygonObject} polygon2
  327. * Second polygon.
  328. *
  329. * @return {boolean}
  330. * Returns true if they are colliding, otherwise false.
  331. */
  332. var isPolygonsColliding = function isPolygonsColliding(polygon1, polygon2) {
  333. var axes = getAxes(polygon1, polygon2), overlappingOnAllAxes = !find(axes, function (axis) {
  334. return isPolygonsOverlappingOnAxis(axis, polygon1, polygon2);
  335. });
  336. return overlappingOnAllAxes;
  337. };
  338. /**
  339. * @private
  340. */
  341. var movePolygon = function (deltaX, deltaY, polygon) {
  342. return polygon.map(function (point) {
  343. return [
  344. point[0] + deltaX,
  345. point[1] + deltaY
  346. ];
  347. });
  348. };
  349. var collision = {
  350. getBoundingBoxFromPolygon: getBoundingBoxFromPolygon,
  351. getPolygon: getPolygon,
  352. isPolygonsColliding: isPolygonsColliding,
  353. movePolygon: movePolygon,
  354. rotate2DToOrigin: rotate2DToOrigin,
  355. rotate2DToPoint: rotate2DToPoint
  356. };
  357. return collision;
  358. });
  359. _registerModule(_modules, 'modules/wordcloud.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js'], _modules['mixins/draw-point.js'], _modules['mixins/polygon.js']], function (H, U, drawPoint, polygon) {
  360. /* *
  361. *
  362. * Experimental Highcharts module which enables visualization of a word cloud.
  363. *
  364. * (c) 2016-2019 Highsoft AS
  365. * Authors: Jon Arild Nygard
  366. *
  367. * License: www.highcharts.com/license
  368. *
  369. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  370. * */
  371. var extend = U.extend, isArray = U.isArray, isNumber = U.isNumber, isObject = U.isObject;
  372. var merge = H.merge, noop = H.noop, find = H.find, getBoundingBoxFromPolygon = polygon.getBoundingBoxFromPolygon, getPolygon = polygon.getPolygon, isPolygonsColliding = polygon.isPolygonsColliding, movePolygon = polygon.movePolygon, Series = H.Series;
  373. /**
  374. * Detects if there is a collision between two rectangles.
  375. *
  376. * @private
  377. * @function isRectanglesIntersecting
  378. *
  379. * @param {Highcharts.PolygonBoxObject} r1
  380. * First rectangle.
  381. *
  382. * @param {Highcharts.PolygonBoxObject} r2
  383. * Second rectangle.
  384. *
  385. * @return {boolean}
  386. * Returns true if the rectangles overlap.
  387. */
  388. function isRectanglesIntersecting(r1, r2) {
  389. return !(r2.left > r1.right ||
  390. r2.right < r1.left ||
  391. r2.top > r1.bottom ||
  392. r2.bottom < r1.top);
  393. }
  394. /**
  395. * Detects if a word collides with any previously placed words.
  396. *
  397. * @private
  398. * @function intersectsAnyWord
  399. *
  400. * @param {Highcharts.Point} point
  401. * Point which the word is connected to.
  402. *
  403. * @param {Array<Highcharts.Point>} points
  404. * Previously placed points to check against.
  405. *
  406. * @return {boolean}
  407. * Returns true if there is collision.
  408. */
  409. function intersectsAnyWord(point, points) {
  410. var intersects = false, rect = point.rect, polygon = point.polygon, lastCollidedWith = point.lastCollidedWith, isIntersecting = function (p) {
  411. var result = isRectanglesIntersecting(rect, p.rect);
  412. if (result &&
  413. (point.rotation % 90 || p.rotation % 90)) {
  414. result = isPolygonsColliding(polygon, p.polygon);
  415. }
  416. return result;
  417. };
  418. // If the point has already intersected a different point, chances are they
  419. // are still intersecting. So as an enhancement we check this first.
  420. if (lastCollidedWith) {
  421. intersects = isIntersecting(lastCollidedWith);
  422. // If they no longer intersects, remove the cache from the point.
  423. if (!intersects) {
  424. delete point.lastCollidedWith;
  425. }
  426. }
  427. // If not already found, then check if we can find a point that is
  428. // intersecting.
  429. if (!intersects) {
  430. intersects = !!find(points, function (p) {
  431. var result = isIntersecting(p);
  432. if (result) {
  433. point.lastCollidedWith = p;
  434. }
  435. return result;
  436. });
  437. }
  438. return intersects;
  439. }
  440. /**
  441. * Gives a set of cordinates for an Archimedian Spiral.
  442. *
  443. * @private
  444. * @function archimedeanSpiral
  445. *
  446. * @param {number} attempt
  447. * How far along the spiral we have traversed.
  448. *
  449. * @param {Highcharts.WordcloudSpiralParamsObject} [params]
  450. * Additional parameters.
  451. *
  452. * @return {boolean|Highcharts.PositionObject}
  453. * Resulting coordinates, x and y. False if the word should be dropped from the
  454. * visualization.
  455. */
  456. function archimedeanSpiral(attempt, params) {
  457. var field = params.field, result = false, maxDelta = (field.width * field.width) + (field.height * field.height), t = attempt * 0.8; // 0.2 * 4 = 0.8. Enlarging the spiral.
  458. // Emergency brake. TODO make spiralling logic more foolproof.
  459. if (attempt <= 10000) {
  460. result = {
  461. x: t * Math.cos(t),
  462. y: t * Math.sin(t)
  463. };
  464. if (!(Math.min(Math.abs(result.x), Math.abs(result.y)) < maxDelta)) {
  465. result = false;
  466. }
  467. }
  468. return result;
  469. }
  470. /**
  471. * Gives a set of cordinates for an rectangular spiral.
  472. *
  473. * @private
  474. * @function squareSpiral
  475. *
  476. * @param {number} attempt
  477. * How far along the spiral we have traversed.
  478. *
  479. * @param {Highcharts.WordcloudSpiralParamsObject} [params]
  480. * Additional parameters.
  481. *
  482. * @return {boolean|Highcharts.PositionObject}
  483. * Resulting coordinates, x and y. False if the word should be dropped from the
  484. * visualization.
  485. */
  486. function squareSpiral(attempt, params) {
  487. var a = attempt * 4, k = Math.ceil((Math.sqrt(a) - 1) / 2), t = 2 * k + 1, m = Math.pow(t, 2), isBoolean = function (x) {
  488. return typeof x === 'boolean';
  489. }, result = false;
  490. t -= 1;
  491. if (attempt <= 10000) {
  492. if (isBoolean(result) && a >= m - t) {
  493. result = {
  494. x: k - (m - a),
  495. y: -k
  496. };
  497. }
  498. m -= t;
  499. if (isBoolean(result) && a >= m - t) {
  500. result = {
  501. x: -k,
  502. y: -k + (m - a)
  503. };
  504. }
  505. m -= t;
  506. if (isBoolean(result)) {
  507. if (a >= m - t) {
  508. result = {
  509. x: -k + (m - a),
  510. y: k
  511. };
  512. }
  513. else {
  514. result = {
  515. x: k,
  516. y: k - (m - a - t)
  517. };
  518. }
  519. }
  520. result.x *= 5;
  521. result.y *= 5;
  522. }
  523. return result;
  524. }
  525. /**
  526. * Gives a set of cordinates for an rectangular spiral.
  527. *
  528. * @private
  529. * @function rectangularSpiral
  530. *
  531. * @param {number} attempt
  532. * How far along the spiral we have traversed.
  533. *
  534. * @param {Highcharts.WordcloudSpiralParamsObject} [params]
  535. * Additional parameters.
  536. *
  537. * @return {boolean|Higcharts.PositionObject}
  538. * Resulting coordinates, x and y. False if the word should be dropped from the
  539. * visualization.
  540. */
  541. function rectangularSpiral(attempt, params) {
  542. var result = squareSpiral(attempt, params), field = params.field;
  543. if (result) {
  544. result.x *= field.ratioX;
  545. result.y *= field.ratioY;
  546. }
  547. return result;
  548. }
  549. /**
  550. * @private
  551. * @function getRandomPosition
  552. *
  553. * @param {number} size
  554. * Random factor.
  555. *
  556. * @return {number}
  557. * Random position.
  558. */
  559. function getRandomPosition(size) {
  560. return Math.round((size * (Math.random() + 0.5)) / 2);
  561. }
  562. /**
  563. * Calculates the proper scale to fit the cloud inside the plotting area.
  564. *
  565. * @private
  566. * @function getScale
  567. *
  568. * @param {number} targetWidth
  569. * Width of target area.
  570. *
  571. * @param {number} targetHeight
  572. * Height of target area.
  573. *
  574. * @param {object} field
  575. * The playing field.
  576. *
  577. * @param {Highcharts.Series} series
  578. * Series object.
  579. *
  580. * @return {number}
  581. * Returns the value to scale the playing field up to the size of the target
  582. * area.
  583. */
  584. function getScale(targetWidth, targetHeight, field) {
  585. var height = Math.max(Math.abs(field.top), Math.abs(field.bottom)) * 2, width = Math.max(Math.abs(field.left), Math.abs(field.right)) * 2, scaleX = width > 0 ? 1 / width * targetWidth : 1, scaleY = height > 0 ? 1 / height * targetHeight : 1;
  586. return Math.min(scaleX, scaleY);
  587. }
  588. /**
  589. * Calculates what is called the playing field. The field is the area which all
  590. * the words are allowed to be positioned within. The area is proportioned to
  591. * match the target aspect ratio.
  592. *
  593. * @private
  594. * @function getPlayingField
  595. *
  596. * @param {number} targetWidth
  597. * Width of the target area.
  598. *
  599. * @param {number} targetHeight
  600. * Height of the target area.
  601. *
  602. * @param {Array<Highcharts.Point>} data
  603. * Array of points.
  604. *
  605. * @param {object} data.dimensions
  606. * The height and width of the word.
  607. *
  608. * @return {object}
  609. * The width and height of the playing field.
  610. */
  611. function getPlayingField(targetWidth, targetHeight, data) {
  612. var info = data.reduce(function (obj, point) {
  613. var dimensions = point.dimensions, x = Math.max(dimensions.width, dimensions.height);
  614. // Find largest height.
  615. obj.maxHeight = Math.max(obj.maxHeight, dimensions.height);
  616. // Find largest width.
  617. obj.maxWidth = Math.max(obj.maxWidth, dimensions.width);
  618. // Sum up the total maximum area of all the words.
  619. obj.area += x * x;
  620. return obj;
  621. }, {
  622. maxHeight: 0,
  623. maxWidth: 0,
  624. area: 0
  625. }),
  626. /**
  627. * Use largest width, largest height, or root of total area to give size
  628. * to the playing field.
  629. */
  630. x = Math.max(info.maxHeight, // Have enough space for the tallest word
  631. info.maxWidth, // Have enough space for the broadest word
  632. // Adjust 15% to account for close packing of words
  633. Math.sqrt(info.area) * 0.85), ratioX = targetWidth > targetHeight ? targetWidth / targetHeight : 1, ratioY = targetHeight > targetWidth ? targetHeight / targetWidth : 1;
  634. return {
  635. width: x * ratioX,
  636. height: x * ratioY,
  637. ratioX: ratioX,
  638. ratioY: ratioY
  639. };
  640. }
  641. /**
  642. * Calculates a number of degrees to rotate, based upon a number of orientations
  643. * within a range from-to.
  644. *
  645. * @private
  646. * @function getRotation
  647. *
  648. * @param {number} [orientations]
  649. * Number of orientations.
  650. *
  651. * @param {number} [index]
  652. * Index of point, used to decide orientation.
  653. *
  654. * @param {number} [from]
  655. * The smallest degree of rotation.
  656. *
  657. * @param {number} [to]
  658. * The largest degree of rotation.
  659. *
  660. * @return {boolean|number}
  661. * Returns the resulting rotation for the word. Returns false if invalid input
  662. * parameters.
  663. */
  664. function getRotation(orientations, index, from, to) {
  665. var result = false, // Default to false
  666. range, intervals, orientation;
  667. // Check if we have valid input parameters.
  668. if (isNumber(orientations) &&
  669. isNumber(index) &&
  670. isNumber(from) &&
  671. isNumber(to) &&
  672. orientations > 0 &&
  673. index > -1 &&
  674. to > from) {
  675. range = to - from;
  676. intervals = range / (orientations - 1 || 1);
  677. orientation = index % orientations;
  678. result = from + (orientation * intervals);
  679. }
  680. return result;
  681. }
  682. /**
  683. * Calculates the spiral positions and store them in scope for quick access.
  684. *
  685. * @private
  686. * @function getSpiral
  687. *
  688. * @param {Function} fn
  689. * The spiral function.
  690. *
  691. * @param {object} params
  692. * Additional parameters for the spiral.
  693. *
  694. * @return {Function}
  695. * Function with access to spiral positions.
  696. */
  697. function getSpiral(fn, params) {
  698. var length = 10000, i, arr = [];
  699. for (i = 1; i < length; i++) {
  700. arr.push(fn(i, params)); // @todo unnecessary amount of precaclulation
  701. }
  702. return function (attempt) {
  703. return attempt <= length ? arr[attempt - 1] : false;
  704. };
  705. }
  706. /**
  707. * Detects if a word is placed outside the playing field.
  708. *
  709. * @private
  710. * @function outsidePlayingField
  711. *
  712. * @param {Highcharts.PolygonBoxObject} rect
  713. * The word box.
  714. *
  715. * @param {Highcharts.WordcloudFieldObject} field
  716. * The width and height of the playing field.
  717. *
  718. * @return {boolean}
  719. * Returns true if the word is placed outside the field.
  720. */
  721. function outsidePlayingField(rect, field) {
  722. var playingField = {
  723. left: -(field.width / 2),
  724. right: field.width / 2,
  725. top: -(field.height / 2),
  726. bottom: field.height / 2
  727. };
  728. return !(playingField.left < rect.left &&
  729. playingField.right > rect.right &&
  730. playingField.top < rect.top &&
  731. playingField.bottom > rect.bottom);
  732. }
  733. /**
  734. * Check if a point intersects with previously placed words, or if it goes
  735. * outside the field boundaries. If a collision, then try to adjusts the
  736. * position.
  737. *
  738. * @private
  739. * @function intersectionTesting
  740. *
  741. * @param {Highcharts.Point} point
  742. * Point to test for intersections.
  743. *
  744. * @param {Highcharts.WordcloudTestOptionsObject} options
  745. * Options object.
  746. *
  747. * @return {boolean|Highcharts.PositionObject}
  748. * Returns an object with how much to correct the positions. Returns false if
  749. * the word should not be placed at all.
  750. */
  751. function intersectionTesting(point, options) {
  752. var placed = options.placed, field = options.field, rectangle = options.rectangle, polygon = options.polygon, spiral = options.spiral, attempt = 1, delta = {
  753. x: 0,
  754. y: 0
  755. },
  756. // Make a copy to update values during intersection testing.
  757. rect = point.rect = extend({}, rectangle);
  758. point.polygon = polygon;
  759. point.rotation = options.rotation;
  760. /* while w intersects any previously placed words:
  761. do {
  762. move w a little bit along a spiral path
  763. } while any part of w is outside the playing field and
  764. the spiral radius is still smallish */
  765. while (delta !== false &&
  766. (intersectsAnyWord(point, placed) ||
  767. outsidePlayingField(rect, field))) {
  768. delta = spiral(attempt);
  769. if (isObject(delta)) {
  770. // Update the DOMRect with new positions.
  771. rect.left = rectangle.left + delta.x;
  772. rect.right = rectangle.right + delta.x;
  773. rect.top = rectangle.top + delta.y;
  774. rect.bottom = rectangle.bottom + delta.y;
  775. point.polygon = movePolygon(delta.x, delta.y, polygon);
  776. }
  777. attempt++;
  778. }
  779. return delta;
  780. }
  781. /**
  782. * Extends the playing field to have enough space to fit a given word.
  783. *
  784. * @private
  785. * @function extendPlayingField
  786. *
  787. * @param {Highcharts.WordcloudFieldObject} field
  788. * The width, height and ratios of a playing field.
  789. *
  790. * @param {Highcharts.PolygonBoxObject} rectangle
  791. * The bounding box of the word to add space for.
  792. *
  793. * @return {Highcharts.WordcloudFieldObject}
  794. * Returns the extended playing field with updated height and width.
  795. */
  796. function extendPlayingField(field, rectangle) {
  797. var height, width, ratioX, ratioY, x, extendWidth, extendHeight, result;
  798. if (isObject(field) && isObject(rectangle)) {
  799. height = (rectangle.bottom - rectangle.top);
  800. width = (rectangle.right - rectangle.left);
  801. ratioX = field.ratioX;
  802. ratioY = field.ratioY;
  803. // Use the same variable to extend both the height and width.
  804. x = ((width * ratioX) > (height * ratioY)) ? width : height;
  805. // Multiply variable with ratios to preserve aspect ratio.
  806. extendWidth = x * ratioX;
  807. extendHeight = x * ratioY;
  808. // Calculate the size of the new field after adding space for the word.
  809. result = merge(field, {
  810. // Add space on the left and right.
  811. width: field.width + (extendWidth * 2),
  812. // Add space on the top and bottom.
  813. height: field.height + (extendHeight * 2)
  814. });
  815. }
  816. else {
  817. result = field;
  818. }
  819. // Return the new extended field.
  820. return result;
  821. }
  822. /**
  823. * If a rectangle is outside a give field, then the boundaries of the field is
  824. * adjusted accordingly. Modifies the field object which is passed as the first
  825. * parameter.
  826. *
  827. * @private
  828. * @function updateFieldBoundaries
  829. *
  830. * @param {Highcharts.WordcloudFieldObject} field
  831. * The bounding box of a playing field.
  832. *
  833. * @param {Highcharts.PolygonBoxObject} rectangle
  834. * The bounding box for a placed point.
  835. *
  836. * @return {Highcharts.WordcloudFieldObject}
  837. * Returns a modified field object.
  838. */
  839. function updateFieldBoundaries(field, rectangle) {
  840. // @todo improve type checking.
  841. if (!isNumber(field.left) || field.left > rectangle.left) {
  842. field.left = rectangle.left;
  843. }
  844. if (!isNumber(field.right) || field.right < rectangle.right) {
  845. field.right = rectangle.right;
  846. }
  847. if (!isNumber(field.top) || field.top > rectangle.top) {
  848. field.top = rectangle.top;
  849. }
  850. if (!isNumber(field.bottom) || field.bottom < rectangle.bottom) {
  851. field.bottom = rectangle.bottom;
  852. }
  853. return field;
  854. }
  855. /**
  856. * A word cloud is a visualization of a set of words, where the size and
  857. * placement of a word is determined by how it is weighted.
  858. *
  859. * @sample highcharts/demo/wordcloud
  860. * Word Cloud chart
  861. *
  862. * @extends plotOptions.column
  863. * @excluding allAreas, boostThreshold, clip, colorAxis, compare,
  864. * compareBase, crisp, cropTreshold, dataGrouping, dataLabels,
  865. * depth, dragDrop, edgeColor, findNearestPointBy,
  866. * getExtremesFromAll, grouping, groupPadding, groupZPadding,
  867. * joinBy, maxPointWidth, minPointLength, navigatorOptions,
  868. * negativeColor, pointInterval, pointIntervalUnit, pointPadding,
  869. * pointPlacement, pointRange, pointStart, pointWidth, pointStart,
  870. * pointWidth, shadow, showCheckbox, showInNavigator,
  871. * softThreshold, stacking, threshold, zoneAxis, zones
  872. * @product highcharts
  873. * @since 6.0.0
  874. * @requires modules/wordcloud
  875. * @optionparent plotOptions.wordcloud
  876. */
  877. var wordCloudOptions = {
  878. /**
  879. * If there is no space for a word on the playing field, then this option
  880. * will allow the playing field to be extended to fit the word. If false
  881. * then the word will be dropped from the visualization.
  882. *
  883. * NB! This option is currently not decided to be published in the API, and
  884. * is therefore marked as private.
  885. *
  886. * @private
  887. */
  888. allowExtendPlayingField: true,
  889. animation: {
  890. /** @internal */
  891. duration: 500
  892. },
  893. borderWidth: 0,
  894. clip: false,
  895. colorByPoint: true,
  896. /**
  897. * A threshold determining the minimum font size that can be applied to a
  898. * word.
  899. */
  900. minFontSize: 1,
  901. /**
  902. * The word with the largest weight will have a font size equal to this
  903. * value. The font size of a word is the ratio between its weight and the
  904. * largest occuring weight, multiplied with the value of maxFontSize.
  905. */
  906. maxFontSize: 25,
  907. /**
  908. * This option decides which algorithm is used for placement, and rotation
  909. * of a word. The choice of algorith is therefore a crucial part of the
  910. * resulting layout of the wordcloud. It is possible for users to add their
  911. * own custom placement strategies for use in word cloud. Read more about it
  912. * in our
  913. * [documentation](https://www.highcharts.com/docs/chart-and-series-types/word-cloud-series#custom-placement-strategies)
  914. *
  915. * @validvalue: ["center", "random"]
  916. */
  917. placementStrategy: 'center',
  918. /**
  919. * Rotation options for the words in the wordcloud.
  920. *
  921. * @sample highcharts/plotoptions/wordcloud-rotation
  922. * Word cloud with rotation
  923. */
  924. rotation: {
  925. /**
  926. * The smallest degree of rotation for a word.
  927. */
  928. from: 0,
  929. /**
  930. * The number of possible orientations for a word, within the range of
  931. * `rotation.from` and `rotation.to`. Must be a number larger than 0.
  932. */
  933. orientations: 2,
  934. /**
  935. * The largest degree of rotation for a word.
  936. */
  937. to: 90
  938. },
  939. showInLegend: false,
  940. /**
  941. * Spiral used for placing a word after the initial position experienced a
  942. * collision with either another word or the borders.
  943. * It is possible for users to add their own custom spiralling algorithms
  944. * for use in word cloud. Read more about it in our
  945. * [documentation](https://www.highcharts.com/docs/chart-and-series-types/word-cloud-series#custom-spiralling-algorithm)
  946. *
  947. * @validvalue: ["archimedean", "rectangular", "square"]
  948. */
  949. spiral: 'rectangular',
  950. /**
  951. * CSS styles for the words.
  952. *
  953. * @type {Highcharts.CSSObject}
  954. * @default {"fontFamily":"sans-serif", "fontWeight": "900"}
  955. */
  956. style: {
  957. /** @ignore-option */
  958. fontFamily: 'sans-serif',
  959. /** @ignore-option */
  960. fontWeight: '900',
  961. /** @ignore-option */
  962. whiteSpace: 'nowrap'
  963. },
  964. tooltip: {
  965. followPointer: true,
  966. pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.weight}</b><br/>'
  967. }
  968. };
  969. // Properties of the WordCloud series.
  970. var wordCloudSeries = {
  971. animate: Series.prototype.animate,
  972. animateDrilldown: noop,
  973. animateDrillupFrom: noop,
  974. setClip: noop,
  975. bindAxes: function () {
  976. var wordcloudAxis = {
  977. endOnTick: false,
  978. gridLineWidth: 0,
  979. lineWidth: 0,
  980. maxPadding: 0,
  981. startOnTick: false,
  982. title: null,
  983. tickPositions: []
  984. };
  985. Series.prototype.bindAxes.call(this);
  986. extend(this.yAxis.options, wordcloudAxis);
  987. extend(this.xAxis.options, wordcloudAxis);
  988. },
  989. pointAttribs: function (point, state) {
  990. var attribs = H.seriesTypes.column.prototype
  991. .pointAttribs.call(this, point, state);
  992. delete attribs.stroke;
  993. delete attribs['stroke-width'];
  994. return attribs;
  995. },
  996. /**
  997. * Calculates the fontSize of a word based on its weight.
  998. *
  999. * @private
  1000. * @function Highcharts.Series#deriveFontSize
  1001. *
  1002. * @param {number} [relativeWeight=0]
  1003. * The weight of the word, on a scale 0-1.
  1004. *
  1005. * @param {number} [maxFontSize=1]
  1006. * The maximum font size of a word.
  1007. *
  1008. * @param {number} [minFontSize=1]
  1009. * The minimum font size of a word.
  1010. *
  1011. * @return {number}
  1012. * Returns the resulting fontSize of a word. If minFontSize is larger then
  1013. * maxFontSize the result will equal minFontSize.
  1014. */
  1015. deriveFontSize: function deriveFontSize(relativeWeight, maxFontSize, minFontSize) {
  1016. var weight = isNumber(relativeWeight) ? relativeWeight : 0, max = isNumber(maxFontSize) ? maxFontSize : 1, min = isNumber(minFontSize) ? minFontSize : 1;
  1017. return Math.floor(Math.max(min, weight * max));
  1018. },
  1019. drawPoints: function () {
  1020. var series = this, hasRendered = series.hasRendered, xAxis = series.xAxis, yAxis = series.yAxis, chart = series.chart, group = series.group, options = series.options, animation = options.animation, allowExtendPlayingField = options.allowExtendPlayingField, renderer = chart.renderer, testElement = renderer.text().add(group), placed = [], placementStrategy = series.placementStrategy[options.placementStrategy], spiral, rotation = options.rotation, scale, weights = series.points.map(function (p) {
  1021. return p.weight;
  1022. }), maxWeight = Math.max.apply(null, weights), data = series.points.sort(function (a, b) {
  1023. return b.weight - a.weight; // Sort descending
  1024. }), field;
  1025. // Get the dimensions for each word.
  1026. // Used in calculating the playing field.
  1027. data.forEach(function (point) {
  1028. var relativeWeight = 1 / maxWeight * point.weight, fontSize = series.deriveFontSize(relativeWeight, options.maxFontSize, options.minFontSize), css = extend({
  1029. fontSize: fontSize + 'px'
  1030. }, options.style), bBox;
  1031. testElement.css(css).attr({
  1032. x: 0,
  1033. y: 0,
  1034. text: point.name
  1035. });
  1036. bBox = testElement.getBBox(true);
  1037. point.dimensions = {
  1038. height: bBox.height,
  1039. width: bBox.width
  1040. };
  1041. });
  1042. // Calculate the playing field.
  1043. field = getPlayingField(xAxis.len, yAxis.len, data);
  1044. spiral = getSpiral(series.spirals[options.spiral], {
  1045. field: field
  1046. });
  1047. // Draw all the points.
  1048. data.forEach(function (point) {
  1049. var relativeWeight = 1 / maxWeight * point.weight, fontSize = series.deriveFontSize(relativeWeight, options.maxFontSize, options.minFontSize), css = extend({
  1050. fontSize: fontSize + 'px'
  1051. }, options.style), placement = placementStrategy(point, {
  1052. data: data,
  1053. field: field,
  1054. placed: placed,
  1055. rotation: rotation
  1056. }), attr = extend(series.pointAttribs(point, (point.selected && 'select')), {
  1057. align: 'center',
  1058. 'alignment-baseline': 'middle',
  1059. x: placement.x,
  1060. y: placement.y,
  1061. text: point.name,
  1062. rotation: placement.rotation
  1063. }), polygon = getPolygon(placement.x, placement.y, point.dimensions.width, point.dimensions.height, placement.rotation), rectangle = getBoundingBoxFromPolygon(polygon), delta = intersectionTesting(point, {
  1064. rectangle: rectangle,
  1065. polygon: polygon,
  1066. field: field,
  1067. placed: placed,
  1068. spiral: spiral,
  1069. rotation: placement.rotation
  1070. }), animate;
  1071. // If there is no space for the word, extend the playing field.
  1072. if (!delta && allowExtendPlayingField) {
  1073. // Extend the playing field to fit the word.
  1074. field = extendPlayingField(field, rectangle);
  1075. // Run intersection testing one more time to place the word.
  1076. delta = intersectionTesting(point, {
  1077. rectangle: rectangle,
  1078. polygon: polygon,
  1079. field: field,
  1080. placed: placed,
  1081. spiral: spiral,
  1082. rotation: placement.rotation
  1083. });
  1084. }
  1085. // Check if point was placed, if so delete it, otherwise place it on
  1086. // the correct positions.
  1087. if (isObject(delta)) {
  1088. attr.x += delta.x;
  1089. attr.y += delta.y;
  1090. rectangle.left += delta.x;
  1091. rectangle.right += delta.x;
  1092. rectangle.top += delta.y;
  1093. rectangle.bottom += delta.y;
  1094. field = updateFieldBoundaries(field, rectangle);
  1095. placed.push(point);
  1096. point.isNull = false;
  1097. }
  1098. else {
  1099. point.isNull = true;
  1100. }
  1101. if (animation) {
  1102. // Animate to new positions
  1103. animate = {
  1104. x: attr.x,
  1105. y: attr.y
  1106. };
  1107. // Animate from center of chart
  1108. if (!hasRendered) {
  1109. attr.x = 0;
  1110. attr.y = 0;
  1111. // or animate from previous position
  1112. }
  1113. else {
  1114. delete attr.x;
  1115. delete attr.y;
  1116. }
  1117. }
  1118. point.draw({
  1119. animatableAttribs: animate,
  1120. attribs: attr,
  1121. css: css,
  1122. group: group,
  1123. renderer: renderer,
  1124. shapeArgs: void 0,
  1125. shapeType: 'text'
  1126. });
  1127. });
  1128. // Destroy the element after use.
  1129. testElement = testElement.destroy();
  1130. // Scale the series group to fit within the plotArea.
  1131. scale = getScale(xAxis.len, yAxis.len, field);
  1132. series.group.attr({
  1133. scaleX: scale,
  1134. scaleY: scale
  1135. });
  1136. },
  1137. hasData: function () {
  1138. var series = this;
  1139. return (isObject(series) &&
  1140. series.visible === true &&
  1141. isArray(series.points) &&
  1142. series.points.length > 0);
  1143. },
  1144. // Strategies used for deciding rotation and initial position of a word. To
  1145. // implement a custom strategy, have a look at the function random for
  1146. // example.
  1147. placementStrategy: {
  1148. random: function (point, options) {
  1149. var field = options.field, r = options.rotation;
  1150. return {
  1151. x: getRandomPosition(field.width) - (field.width / 2),
  1152. y: getRandomPosition(field.height) - (field.height / 2),
  1153. rotation: getRotation(r.orientations, point.index, r.from, r.to)
  1154. };
  1155. },
  1156. center: function (point, options) {
  1157. var r = options.rotation;
  1158. return {
  1159. x: 0,
  1160. y: 0,
  1161. rotation: getRotation(r.orientations, point.index, r.from, r.to)
  1162. };
  1163. }
  1164. },
  1165. pointArrayMap: ['weight'],
  1166. // Spirals used for placing a word after the initial position experienced a
  1167. // collision with either another word or the borders. To implement a custom
  1168. // spiral, look at the function archimedeanSpiral for example.
  1169. spirals: {
  1170. 'archimedean': archimedeanSpiral,
  1171. 'rectangular': rectangularSpiral,
  1172. 'square': squareSpiral
  1173. },
  1174. utils: {
  1175. extendPlayingField: extendPlayingField,
  1176. getRotation: getRotation,
  1177. isPolygonsColliding: isPolygonsColliding,
  1178. rotate2DToOrigin: polygon.rotate2DToOrigin,
  1179. rotate2DToPoint: polygon.rotate2DToPoint
  1180. },
  1181. getPlotBox: function () {
  1182. var series = this, chart = series.chart, inverted = chart.inverted,
  1183. // Swap axes for inverted (#2339)
  1184. xAxis = series[(inverted ? 'yAxis' : 'xAxis')], yAxis = series[(inverted ? 'xAxis' : 'yAxis')], width = xAxis ? xAxis.len : chart.plotWidth, height = yAxis ? yAxis.len : chart.plotHeight, x = xAxis ? xAxis.left : chart.plotLeft, y = yAxis ? yAxis.top : chart.plotTop;
  1185. return {
  1186. translateX: x + (width / 2),
  1187. translateY: y + (height / 2),
  1188. scaleX: 1,
  1189. scaleY: 1
  1190. };
  1191. }
  1192. };
  1193. // Properties of the Sunburst series.
  1194. var wordCloudPoint = {
  1195. draw: drawPoint,
  1196. shouldDraw: function shouldDraw() {
  1197. var point = this;
  1198. return !point.isNull;
  1199. },
  1200. isValid: function isValid() {
  1201. return true;
  1202. },
  1203. weight: 1
  1204. };
  1205. /**
  1206. * A `wordcloud` series. If the [type](#series.wordcloud.type) option is not
  1207. * specified, it is inherited from [chart.type](#chart.type).
  1208. *
  1209. * @extends series,plotOptions.wordcloud
  1210. * @product highcharts
  1211. * @requires modules/wordcloud
  1212. * @apioption series.wordcloud
  1213. */
  1214. /**
  1215. * An array of data points for the series. For the `wordcloud` series type,
  1216. * points can be given in the following ways:
  1217. *
  1218. * 1. An array of arrays with 2 values. In this case, the values correspond to
  1219. * `name,weight`.
  1220. * ```js
  1221. * data: [
  1222. * ['Lorem', 4],
  1223. * ['Ipsum', 1]
  1224. * ]
  1225. * ```
  1226. *
  1227. * 2. An array of objects with named values. The following snippet shows only a
  1228. * few settings, see the complete options set below. If the total number of
  1229. * data points exceeds the series'
  1230. * [turboThreshold](#series.arearange.turboThreshold), this option is not
  1231. * available.
  1232. * ```js
  1233. * data: [{
  1234. * name: "Lorem",
  1235. * weight: 4
  1236. * }, {
  1237. * name: "Ipsum",
  1238. * weight: 1
  1239. * }]
  1240. * ```
  1241. *
  1242. * @type {Array<Array<string,number>|*>}
  1243. * @extends series.line.data
  1244. * @excluding drilldown, marker, x, y
  1245. * @product highcharts
  1246. * @apioption series.wordcloud.data
  1247. */
  1248. /**
  1249. * The name decides the text for a word.
  1250. *
  1251. * @type {string}
  1252. * @since 6.0.0
  1253. * @product highcharts
  1254. * @apioption series.sunburst.data.name
  1255. */
  1256. /**
  1257. * The weighting of a word. The weight decides the relative size of a word
  1258. * compared to the rest of the collection.
  1259. *
  1260. * @type {number}
  1261. * @since 6.0.0
  1262. * @product highcharts
  1263. * @apioption series.sunburst.data.weight
  1264. */
  1265. /**
  1266. * @private
  1267. * @class
  1268. * @name Highcharts.seriesTypes.wordcloud
  1269. *
  1270. * @augments Highcharts.Series
  1271. */
  1272. H.seriesType('wordcloud', 'column', wordCloudOptions, wordCloudSeries, wordCloudPoint);
  1273. });
  1274. _registerModule(_modules, 'masters/modules/wordcloud.src.js', [], function () {
  1275. });
  1276. }));