tilemap.src.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. /**
  2. * @license Highmaps JS v8.1.2 (2020-06-16)
  3. *
  4. * Tilemap module
  5. *
  6. * (c) 2010-2019 Highsoft AS
  7. *
  8. * License: www.highcharts.com/license
  9. */
  10. 'use strict';
  11. (function (factory) {
  12. if (typeof module === 'object' && module.exports) {
  13. factory['default'] = factory;
  14. module.exports = factory;
  15. } else if (typeof define === 'function' && define.amd) {
  16. define('highcharts/modules/tilemap', ['highcharts', 'highcharts/modules/map'], function (Highcharts) {
  17. factory(Highcharts);
  18. factory.Highcharts = Highcharts;
  19. return factory;
  20. });
  21. } else {
  22. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  23. }
  24. }(function (Highcharts) {
  25. var _modules = Highcharts ? Highcharts._modules : {};
  26. function _registerModule(obj, path, args, fn) {
  27. if (!obj.hasOwnProperty(path)) {
  28. obj[path] = fn.apply(null, args);
  29. }
  30. }
  31. _registerModule(_modules, 'modules/tilemap.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) {
  32. /* *
  33. *
  34. * Tilemaps module
  35. *
  36. * (c) 2010-2017 Highsoft AS
  37. * Author: Øystein Moseng
  38. *
  39. * License: www.highcharts.com/license
  40. *
  41. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  42. *
  43. * */
  44. /**
  45. * @typedef {"circle"|"diamond"|"hexagon"|"square"} Highcharts.TilemapShapeValue
  46. */
  47. ''; // detach doclets above
  48. var addEvent = U.addEvent, clamp = U.clamp, extend = U.extend, pick = U.pick, seriesType = U.seriesType;
  49. /**
  50. * Utility func to get padding definition from tile size division
  51. * @private
  52. * @param {Highcharts.TilemapSeries} series
  53. * series
  54. * @param {Highcharts.number} xDiv
  55. * xDiv
  56. * @param {Highcharts.number} yDiv
  57. * yDiv
  58. * @return {Highcharts.TilemapPaddingObject}
  59. */
  60. function tilePaddingFromTileSize(series, xDiv, yDiv) {
  61. var options = series.options;
  62. return {
  63. xPad: (options.colsize || 1) / -xDiv,
  64. yPad: (options.rowsize || 1) / -yDiv
  65. };
  66. }
  67. // Map of shape types.
  68. H.tileShapeTypes = {
  69. // Hexagon shape type.
  70. hexagon: {
  71. alignDataLabel: H.seriesTypes.scatter.prototype.alignDataLabel,
  72. getSeriesPadding: function (series) {
  73. return tilePaddingFromTileSize(series, 3, 2);
  74. },
  75. haloPath: function (size) {
  76. if (!size) {
  77. return [];
  78. }
  79. var hexagon = this.tileEdges;
  80. return [
  81. ['M', hexagon.x2 - size, hexagon.y1 + size],
  82. ['L', hexagon.x3 + size, hexagon.y1 + size],
  83. ['L', hexagon.x4 + size * 1.5, hexagon.y2],
  84. ['L', hexagon.x3 + size, hexagon.y3 - size],
  85. ['L', hexagon.x2 - size, hexagon.y3 - size],
  86. ['L', hexagon.x1 - size * 1.5, hexagon.y2],
  87. ['Z']
  88. ];
  89. },
  90. translate: function () {
  91. var series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, seriesPointPadding = options.pointPadding || 0, xPad = (options.colsize || 1) / 3, yPad = (options.rowsize || 1) / 2, yShift;
  92. series.generatePoints();
  93. series.points.forEach(function (point) {
  94. var x1 = clamp(Math.floor(xAxis.len -
  95. xAxis.translate(point.x - xPad * 2, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len), x2 = clamp(Math.floor(xAxis.len -
  96. xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len), x3 = clamp(Math.floor(xAxis.len -
  97. xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len), x4 = clamp(Math.floor(xAxis.len -
  98. xAxis.translate(point.x + xPad * 2, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len), y1 = clamp(Math.floor(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len), y2 = clamp(Math.floor(yAxis.translate(point.y, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len), y3 = clamp(Math.floor(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len), pointPadding = pick(point.pointPadding, seriesPointPadding),
  99. // We calculate the point padding of the midpoints to
  100. // preserve the angles of the shape.
  101. midPointPadding = pointPadding *
  102. Math.abs(x2 - x1) / Math.abs(y3 - y2), xMidPadding = xAxis.reversed ?
  103. -midPointPadding : midPointPadding, xPointPadding = xAxis.reversed ?
  104. -pointPadding : pointPadding, yPointPadding = yAxis.reversed ?
  105. -pointPadding : pointPadding;
  106. // Shift y-values for every second grid column
  107. if (point.x % 2) {
  108. yShift = yShift || Math.round(Math.abs(y3 - y1) / 2) *
  109. // We have to reverse the shift for reversed y-axes
  110. (yAxis.reversed ? -1 : 1);
  111. y1 += yShift;
  112. y2 += yShift;
  113. y3 += yShift;
  114. }
  115. // Set plotX and plotY for use in K-D-Tree and more
  116. point.plotX = point.clientX = (x2 + x3) / 2;
  117. point.plotY = y2;
  118. // Apply point padding to translated coordinates
  119. x1 += xMidPadding + xPointPadding;
  120. x2 += xPointPadding;
  121. x3 -= xPointPadding;
  122. x4 -= xMidPadding + xPointPadding;
  123. y1 -= yPointPadding;
  124. y3 += yPointPadding;
  125. // Store points for halo creation
  126. point.tileEdges = {
  127. x1: x1, x2: x2, x3: x3, x4: x4, y1: y1, y2: y2, y3: y3
  128. };
  129. // Finally set the shape for this point
  130. point.shapeType = 'path';
  131. point.shapeArgs = {
  132. d: [
  133. ['M', x2, y1],
  134. ['L', x3, y1],
  135. ['L', x4, y2],
  136. ['L', x3, y3],
  137. ['L', x2, y3],
  138. ['L', x1, y2],
  139. ['Z']
  140. ]
  141. };
  142. });
  143. series.translateColors();
  144. }
  145. },
  146. // Diamond shape type.
  147. diamond: {
  148. alignDataLabel: H.seriesTypes.scatter.prototype.alignDataLabel,
  149. getSeriesPadding: function (series) {
  150. return tilePaddingFromTileSize(series, 2, 2);
  151. },
  152. haloPath: function (size) {
  153. if (!size) {
  154. return [];
  155. }
  156. var diamond = this.tileEdges;
  157. return [
  158. ['M', diamond.x2, diamond.y1 + size],
  159. ['L', diamond.x3 + size, diamond.y2],
  160. ['L', diamond.x2, diamond.y3 - size],
  161. ['L', diamond.x1 - size, diamond.y2],
  162. ['Z']
  163. ];
  164. },
  165. translate: function () {
  166. var series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, seriesPointPadding = options.pointPadding || 0, xPad = (options.colsize || 1), yPad = (options.rowsize || 1) / 2, yShift;
  167. series.generatePoints();
  168. series.points.forEach(function (point) {
  169. var x1 = clamp(Math.round(xAxis.len -
  170. xAxis.translate(point.x - xPad, 0, 1, 0, 0)), -xAxis.len, 2 * xAxis.len), x2 = clamp(Math.round(xAxis.len -
  171. xAxis.translate(point.x, 0, 1, 0, 0)), -xAxis.len, 2 * xAxis.len), x3 = clamp(Math.round(xAxis.len -
  172. xAxis.translate(point.x + xPad, 0, 1, 0, 0)), -xAxis.len, 2 * xAxis.len), y1 = clamp(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 0)), -yAxis.len, 2 * yAxis.len), y2 = clamp(Math.round(yAxis.translate(point.y, 0, 1, 0, 0)), -yAxis.len, 2 * yAxis.len), y3 = clamp(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 0)), -yAxis.len, 2 * yAxis.len), pointPadding = pick(point.pointPadding, seriesPointPadding),
  173. // We calculate the point padding of the midpoints to
  174. // preserve the angles of the shape.
  175. midPointPadding = pointPadding *
  176. Math.abs(x2 - x1) / Math.abs(y3 - y2), xPointPadding = xAxis.reversed ?
  177. -midPointPadding : midPointPadding, yPointPadding = yAxis.reversed ?
  178. -pointPadding : pointPadding;
  179. // Shift y-values for every second grid column
  180. // We have to reverse the shift for reversed y-axes
  181. if (point.x % 2) {
  182. yShift = Math.abs(y3 - y1) / 2 * (yAxis.reversed ? -1 : 1);
  183. y1 += yShift;
  184. y2 += yShift;
  185. y3 += yShift;
  186. }
  187. // Set plotX and plotY for use in K-D-Tree and more
  188. point.plotX = point.clientX = x2;
  189. point.plotY = y2;
  190. // Apply point padding to translated coordinates
  191. x1 += xPointPadding;
  192. x3 -= xPointPadding;
  193. y1 -= yPointPadding;
  194. y3 += yPointPadding;
  195. // Store points for halo creation
  196. point.tileEdges = {
  197. x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3
  198. };
  199. // Set this point's shape parameters
  200. point.shapeType = 'path';
  201. point.shapeArgs = {
  202. d: [
  203. ['M', x2, y1],
  204. ['L', x3, y2],
  205. ['L', x2, y3],
  206. ['L', x1, y2],
  207. ['Z']
  208. ]
  209. };
  210. });
  211. series.translateColors();
  212. }
  213. },
  214. // Circle shape type.
  215. circle: {
  216. alignDataLabel: H.seriesTypes.scatter.prototype.alignDataLabel,
  217. getSeriesPadding: function (series) {
  218. return tilePaddingFromTileSize(series, 2, 2);
  219. },
  220. haloPath: function (size) {
  221. return H.seriesTypes.scatter.prototype.pointClass.prototype.haloPath
  222. .call(this, size + (size && this.radius));
  223. },
  224. translate: function () {
  225. var series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, seriesPointPadding = options.pointPadding || 0, yRadius = (options.rowsize || 1) / 2, colsize = (options.colsize || 1), colsizePx, yRadiusPx, xRadiusPx, radius, forceNextRadiusCompute = false;
  226. series.generatePoints();
  227. series.points.forEach(function (point) {
  228. var x = clamp(Math.round(xAxis.len -
  229. xAxis.translate(point.x, 0, 1, 0, 0)), -xAxis.len, 2 * xAxis.len), y = clamp(Math.round(yAxis.translate(point.y, 0, 1, 0, 0)), -yAxis.len, 2 * yAxis.len), pointPadding = seriesPointPadding, hasPerPointPadding = false;
  230. // If there is point padding defined on a single point, add it
  231. if (typeof point.pointPadding !== 'undefined') {
  232. pointPadding = point.pointPadding;
  233. hasPerPointPadding = true;
  234. forceNextRadiusCompute = true;
  235. }
  236. // Find radius if not found already.
  237. // Use the smallest one (x vs y) to avoid overlap.
  238. // Note that the radius will be recomputed for each series.
  239. // Ideal (max) x radius is dependent on y radius:
  240. /*
  241. * (circle 2)
  242. * (circle 3)
  243. | yRadiusPx
  244. (circle 1) *-------|
  245. colsizePx
  246. The distance between circle 1 and 3 (and circle 2 and 3) is
  247. 2r, which is the hypotenuse of the triangle created by
  248. colsizePx and yRadiusPx. If the distance between circle 2
  249. and circle 1 is less than 2r, we use half of that distance
  250. instead (yRadiusPx).
  251. */
  252. if (!radius || forceNextRadiusCompute) {
  253. colsizePx = Math.abs(clamp(Math.floor(xAxis.len -
  254. xAxis.translate(point.x + colsize, 0, 1, 0, 0)), -xAxis.len, 2 * xAxis.len) - x);
  255. yRadiusPx = Math.abs(clamp(Math.floor(yAxis.translate(point.y + yRadius, 0, 1, 0, 0)), -yAxis.len, 2 * yAxis.len) - y);
  256. xRadiusPx = Math.floor(Math.sqrt((colsizePx * colsizePx + yRadiusPx * yRadiusPx)) / 2);
  257. radius = Math.min(colsizePx, xRadiusPx, yRadiusPx) - pointPadding;
  258. // If we have per point padding we need to always compute
  259. // the radius for this point and the next. If we used to
  260. // have per point padding but don't anymore, don't force
  261. // compute next radius.
  262. if (forceNextRadiusCompute && !hasPerPointPadding) {
  263. forceNextRadiusCompute = false;
  264. }
  265. }
  266. // Shift y-values for every second grid column.
  267. // Note that we always use the optimal y axis radius for this.
  268. // Also note: We have to reverse the shift for reversed y-axes.
  269. if (point.x % 2) {
  270. y += yRadiusPx * (yAxis.reversed ? -1 : 1);
  271. }
  272. // Set plotX and plotY for use in K-D-Tree and more
  273. point.plotX = point.clientX = x;
  274. point.plotY = y;
  275. // Save radius for halo
  276. point.radius = radius;
  277. // Set this point's shape parameters
  278. point.shapeType = 'circle';
  279. point.shapeArgs = {
  280. x: x,
  281. y: y,
  282. r: radius
  283. };
  284. });
  285. series.translateColors();
  286. }
  287. },
  288. // Square shape type.
  289. square: {
  290. alignDataLabel: H.seriesTypes.heatmap.prototype.alignDataLabel,
  291. translate: H.seriesTypes.heatmap.prototype.translate,
  292. getSeriesPadding: function () {
  293. },
  294. haloPath: H.seriesTypes.heatmap.prototype.pointClass.prototype.haloPath
  295. }
  296. };
  297. /* eslint-disable no-invalid-this */
  298. // Extension to add pixel padding for series. Uses getSeriesPixelPadding on each
  299. // series and adds the largest padding required. If no series has this function
  300. // defined, we add nothing.
  301. addEvent(H.Axis, 'afterSetAxisTranslation', function () {
  302. if (this.recomputingForTilemap || this.coll === 'colorAxis') {
  303. return;
  304. }
  305. var axis = this,
  306. // Find which series' padding to use
  307. seriesPadding = axis.series
  308. .map(function (series) {
  309. return series.getSeriesPixelPadding &&
  310. series.getSeriesPixelPadding(axis);
  311. })
  312. .reduce(function (a, b) {
  313. return (a && a.padding) > (b && b.padding) ?
  314. a :
  315. b;
  316. }, void 0) ||
  317. {
  318. padding: 0,
  319. axisLengthFactor: 1
  320. }, lengthPadding = Math.round(seriesPadding.padding * seriesPadding.axisLengthFactor);
  321. // Don't waste time on this if we're not adding extra padding
  322. if (seriesPadding.padding) {
  323. // Recompute translation with new axis length now (minus padding)
  324. axis.len -= lengthPadding;
  325. axis.recomputingForTilemap = true;
  326. axis.setAxisTranslation();
  327. delete axis.recomputingForTilemap;
  328. axis.minPixelPadding += seriesPadding.padding;
  329. axis.len += lengthPadding;
  330. }
  331. });
  332. /**
  333. * @private
  334. * @class
  335. * @name Highcharts.seriesTypes.tilemap
  336. *
  337. * @augments Highcharts.Series
  338. */
  339. seriesType('tilemap', 'heatmap'
  340. /**
  341. * A tilemap series is a type of heatmap where the tile shapes are
  342. * configurable.
  343. *
  344. * @sample highcharts/demo/honeycomb-usa/
  345. * Honeycomb tilemap, USA
  346. * @sample maps/plotoptions/honeycomb-brazil/
  347. * Honeycomb tilemap, Brazil
  348. * @sample maps/plotoptions/honeycomb-china/
  349. * Honeycomb tilemap, China
  350. * @sample maps/plotoptions/honeycomb-europe/
  351. * Honeycomb tilemap, Europe
  352. * @sample maps/demo/circlemap-africa/
  353. * Circlemap tilemap, Africa
  354. * @sample maps/demo/diamondmap
  355. * Diamondmap tilemap
  356. *
  357. * @extends plotOptions.heatmap
  358. * @since 6.0.0
  359. * @excluding jitter, joinBy, shadow, allAreas, mapData, marker, data,
  360. * dataSorting
  361. * @product highcharts highmaps
  362. * @requires modules/tilemap.js
  363. * @optionparent plotOptions.tilemap
  364. */
  365. , {
  366. // Remove marker from tilemap default options, as it was before
  367. // heatmap refactoring.
  368. marker: null,
  369. states: {
  370. hover: {
  371. halo: {
  372. enabled: true,
  373. size: 2,
  374. opacity: 0.5,
  375. attributes: {
  376. zIndex: 3
  377. }
  378. }
  379. }
  380. },
  381. /**
  382. * The padding between points in the tilemap.
  383. *
  384. * @sample maps/plotoptions/tilemap-pointpadding
  385. * Point padding on tiles
  386. */
  387. pointPadding: 2,
  388. /**
  389. * The column size - how many X axis units each column in the tilemap
  390. * should span. Works as in [Heatmaps](#plotOptions.heatmap.colsize).
  391. *
  392. * @sample {highcharts} maps/demo/heatmap/
  393. * One day
  394. * @sample {highmaps} maps/demo/heatmap/
  395. * One day
  396. *
  397. * @type {number}
  398. * @default 1
  399. * @product highcharts highmaps
  400. * @apioption plotOptions.tilemap.colsize
  401. */
  402. /**
  403. * The row size - how many Y axis units each tilemap row should span.
  404. * Analogous to [colsize](#plotOptions.tilemap.colsize).
  405. *
  406. * @sample {highcharts} maps/demo/heatmap/
  407. * 1 by default
  408. * @sample {highmaps} maps/demo/heatmap/
  409. * 1 by default
  410. *
  411. * @type {number}
  412. * @default 1
  413. * @product highcharts highmaps
  414. * @apioption plotOptions.tilemap.rowsize
  415. */
  416. /**
  417. * The shape of the tiles in the tilemap. Possible values are `hexagon`,
  418. * `circle`, `diamond`, and `square`.
  419. *
  420. * @sample maps/demo/circlemap-africa
  421. * Circular tile shapes
  422. * @sample maps/demo/diamondmap
  423. * Diamond tile shapes
  424. *
  425. * @type {Highcharts.TilemapShapeValue}
  426. */
  427. tileShape: 'hexagon'
  428. }, {
  429. // Use drawPoints, markerAttribs, pointAttribs methods from the old
  430. // heatmap implementation.
  431. // TODO: Consider standarizing heatmap and tilemap into more
  432. // consistent form.
  433. markerAttribs: H.seriesTypes.scatter.prototype.markerAttribs,
  434. pointAttribs: H.seriesTypes.column.prototype.pointAttribs,
  435. // Revert the noop on getSymbol.
  436. getSymbol: H.noop,
  437. drawPoints: function () {
  438. var _this = this;
  439. // In styled mode, use CSS, otherwise the fill used in the style
  440. // sheet will take precedence over the fill attribute.
  441. H.seriesTypes.column.prototype.drawPoints.call(this);
  442. this.points.forEach(function (point) {
  443. point.graphic &&
  444. point.graphic[_this.chart.styledMode ? 'css' : 'animate'](_this.colorAttribs(point));
  445. });
  446. },
  447. // Set tile shape object on series
  448. setOptions: function () {
  449. // Call original function
  450. var ret = H.seriesTypes.heatmap.prototype.setOptions.apply(this, Array.prototype.slice.call(arguments));
  451. this.tileShape = H.tileShapeTypes[ret.tileShape];
  452. return ret;
  453. },
  454. // Use the shape's defined data label alignment function
  455. alignDataLabel: function () {
  456. return this.tileShape.alignDataLabel.apply(this, Array.prototype.slice.call(arguments));
  457. },
  458. // Get metrics for padding of axis for this series
  459. getSeriesPixelPadding: function (axis) {
  460. var isX = axis.isXAxis, padding = this.tileShape.getSeriesPadding(this), coord1, coord2;
  461. // If the shape type does not require padding, return no-op padding
  462. if (!padding) {
  463. return {
  464. padding: 0,
  465. axisLengthFactor: 1
  466. };
  467. }
  468. // Use translate to compute how far outside the points we
  469. // draw, and use this difference as padding.
  470. coord1 = Math.round(axis.translate(isX ?
  471. padding.xPad * 2 :
  472. padding.yPad, 0, 1, 0, 1));
  473. coord2 = Math.round(axis.translate(isX ? padding.xPad : 0, 0, 1, 0, 1));
  474. return {
  475. padding: Math.abs(coord1 - coord2) || 0,
  476. // Offset the yAxis length to compensate for shift. Setting the
  477. // length factor to 2 would add the same margin to max as min.
  478. // Now we only add a slight bit of the min margin to max, as we
  479. // don't actually draw outside the max bounds. For the xAxis we
  480. // draw outside on both sides so we add the same margin to min
  481. // and max.
  482. axisLengthFactor: isX ? 2 : 1.1
  483. };
  484. },
  485. // Use translate from tileShape
  486. translate: function () {
  487. return this.tileShape.translate.apply(this, Array.prototype.slice.call(arguments));
  488. }
  489. }, extend({
  490. // eslint-disable-next-line valid-jsdoc
  491. /**
  492. * @private
  493. * @function Highcharts.Point#haloPath
  494. *
  495. * @return {Highcharts.SVGElement|Highcharts.SVGPathArray|Array<Highcharts.SVGElement>}
  496. */
  497. haloPath: function () {
  498. return this.series.tileShape.haloPath.apply(this, Array.prototype.slice.call(arguments));
  499. }
  500. }, H.colorPointMixin));
  501. /**
  502. * A `tilemap` series. If the [type](#series.tilemap.type) option is
  503. * not specified, it is inherited from [chart.type](#chart.type).
  504. *
  505. * @extends series,plotOptions.tilemap
  506. * @excluding allAreas, dataParser, dataURL, joinBy, mapData, marker,
  507. * pointRange, shadow, stack, dataSorting
  508. * @product highcharts highmaps
  509. * @requires modules/tilemap.js
  510. * @apioption series.tilemap
  511. */
  512. /**
  513. * An array of data points for the series. For the `tilemap` series
  514. * type, points can be given in the following ways:
  515. *
  516. * 1. An array of arrays with 3 or 2 values. In this case, the values correspond
  517. * to `x,y,value`. If the first value is a string, it is applied as the name
  518. * of the point, and the `x` value is inferred. The `x` value can also be
  519. * omitted, in which case the inner arrays should be of length 2\. Then the
  520. * `x` value is automatically calculated, either starting at 0 and
  521. * incremented by 1, or from `pointStart` and `pointInterval` given in the
  522. * series options.
  523. * ```js
  524. * data: [
  525. * [0, 9, 7],
  526. * [1, 10, 4],
  527. * [2, 6, 3]
  528. * ]
  529. * ```
  530. *
  531. * 2. An array of objects with named values. The objects are point configuration
  532. * objects as seen below. If the total number of data points exceeds the
  533. * series' [turboThreshold](#series.tilemap.turboThreshold), this option is
  534. * not available.
  535. * ```js
  536. * data: [{
  537. * x: 1,
  538. * y: 3,
  539. * value: 10,
  540. * name: "Point2",
  541. * color: "#00FF00"
  542. * }, {
  543. * x: 1,
  544. * y: 7,
  545. * value: 10,
  546. * name: "Point1",
  547. * color: "#FF00FF"
  548. * }]
  549. * ```
  550. *
  551. * Note that for some [tileShapes](#plotOptions.tilemap.tileShape) the grid
  552. * coordinates are offset.
  553. *
  554. * @sample maps/series/tilemap-gridoffset
  555. * Offset grid coordinates
  556. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  557. * Arrays of numeric x and y
  558. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  559. * Arrays of datetime x and y
  560. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  561. * Arrays of point.name and y
  562. * @sample {highcharts} highcharts/series/data-array-of-objects/
  563. * Config objects
  564. *
  565. * @type {Array<Array<(number|string),number>|Array<(number|string),number,number>|*>}
  566. * @extends series.heatmap.data
  567. * @excluding marker
  568. * @product highcharts highmaps
  569. * @apioption series.tilemap.data
  570. */
  571. /**
  572. * The color of the point. In tilemaps the point color is rarely set
  573. * explicitly, as we use the color to denote the `value`. Options for
  574. * this are set in the [colorAxis](#colorAxis) configuration.
  575. *
  576. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  577. * @product highcharts highmaps
  578. * @apioption series.tilemap.data.color
  579. */
  580. /**
  581. * The x coordinate of the point.
  582. *
  583. * Note that for some [tileShapes](#plotOptions.tilemap.tileShape) the grid
  584. * coordinates are offset.
  585. *
  586. * @sample maps/series/tilemap-gridoffset
  587. * Offset grid coordinates
  588. *
  589. * @type {number}
  590. * @product highcharts highmaps
  591. * @apioption series.tilemap.data.x
  592. */
  593. /**
  594. * The y coordinate of the point.
  595. *
  596. * Note that for some [tileShapes](#plotOptions.tilemap.tileShape) the grid
  597. * coordinates are offset.
  598. *
  599. * @sample maps/series/tilemap-gridoffset
  600. * Offset grid coordinates
  601. *
  602. * @type {number}
  603. * @product highcharts highmaps
  604. * @apioption series.tilemap.data.y
  605. */
  606. ''; // adds doclets above to the transpiled file
  607. });
  608. _registerModule(_modules, 'masters/modules/tilemap.src.js', [], function () {
  609. });
  610. }));