TilemapSeries.js 24 KB

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