tilemap.src.js 31 KB

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