heatmap.src.js 108 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551
  1. /**
  2. * @license Highmaps JS v9.1.1 (2021-06-04)
  3. *
  4. * (c) 2009-2021 Torstein Honsi
  5. *
  6. * License: www.highcharts.com/license
  7. */
  8. 'use strict';
  9. (function (factory) {
  10. if (typeof module === 'object' && module.exports) {
  11. factory['default'] = factory;
  12. module.exports = factory;
  13. } else if (typeof define === 'function' && define.amd) {
  14. define('highcharts/modules/heatmap', ['highcharts'], function (Highcharts) {
  15. factory(Highcharts);
  16. factory.Highcharts = Highcharts;
  17. return factory;
  18. });
  19. } else {
  20. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  21. }
  22. }(function (Highcharts) {
  23. var _modules = Highcharts ? Highcharts._modules : {};
  24. function _registerModule(obj, path, args, fn) {
  25. if (!obj.hasOwnProperty(path)) {
  26. obj[path] = fn.apply(null, args);
  27. }
  28. }
  29. _registerModule(_modules, 'Mixins/ColorSeries.js', [], function () {
  30. /* *
  31. *
  32. * (c) 2010-2021 Torstein Honsi
  33. *
  34. * License: www.highcharts.com/license
  35. *
  36. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  37. *
  38. * */
  39. /**
  40. * Mixin for maps and heatmaps
  41. *
  42. * @private
  43. * @mixin Highcharts.colorPointMixin
  44. */
  45. var colorPointMixin = {
  46. /* eslint-disable valid-jsdoc */
  47. /**
  48. * Set the visibility of a single point
  49. * @private
  50. * @function Highcharts.colorPointMixin.setVisible
  51. * @param {boolean} visible
  52. * @return {void}
  53. */
  54. setVisible: function (vis) {
  55. var point = this,
  56. method = vis ? 'show' : 'hide';
  57. point.visible = point.options.visible = Boolean(vis);
  58. // Show and hide associated elements
  59. ['graphic', 'dataLabel'].forEach(function (key) {
  60. if (point[key]) {
  61. point[key][method]();
  62. }
  63. });
  64. this.series.buildKDTree(); // rebuild kdtree #13195
  65. }
  66. /* eslint-enable valid-jsdoc */
  67. };
  68. /**
  69. * @private
  70. * @mixin Highcharts.colorSeriesMixin
  71. */
  72. var colorSeriesMixin = {
  73. optionalAxis: 'colorAxis',
  74. colorAxis: 0,
  75. /* eslint-disable valid-jsdoc */
  76. /**
  77. * In choropleth maps,
  78. the color is a result of the value,
  79. so this needs
  80. * translation too
  81. * @private
  82. * @function Highcharts.colorSeriesMixin.translateColors
  83. * @return {void}
  84. */
  85. translateColors: function () {
  86. var series = this,
  87. points = this.data.length ? this.data : this.points,
  88. nullColor = this.options.nullColor,
  89. colorAxis = this.colorAxis,
  90. colorKey = this.colorKey;
  91. points.forEach(function (point) {
  92. var value = point.getNestedProperty(colorKey),
  93. color;
  94. color = point.options.color ||
  95. (point.isNull || point.value === null ?
  96. nullColor :
  97. (colorAxis && typeof value !== 'undefined') ?
  98. colorAxis.toColor(value, point) :
  99. point.color || series.color);
  100. if (color && point.color !== color) {
  101. point.color = color;
  102. if (series.options.legendType === 'point' && point.legendItem) {
  103. series.chart.legend.colorizeItem(point, point.visible);
  104. }
  105. }
  106. });
  107. }
  108. /* eslint-enable valid-jsdoc */
  109. };
  110. var exports = {
  111. colorPointMixin: colorPointMixin,
  112. colorSeriesMixin: colorSeriesMixin
  113. };
  114. return exports;
  115. });
  116. _registerModule(_modules, 'Core/Axis/ColorAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Color/Color.js'], _modules['Mixins/ColorSeries.js'], _modules['Core/Animation/Fx.js'], _modules['Core/Globals.js'], _modules['Core/Legend.js'], _modules['Mixins/LegendSymbol.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Point.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (Axis, Chart, Color, ColorSeriesModule, Fx, H, Legend, LegendSymbolMixin, palette, Point, Series, U) {
  117. /* *
  118. *
  119. * (c) 2010-2021 Torstein Honsi
  120. *
  121. * License: www.highcharts.com/license
  122. *
  123. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  124. *
  125. * */
  126. var __extends = (this && this.__extends) || (function () {
  127. var extendStatics = function (d,
  128. b) {
  129. extendStatics = Object.setPrototypeOf ||
  130. ({ __proto__: [] } instanceof Array && function (d,
  131. b) { d.__proto__ = b; }) ||
  132. function (d,
  133. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  134. return extendStatics(d, b);
  135. };
  136. return function (d, b) {
  137. extendStatics(d, b);
  138. function __() { this.constructor = d; }
  139. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  140. };
  141. })();
  142. var color = Color.parse;
  143. var colorPointMixin = ColorSeriesModule.colorPointMixin,
  144. colorSeriesMixin = ColorSeriesModule.colorSeriesMixin;
  145. var noop = H.noop;
  146. var addEvent = U.addEvent,
  147. erase = U.erase,
  148. extend = U.extend,
  149. isNumber = U.isNumber,
  150. merge = U.merge,
  151. pick = U.pick,
  152. splat = U.splat;
  153. /**
  154. * Color axis types
  155. *
  156. * @typedef {"linear"|"logarithmic"} Highcharts.ColorAxisTypeValue
  157. */
  158. ''; // detach doclet above
  159. extend(Series.prototype, colorSeriesMixin);
  160. extend(Point.prototype, colorPointMixin);
  161. Chart.prototype.collectionsWithUpdate.push('colorAxis');
  162. Chart.prototype.collectionsWithInit.colorAxis = [Chart.prototype.addColorAxis];
  163. /* eslint-disable no-invalid-this, valid-jsdoc */
  164. /**
  165. * The ColorAxis object for inclusion in gradient legends.
  166. *
  167. * @class
  168. * @name Highcharts.ColorAxis
  169. * @augments Highcharts.Axis
  170. *
  171. * @param {Highcharts.Chart} chart
  172. * The related chart of the color axis.
  173. *
  174. * @param {Highcharts.ColorAxisOptions} userOptions
  175. * The color axis options for initialization.
  176. */
  177. var ColorAxis = /** @class */ (function (_super) {
  178. __extends(ColorAxis, _super);
  179. /* *
  180. *
  181. * Constructors
  182. *
  183. * */
  184. /**
  185. * @private
  186. */
  187. function ColorAxis(chart, userOptions) {
  188. var _this = _super.call(this,
  189. chart,
  190. userOptions) || this;
  191. _this.beforePadding = false; // Prevents unnecessary padding with `hc-more`
  192. _this.chart = void 0;
  193. _this.coll = 'colorAxis';
  194. _this.dataClasses = void 0;
  195. _this.legendItem = void 0;
  196. _this.legendItems = void 0;
  197. _this.name = ''; // Prevents 'undefined' in legend in IE8
  198. _this.options = void 0;
  199. _this.stops = void 0;
  200. _this.visible = true;
  201. _this.init(chart, userOptions);
  202. return _this;
  203. }
  204. /* *
  205. *
  206. * Functions
  207. *
  208. * */
  209. /**
  210. * Initializes the color axis.
  211. *
  212. * @function Highcharts.ColorAxis#init
  213. *
  214. * @param {Highcharts.Chart} chart
  215. * The related chart of the color axis.
  216. *
  217. * @param {Highcharts.ColorAxisOptions} userOptions
  218. * The color axis options for initialization.
  219. */
  220. ColorAxis.prototype.init = function (chart, userOptions) {
  221. var axis = this;
  222. var legend = chart.options.legend || {},
  223. horiz = userOptions.layout ?
  224. userOptions.layout !== 'vertical' :
  225. legend.layout !== 'vertical';
  226. var options = merge(ColorAxis.defaultColorAxisOptions,
  227. userOptions, {
  228. showEmpty: false,
  229. title: null,
  230. visible: legend.enabled &&
  231. (userOptions ? userOptions.visible !== false : true)
  232. });
  233. axis.coll = 'colorAxis';
  234. axis.side = userOptions.side || horiz ? 2 : 1;
  235. axis.reversed = userOptions.reversed || !horiz;
  236. axis.opposite = !horiz;
  237. _super.prototype.init.call(this, chart, options);
  238. // Base init() pushes it to the xAxis array, now pop it again
  239. // chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
  240. // Prepare data classes
  241. if (userOptions.dataClasses) {
  242. axis.initDataClasses(userOptions);
  243. }
  244. axis.initStops();
  245. // Override original axis properties
  246. axis.horiz = horiz;
  247. axis.zoomEnabled = false;
  248. };
  249. /**
  250. * @private
  251. */
  252. ColorAxis.prototype.initDataClasses = function (userOptions) {
  253. var axis = this;
  254. var chart = axis.chart,
  255. dataClasses,
  256. colorCounter = 0,
  257. colorCount = chart.options.chart.colorCount,
  258. options = axis.options,
  259. len = userOptions.dataClasses.length;
  260. axis.dataClasses = dataClasses = [];
  261. axis.legendItems = [];
  262. userOptions.dataClasses.forEach(function (dataClass, i) {
  263. var colors;
  264. dataClass = merge(dataClass);
  265. dataClasses.push(dataClass);
  266. if (!chart.styledMode && dataClass.color) {
  267. return;
  268. }
  269. if (options.dataClassColor === 'category') {
  270. if (!chart.styledMode) {
  271. colors = chart.options.colors;
  272. colorCount = colors.length;
  273. dataClass.color = colors[colorCounter];
  274. }
  275. dataClass.colorIndex = colorCounter;
  276. // increase and loop back to zero
  277. colorCounter++;
  278. if (colorCounter === colorCount) {
  279. colorCounter = 0;
  280. }
  281. }
  282. else {
  283. dataClass.color = color(options.minColor).tweenTo(color(options.maxColor), len < 2 ? 0.5 : i / (len - 1) // #3219
  284. );
  285. }
  286. });
  287. };
  288. /**
  289. * Returns true if the series has points at all.
  290. *
  291. * @function Highcharts.ColorAxis#hasData
  292. *
  293. * @return {boolean}
  294. * True, if the series has points, otherwise false.
  295. */
  296. ColorAxis.prototype.hasData = function () {
  297. return !!(this.tickPositions || []).length;
  298. };
  299. /**
  300. * Override so that ticks are not added in data class axes (#6914)
  301. * @private
  302. */
  303. ColorAxis.prototype.setTickPositions = function () {
  304. if (!this.dataClasses) {
  305. return _super.prototype.setTickPositions.call(this);
  306. }
  307. };
  308. /**
  309. * @private
  310. */
  311. ColorAxis.prototype.initStops = function () {
  312. var axis = this;
  313. axis.stops = axis.options.stops || [
  314. [0, axis.options.minColor],
  315. [1, axis.options.maxColor]
  316. ];
  317. axis.stops.forEach(function (stop) {
  318. stop.color = color(stop[1]);
  319. });
  320. };
  321. /**
  322. * Extend the setOptions method to process extreme colors and color stops.
  323. * @private
  324. */
  325. ColorAxis.prototype.setOptions = function (userOptions) {
  326. var axis = this;
  327. _super.prototype.setOptions.call(this, userOptions);
  328. axis.options.crosshair = axis.options.marker;
  329. };
  330. /**
  331. * @private
  332. */
  333. ColorAxis.prototype.setAxisSize = function () {
  334. var axis = this;
  335. var symbol = axis.legendSymbol;
  336. var chart = axis.chart;
  337. var legendOptions = chart.options.legend || {};
  338. var x,
  339. y,
  340. width,
  341. height;
  342. if (symbol) {
  343. this.left = x = symbol.attr('x');
  344. this.top = y = symbol.attr('y');
  345. this.width = width = symbol.attr('width');
  346. this.height = height = symbol.attr('height');
  347. this.right = chart.chartWidth - x - width;
  348. this.bottom = chart.chartHeight - y - height;
  349. this.len = this.horiz ? width : height;
  350. this.pos = this.horiz ? x : y;
  351. }
  352. else {
  353. // Fake length for disabled legend to avoid tick issues
  354. // and such (#5205)
  355. this.len = (this.horiz ?
  356. legendOptions.symbolWidth :
  357. legendOptions.symbolHeight) || ColorAxis.defaultLegendLength;
  358. }
  359. };
  360. /**
  361. * @private
  362. */
  363. ColorAxis.prototype.normalizedValue = function (value) {
  364. var axis = this;
  365. if (axis.logarithmic) {
  366. value = axis.logarithmic.log2lin(value);
  367. }
  368. return 1 - ((axis.max - value) /
  369. ((axis.max - axis.min) || 1));
  370. };
  371. /**
  372. * Translate from a value to a color.
  373. * @private
  374. */
  375. ColorAxis.prototype.toColor = function (value, point) {
  376. var axis = this;
  377. var dataClasses = axis.dataClasses;
  378. var stops = axis.stops;
  379. var pos,
  380. from,
  381. to,
  382. color,
  383. dataClass,
  384. i;
  385. if (dataClasses) {
  386. i = dataClasses.length;
  387. while (i--) {
  388. dataClass = dataClasses[i];
  389. from = dataClass.from;
  390. to = dataClass.to;
  391. if ((typeof from === 'undefined' || value >= from) &&
  392. (typeof to === 'undefined' || value <= to)) {
  393. color = dataClass.color;
  394. if (point) {
  395. point.dataClass = i;
  396. point.colorIndex = dataClass.colorIndex;
  397. }
  398. break;
  399. }
  400. }
  401. }
  402. else {
  403. pos = axis.normalizedValue(value);
  404. i = stops.length;
  405. while (i--) {
  406. if (pos > stops[i][0]) {
  407. break;
  408. }
  409. }
  410. from = stops[i] || stops[i + 1];
  411. to = stops[i + 1] || from;
  412. // The position within the gradient
  413. pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
  414. color = from.color.tweenTo(to.color, pos);
  415. }
  416. return color;
  417. };
  418. /**
  419. * Override the getOffset method to add the whole axis groups inside the
  420. * legend.
  421. * @private
  422. */
  423. ColorAxis.prototype.getOffset = function () {
  424. var axis = this;
  425. var group = axis.legendGroup;
  426. var sideOffset = axis.chart.axisOffset[axis.side];
  427. if (group) {
  428. // Hook for the getOffset method to add groups to this parent
  429. // group
  430. axis.axisParent = group;
  431. // Call the base
  432. _super.prototype.getOffset.call(this);
  433. // First time only
  434. if (!axis.added) {
  435. axis.added = true;
  436. axis.labelLeft = 0;
  437. axis.labelRight = axis.width;
  438. }
  439. // Reset it to avoid color axis reserving space
  440. axis.chart.axisOffset[axis.side] = sideOffset;
  441. }
  442. };
  443. /**
  444. * Create the color gradient.
  445. * @private
  446. */
  447. ColorAxis.prototype.setLegendColor = function () {
  448. var axis = this;
  449. var horiz = axis.horiz;
  450. var reversed = axis.reversed;
  451. var one = reversed ? 1 : 0;
  452. var zero = reversed ? 0 : 1;
  453. var grad = horiz ? [one, 0,
  454. zero, 0] : [0,
  455. zero, 0,
  456. one]; // #3190
  457. axis.legendColor = {
  458. linearGradient: {
  459. x1: grad[0],
  460. y1: grad[1],
  461. x2: grad[2],
  462. y2: grad[3]
  463. },
  464. stops: axis.stops
  465. };
  466. };
  467. /**
  468. * The color axis appears inside the legend and has its own legend symbol.
  469. * @private
  470. */
  471. ColorAxis.prototype.drawLegendSymbol = function (legend, item) {
  472. var axis = this;
  473. var padding = legend.padding;
  474. var legendOptions = legend.options;
  475. var horiz = axis.horiz;
  476. var width = pick(legendOptions.symbolWidth,
  477. horiz ? ColorAxis.defaultLegendLength : 12);
  478. var height = pick(legendOptions.symbolHeight,
  479. horiz ? 12 : ColorAxis.defaultLegendLength);
  480. var labelPadding = pick(legendOptions.labelPadding,
  481. horiz ? 16 : 30);
  482. var itemDistance = pick(legendOptions.itemDistance, 10);
  483. this.setLegendColor();
  484. // Create the gradient
  485. item.legendSymbol = this.chart.renderer.rect(0, legend.baseline - 11, width, height).attr({
  486. zIndex: 1
  487. }).add(item.legendGroup);
  488. // Set how much space this legend item takes up
  489. axis.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
  490. axis.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
  491. };
  492. /**
  493. * Fool the legend.
  494. * @private
  495. */
  496. ColorAxis.prototype.setState = function (state) {
  497. this.series.forEach(function (series) {
  498. series.setState(state);
  499. });
  500. };
  501. /**
  502. * @private
  503. */
  504. ColorAxis.prototype.setVisible = function () {
  505. };
  506. /**
  507. * @private
  508. */
  509. ColorAxis.prototype.getSeriesExtremes = function () {
  510. var axis = this;
  511. var series = axis.series;
  512. var colorValArray,
  513. colorKey,
  514. colorValIndex,
  515. pointArrayMap,
  516. calculatedExtremes,
  517. cSeries,
  518. i = series.length,
  519. yData,
  520. j;
  521. this.dataMin = Infinity;
  522. this.dataMax = -Infinity;
  523. while (i--) { // x, y, value, other
  524. cSeries = series[i];
  525. colorKey = cSeries.colorKey = pick(cSeries.options.colorKey, cSeries.colorKey, cSeries.pointValKey, cSeries.zoneAxis, 'y');
  526. pointArrayMap = cSeries.pointArrayMap;
  527. calculatedExtremes = cSeries[colorKey + 'Min'] &&
  528. cSeries[colorKey + 'Max'];
  529. if (cSeries[colorKey + 'Data']) {
  530. colorValArray = cSeries[colorKey + 'Data'];
  531. }
  532. else {
  533. if (!pointArrayMap) {
  534. colorValArray = cSeries.yData;
  535. }
  536. else {
  537. colorValArray = [];
  538. colorValIndex = pointArrayMap.indexOf(colorKey);
  539. yData = cSeries.yData;
  540. if (colorValIndex >= 0 && yData) {
  541. for (j = 0; j < yData.length; j++) {
  542. colorValArray.push(pick(yData[j][colorValIndex], yData[j]));
  543. }
  544. }
  545. }
  546. }
  547. // If color key extremes are already calculated, use them.
  548. if (calculatedExtremes) {
  549. cSeries.minColorValue = cSeries[colorKey + 'Min'];
  550. cSeries.maxColorValue = cSeries[colorKey + 'Max'];
  551. }
  552. else {
  553. var cExtremes = Series.prototype.getExtremes.call(cSeries,
  554. colorValArray);
  555. cSeries.minColorValue = cExtremes.dataMin;
  556. cSeries.maxColorValue = cExtremes.dataMax;
  557. }
  558. if (typeof cSeries.minColorValue !== 'undefined') {
  559. this.dataMin =
  560. Math.min(this.dataMin, cSeries.minColorValue);
  561. this.dataMax =
  562. Math.max(this.dataMax, cSeries.maxColorValue);
  563. }
  564. if (!calculatedExtremes) {
  565. Series.prototype.applyExtremes.call(cSeries);
  566. }
  567. }
  568. };
  569. /**
  570. * Internal function to draw a crosshair.
  571. *
  572. * @function Highcharts.ColorAxis#drawCrosshair
  573. *
  574. * @param {Highcharts.PointerEventObject} [e]
  575. * The event arguments from the modified pointer event, extended with
  576. * `chartX` and `chartY`
  577. *
  578. * @param {Highcharts.Point} [point]
  579. * The Point object if the crosshair snaps to points.
  580. *
  581. * @fires Highcharts.ColorAxis#event:afterDrawCrosshair
  582. * @fires Highcharts.ColorAxis#event:drawCrosshair
  583. */
  584. ColorAxis.prototype.drawCrosshair = function (e, point) {
  585. var axis = this;
  586. var plotX = point && point.plotX;
  587. var plotY = point && point.plotY;
  588. var axisPos = axis.pos;
  589. var axisLen = axis.len;
  590. var crossPos;
  591. if (point) {
  592. crossPos = axis.toPixels(point.getNestedProperty(point.series.colorKey));
  593. if (crossPos < axisPos) {
  594. crossPos = axisPos - 2;
  595. }
  596. else if (crossPos > axisPos + axisLen) {
  597. crossPos = axisPos + axisLen + 2;
  598. }
  599. point.plotX = crossPos;
  600. point.plotY = axis.len - crossPos;
  601. _super.prototype.drawCrosshair.call(this, e, point);
  602. point.plotX = plotX;
  603. point.plotY = plotY;
  604. if (axis.cross &&
  605. !axis.cross.addedToColorAxis &&
  606. axis.legendGroup) {
  607. axis.cross
  608. .addClass('highcharts-coloraxis-marker')
  609. .add(axis.legendGroup);
  610. axis.cross.addedToColorAxis = true;
  611. if (!axis.chart.styledMode &&
  612. typeof axis.crosshair === 'object') {
  613. axis.cross.attr({
  614. fill: axis.crosshair.color
  615. });
  616. }
  617. }
  618. }
  619. };
  620. /**
  621. * @private
  622. */
  623. ColorAxis.prototype.getPlotLinePath = function (options) {
  624. var axis = this,
  625. left = axis.left,
  626. pos = options.translatedValue,
  627. top = axis.top;
  628. // crosshairs only
  629. return isNumber(pos) ? // pos can be 0 (#3969)
  630. (axis.horiz ? [
  631. ['M', pos - 4, top - 6],
  632. ['L', pos + 4, top - 6],
  633. ['L', pos, top],
  634. ['Z']
  635. ] : [
  636. ['M', left, pos],
  637. ['L', left - 6, pos + 6],
  638. ['L', left - 6, pos - 6],
  639. ['Z']
  640. ]) :
  641. _super.prototype.getPlotLinePath.call(this, options);
  642. };
  643. /**
  644. * Updates a color axis instance with a new set of options. The options are
  645. * merged with the existing options, so only new or altered options need to
  646. * be specified.
  647. *
  648. * @function Highcharts.ColorAxis#update
  649. *
  650. * @param {Highcharts.ColorAxisOptions} newOptions
  651. * The new options that will be merged in with existing options on the color
  652. * axis.
  653. *
  654. * @param {boolean} [redraw]
  655. * Whether to redraw the chart after the color axis is altered. If doing
  656. * more operations on the chart, it is a good idea to set redraw to `false`
  657. * and call {@link Highcharts.Chart#redraw} after.
  658. */
  659. ColorAxis.prototype.update = function (newOptions, redraw) {
  660. var axis = this,
  661. chart = axis.chart,
  662. legend = chart.legend;
  663. this.series.forEach(function (series) {
  664. // Needed for Axis.update when choropleth colors change
  665. series.isDirtyData = true;
  666. });
  667. // When updating data classes, destroy old items and make sure new
  668. // ones are created (#3207)
  669. if (newOptions.dataClasses && legend.allItems || axis.dataClasses) {
  670. axis.destroyItems();
  671. }
  672. _super.prototype.update.call(this, newOptions, redraw);
  673. if (axis.legendItem) {
  674. axis.setLegendColor();
  675. legend.colorizeItem(this, true);
  676. }
  677. };
  678. /**
  679. * Destroy color axis legend items.
  680. * @private
  681. */
  682. ColorAxis.prototype.destroyItems = function () {
  683. var axis = this;
  684. var chart = axis.chart;
  685. if (axis.legendItem) {
  686. chart.legend.destroyItem(axis);
  687. }
  688. else if (axis.legendItems) {
  689. axis.legendItems.forEach(function (item) {
  690. chart.legend.destroyItem(item);
  691. });
  692. }
  693. chart.isDirtyLegend = true;
  694. };
  695. // Removing the whole axis (#14283)
  696. ColorAxis.prototype.destroy = function () {
  697. this.chart.isDirtyLegend = true;
  698. this.destroyItems();
  699. _super.prototype.destroy.apply(this, [].slice.call(arguments));
  700. };
  701. /**
  702. * Removes the color axis and the related legend item.
  703. *
  704. * @function Highcharts.ColorAxis#remove
  705. *
  706. * @param {boolean} [redraw=true]
  707. * Whether to redraw the chart following the remove.
  708. */
  709. ColorAxis.prototype.remove = function (redraw) {
  710. this.destroyItems();
  711. _super.prototype.remove.call(this, redraw);
  712. };
  713. /**
  714. * Get the legend item symbols for data classes.
  715. * @private
  716. */
  717. ColorAxis.prototype.getDataClassLegendSymbols = function () {
  718. var axis = this;
  719. var chart = axis.chart;
  720. var legendItems = axis.legendItems;
  721. var legendOptions = chart.options.legend;
  722. var valueDecimals = legendOptions.valueDecimals;
  723. var valueSuffix = legendOptions.valueSuffix || '';
  724. var name;
  725. if (!legendItems.length) {
  726. axis.dataClasses.forEach(function (dataClass, i) {
  727. var vis = true,
  728. from = dataClass.from,
  729. to = dataClass.to;
  730. var numberFormatter = chart.numberFormatter;
  731. // Assemble the default name. This can be overridden
  732. // by legend.options.labelFormatter
  733. name = '';
  734. if (typeof from === 'undefined') {
  735. name = '< ';
  736. }
  737. else if (typeof to === 'undefined') {
  738. name = '> ';
  739. }
  740. if (typeof from !== 'undefined') {
  741. name += numberFormatter(from, valueDecimals) + valueSuffix;
  742. }
  743. if (typeof from !== 'undefined' && typeof to !== 'undefined') {
  744. name += ' - ';
  745. }
  746. if (typeof to !== 'undefined') {
  747. name += numberFormatter(to, valueDecimals) + valueSuffix;
  748. }
  749. // Add a mock object to the legend items
  750. legendItems.push(extend({
  751. chart: chart,
  752. name: name,
  753. options: {},
  754. drawLegendSymbol: LegendSymbolMixin.drawRectangle,
  755. visible: true,
  756. setState: noop,
  757. isDataClass: true,
  758. setVisible: function () {
  759. vis = axis.visible = !vis;
  760. axis.series.forEach(function (series) {
  761. series.points.forEach(function (point) {
  762. if (point.dataClass === i) {
  763. point.setVisible(vis);
  764. }
  765. });
  766. });
  767. chart.legend.colorizeItem(this, vis);
  768. }
  769. }, dataClass));
  770. });
  771. }
  772. return legendItems;
  773. };
  774. /* *
  775. *
  776. * Static Functions
  777. *
  778. * */
  779. ColorAxis.defaultLegendLength = 200;
  780. /**
  781. * A color axis for series. Visually, the color
  782. * axis will appear as a gradient or as separate items inside the
  783. * legend, depending on whether the axis is scalar or based on data
  784. * classes.
  785. *
  786. * For supported color formats, see the
  787. * [docs article about colors](https://www.highcharts.com/docs/chart-design-and-style/colors).
  788. *
  789. * A scalar color axis is represented by a gradient. The colors either
  790. * range between the [minColor](#colorAxis.minColor) and the
  791. * [maxColor](#colorAxis.maxColor), or for more fine grained control the
  792. * colors can be defined in [stops](#colorAxis.stops). Often times, the
  793. * color axis needs to be adjusted to get the right color spread for the
  794. * data. In addition to stops, consider using a logarithmic
  795. * [axis type](#colorAxis.type), or setting [min](#colorAxis.min) and
  796. * [max](#colorAxis.max) to avoid the colors being determined by
  797. * outliers.
  798. *
  799. * When [dataClasses](#colorAxis.dataClasses) are used, the ranges are
  800. * subdivided into separate classes like categories based on their
  801. * values. This can be used for ranges between two values, but also for
  802. * a true category. However, when your data is categorized, it may be as
  803. * convenient to add each category to a separate series.
  804. *
  805. * Color axis does not work with: `sankey`, `sunburst`, `dependencywheel`,
  806. * `networkgraph`, `wordcloud`, `venn`, `gauge` and `solidgauge` series
  807. * types.
  808. *
  809. * Since v7.2.0 `colorAxis` can also be an array of options objects.
  810. *
  811. * See [the Axis object](/class-reference/Highcharts.Axis) for
  812. * programmatic access to the axis.
  813. *
  814. * @sample {highcharts} highcharts/coloraxis/custom-color-key
  815. * Column chart with color axis
  816. * @sample {highcharts} highcharts/coloraxis/horizontal-layout
  817. * Horizontal layout
  818. * @sample {highmaps} maps/coloraxis/dataclasscolor
  819. * With data classes
  820. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor
  821. * Min color and max color
  822. *
  823. * @extends xAxis
  824. * @excluding alignTicks, allowDecimals, alternateGridColor, breaks,
  825. * categories, crosshair, dateTimeLabelFormats, height, left,
  826. * lineWidth, linkedTo, maxZoom, minRange, minTickInterval,
  827. * offset, opposite, pane, plotBands, plotLines,
  828. * reversedStacks, showEmpty, title, top, width, zoomEnabled
  829. * @product highcharts highstock highmaps
  830. * @type {*|Array<*>}
  831. * @optionparent colorAxis
  832. * @ignore
  833. */
  834. ColorAxis.defaultColorAxisOptions = {
  835. /**
  836. * Whether to allow decimals on the color axis.
  837. * @type {boolean}
  838. * @default true
  839. * @product highcharts highstock highmaps
  840. * @apioption colorAxis.allowDecimals
  841. */
  842. /**
  843. * Determines how to set each data class' color if no individual
  844. * color is set. The default value, `tween`, computes intermediate
  845. * colors between `minColor` and `maxColor`. The other possible
  846. * value, `category`, pulls colors from the global or chart specific
  847. * [colors](#colors) array.
  848. *
  849. * @sample {highmaps} maps/coloraxis/dataclasscolor/
  850. * Category colors
  851. *
  852. * @type {string}
  853. * @default tween
  854. * @product highcharts highstock highmaps
  855. * @validvalue ["tween", "category"]
  856. * @apioption colorAxis.dataClassColor
  857. */
  858. /**
  859. * An array of data classes or ranges for the choropleth map. If
  860. * none given, the color axis is scalar and values are distributed
  861. * as a gradient between the minimum and maximum colors.
  862. *
  863. * @sample {highmaps} maps/demo/data-class-ranges/
  864. * Multiple ranges
  865. *
  866. * @sample {highmaps} maps/demo/data-class-two-ranges/
  867. * Two ranges
  868. *
  869. * @type {Array<*>}
  870. * @product highcharts highstock highmaps
  871. * @apioption colorAxis.dataClasses
  872. */
  873. /**
  874. * The layout of the color axis. Can be `'horizontal'` or `'vertical'`.
  875. * If none given, the color axis has the same layout as the legend.
  876. *
  877. * @sample highcharts/coloraxis/horizontal-layout/
  878. * Horizontal color axis layout with vertical legend
  879. *
  880. * @type {string|undefined}
  881. * @since 7.2.0
  882. * @product highcharts highstock highmaps
  883. * @apioption colorAxis.layout
  884. */
  885. /**
  886. * The color of each data class. If not set, the color is pulled
  887. * from the global or chart-specific [colors](#colors) array. In
  888. * styled mode, this option is ignored. Instead, use colors defined
  889. * in CSS.
  890. *
  891. * @sample {highmaps} maps/demo/data-class-two-ranges/
  892. * Explicit colors
  893. *
  894. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  895. * @product highcharts highstock highmaps
  896. * @apioption colorAxis.dataClasses.color
  897. */
  898. /**
  899. * The start of the value range that the data class represents,
  900. * relating to the point value.
  901. *
  902. * The range of each `dataClass` is closed in both ends, but can be
  903. * overridden by the next `dataClass`.
  904. *
  905. * @type {number}
  906. * @product highcharts highstock highmaps
  907. * @apioption colorAxis.dataClasses.from
  908. */
  909. /**
  910. * The name of the data class as it appears in the legend.
  911. * If no name is given, it is automatically created based on the
  912. * `from` and `to` values. For full programmatic control,
  913. * [legend.labelFormatter](#legend.labelFormatter) can be used.
  914. * In the formatter, `this.from` and `this.to` can be accessed.
  915. *
  916. * @sample {highmaps} maps/coloraxis/dataclasses-name/
  917. * Named data classes
  918. *
  919. * @sample {highmaps} maps/coloraxis/dataclasses-labelformatter/
  920. * Formatted data classes
  921. *
  922. * @type {string}
  923. * @product highcharts highstock highmaps
  924. * @apioption colorAxis.dataClasses.name
  925. */
  926. /**
  927. * The end of the value range that the data class represents,
  928. * relating to the point value.
  929. *
  930. * The range of each `dataClass` is closed in both ends, but can be
  931. * overridden by the next `dataClass`.
  932. *
  933. * @type {number}
  934. * @product highcharts highstock highmaps
  935. * @apioption colorAxis.dataClasses.to
  936. */
  937. /** @ignore-option */
  938. lineWidth: 0,
  939. /**
  940. * Padding of the min value relative to the length of the axis. A
  941. * padding of 0.05 will make a 100px axis 5px longer.
  942. *
  943. * @product highcharts highstock highmaps
  944. */
  945. minPadding: 0,
  946. /**
  947. * The maximum value of the axis in terms of map point values. If
  948. * `null`, the max value is automatically calculated. If the
  949. * `endOnTick` option is true, the max value might be rounded up.
  950. *
  951. * @sample {highmaps} maps/coloraxis/gridlines/
  952. * Explicit min and max to reduce the effect of outliers
  953. *
  954. * @type {number}
  955. * @product highcharts highstock highmaps
  956. * @apioption colorAxis.max
  957. */
  958. /**
  959. * The minimum value of the axis in terms of map point values. If
  960. * `null`, the min value is automatically calculated. If the
  961. * `startOnTick` option is true, the min value might be rounded
  962. * down.
  963. *
  964. * @sample {highmaps} maps/coloraxis/gridlines/
  965. * Explicit min and max to reduce the effect of outliers
  966. *
  967. * @type {number}
  968. * @product highcharts highstock highmaps
  969. * @apioption colorAxis.min
  970. */
  971. /**
  972. * Padding of the max value relative to the length of the axis. A
  973. * padding of 0.05 will make a 100px axis 5px longer.
  974. *
  975. * @product highcharts highstock highmaps
  976. */
  977. maxPadding: 0,
  978. /**
  979. * Color of the grid lines extending from the axis across the
  980. * gradient.
  981. *
  982. * @sample {highmaps} maps/coloraxis/gridlines/
  983. * Grid lines demonstrated
  984. *
  985. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  986. * @default #e6e6e6
  987. * @product highcharts highstock highmaps
  988. * @apioption colorAxis.gridLineColor
  989. */
  990. /**
  991. * The width of the grid lines extending from the axis across the
  992. * gradient of a scalar color axis.
  993. *
  994. * @sample {highmaps} maps/coloraxis/gridlines/
  995. * Grid lines demonstrated
  996. *
  997. * @product highcharts highstock highmaps
  998. */
  999. gridLineWidth: 1,
  1000. /**
  1001. * The interval of the tick marks in axis units. When `null`, the
  1002. * tick interval is computed to approximately follow the
  1003. * `tickPixelInterval`.
  1004. *
  1005. * @type {number}
  1006. * @product highcharts highstock highmaps
  1007. * @apioption colorAxis.tickInterval
  1008. */
  1009. /**
  1010. * If [tickInterval](#colorAxis.tickInterval) is `null` this option
  1011. * sets the approximate pixel interval of the tick marks.
  1012. *
  1013. * @product highcharts highstock highmaps
  1014. */
  1015. tickPixelInterval: 72,
  1016. /**
  1017. * Whether to force the axis to start on a tick. Use this option
  1018. * with the `maxPadding` option to control the axis start.
  1019. *
  1020. * @product highcharts highstock highmaps
  1021. */
  1022. startOnTick: true,
  1023. /**
  1024. * Whether to force the axis to end on a tick. Use this option with
  1025. * the [maxPadding](#colorAxis.maxPadding) option to control the
  1026. * axis end.
  1027. *
  1028. * @product highcharts highstock highmaps
  1029. */
  1030. endOnTick: true,
  1031. /** @ignore */
  1032. offset: 0,
  1033. /**
  1034. * The triangular marker on a scalar color axis that points to the
  1035. * value of the hovered area. To disable the marker, set
  1036. * `marker: null`.
  1037. *
  1038. * @sample {highmaps} maps/coloraxis/marker/
  1039. * Black marker
  1040. *
  1041. * @declare Highcharts.PointMarkerOptionsObject
  1042. * @product highcharts highstock highmaps
  1043. */
  1044. marker: {
  1045. /**
  1046. * Animation for the marker as it moves between values. Set to
  1047. * `false` to disable animation. Defaults to `{ duration: 50 }`.
  1048. *
  1049. * @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
  1050. * @product highcharts highstock highmaps
  1051. */
  1052. animation: {
  1053. /** @internal */
  1054. duration: 50
  1055. },
  1056. /** @internal */
  1057. width: 0.01,
  1058. /**
  1059. * The color of the marker.
  1060. *
  1061. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  1062. * @product highcharts highstock highmaps
  1063. */
  1064. color: palette.neutralColor40
  1065. },
  1066. /**
  1067. * The axis labels show the number for each tick.
  1068. *
  1069. * For more live examples on label options, see [xAxis.labels in the
  1070. * Highcharts API.](/highcharts#xAxis.labels)
  1071. *
  1072. * @extends xAxis.labels
  1073. * @product highcharts highstock highmaps
  1074. */
  1075. labels: {
  1076. /**
  1077. * How to handle overflowing labels on horizontal color axis. If set
  1078. * to `"allow"`, it will not be aligned at all. By default it
  1079. * `"justify"` labels inside the chart area. If there is room to
  1080. * move it, it will be aligned to the edge, else it will be removed.
  1081. *
  1082. * @validvalue ["allow", "justify"]
  1083. * @product highcharts highstock highmaps
  1084. */
  1085. overflow: 'justify',
  1086. rotation: 0
  1087. },
  1088. /**
  1089. * The color to represent the minimum of the color axis. Unless
  1090. * [dataClasses](#colorAxis.dataClasses) or
  1091. * [stops](#colorAxis.stops) are set, the gradient starts at this
  1092. * value.
  1093. *
  1094. * If dataClasses are set, the color is based on minColor and
  1095. * maxColor unless a color is set for each data class, or the
  1096. * [dataClassColor](#colorAxis.dataClassColor) is set.
  1097. *
  1098. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
  1099. * Min and max colors on scalar (gradient) axis
  1100. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
  1101. * On data classes
  1102. *
  1103. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  1104. * @product highcharts highstock highmaps
  1105. */
  1106. minColor: palette.highlightColor10,
  1107. /**
  1108. * The color to represent the maximum of the color axis. Unless
  1109. * [dataClasses](#colorAxis.dataClasses) or
  1110. * [stops](#colorAxis.stops) are set, the gradient ends at this
  1111. * value.
  1112. *
  1113. * If dataClasses are set, the color is based on minColor and
  1114. * maxColor unless a color is set for each data class, or the
  1115. * [dataClassColor](#colorAxis.dataClassColor) is set.
  1116. *
  1117. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
  1118. * Min and max colors on scalar (gradient) axis
  1119. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
  1120. * On data classes
  1121. *
  1122. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  1123. * @product highcharts highstock highmaps
  1124. */
  1125. maxColor: palette.highlightColor100,
  1126. /**
  1127. * Color stops for the gradient of a scalar color axis. Use this in
  1128. * cases where a linear gradient between a `minColor` and `maxColor`
  1129. * is not sufficient. The stops is an array of tuples, where the
  1130. * first item is a float between 0 and 1 assigning the relative
  1131. * position in the gradient, and the second item is the color.
  1132. *
  1133. * @sample {highmaps} maps/demo/heatmap/
  1134. * Heatmap with three color stops
  1135. *
  1136. * @type {Array<Array<number,Highcharts.ColorString>>}
  1137. * @product highcharts highstock highmaps
  1138. * @apioption colorAxis.stops
  1139. */
  1140. /**
  1141. * The pixel length of the main tick marks on the color axis.
  1142. */
  1143. tickLength: 5,
  1144. /**
  1145. * The type of interpolation to use for the color axis. Can be
  1146. * `linear` or `logarithmic`.
  1147. *
  1148. * @sample highcharts/coloraxis/logarithmic-with-emulate-negative-values/
  1149. * Logarithmic color axis with extension to emulate negative
  1150. * values
  1151. *
  1152. * @type {Highcharts.ColorAxisTypeValue}
  1153. * @default linear
  1154. * @product highcharts highstock highmaps
  1155. * @apioption colorAxis.type
  1156. */
  1157. /**
  1158. * Whether to reverse the axis so that the highest number is closest
  1159. * to the origin. Defaults to `false` in a horizontal legend and
  1160. * `true` in a vertical legend, where the smallest value starts on
  1161. * top.
  1162. *
  1163. * @type {boolean}
  1164. * @product highcharts highstock highmaps
  1165. * @apioption colorAxis.reversed
  1166. */
  1167. /**
  1168. * @product highcharts highstock highmaps
  1169. * @excluding afterBreaks, pointBreak, pointInBreak
  1170. * @apioption colorAxis.events
  1171. */
  1172. /**
  1173. * Fires when the legend item belonging to the colorAxis is clicked.
  1174. * One parameter, `event`, is passed to the function.
  1175. *
  1176. * @type {Function}
  1177. * @product highcharts highstock highmaps
  1178. * @apioption colorAxis.events.legendItemClick
  1179. */
  1180. /**
  1181. * Whether to display the colorAxis in the legend.
  1182. *
  1183. * @sample highcharts/coloraxis/hidden-coloraxis-with-3d-chart/
  1184. * Hidden color axis with 3d chart
  1185. *
  1186. * @see [heatmap.showInLegend](#series.heatmap.showInLegend)
  1187. *
  1188. * @since 4.2.7
  1189. * @product highcharts highstock highmaps
  1190. */
  1191. showInLegend: true
  1192. };
  1193. /**
  1194. * @private
  1195. */
  1196. ColorAxis.keepProps = [
  1197. 'legendGroup',
  1198. 'legendItemHeight',
  1199. 'legendItemWidth',
  1200. 'legendItem',
  1201. 'legendSymbol'
  1202. ];
  1203. return ColorAxis;
  1204. }(Axis));
  1205. // Properties to preserve after destroy, for Axis.update (#5881, #6025).
  1206. Array.prototype.push.apply(Axis.keepProps, ColorAxis.keepProps);
  1207. H.ColorAxis = ColorAxis;
  1208. /**
  1209. * Handle animation of the color attributes directly
  1210. *
  1211. * @private
  1212. * @function Highcharts.Fx#fillSetter
  1213. */ /**
  1214. * Handle animation of the color attributes directly
  1215. *
  1216. * @private
  1217. * @function Highcharts.Fx#strokeSetter
  1218. */
  1219. ['fill', 'stroke'].forEach(function (prop) {
  1220. Fx.prototype[prop + 'Setter'] = function () {
  1221. this.elem.attr(prop, color(this.start).tweenTo(color(this.end), this.pos), null, true);
  1222. };
  1223. });
  1224. // Extend the chart getAxes method to also get the color axis
  1225. addEvent(Chart, 'afterGetAxes', function () {
  1226. var chart = this,
  1227. options = chart.options;
  1228. this.colorAxis = [];
  1229. if (options.colorAxis) {
  1230. options.colorAxis = splat(options.colorAxis);
  1231. options.colorAxis.forEach(function (axisOptions, i) {
  1232. axisOptions.index = i;
  1233. new ColorAxis(chart, axisOptions); // eslint-disable-line no-new
  1234. });
  1235. }
  1236. });
  1237. // Add colorAxis to series axisTypes
  1238. addEvent(Series, 'bindAxes', function () {
  1239. var axisTypes = this.axisTypes;
  1240. if (!axisTypes) {
  1241. this.axisTypes = ['colorAxis'];
  1242. }
  1243. else if (axisTypes.indexOf('colorAxis') === -1) {
  1244. axisTypes.push('colorAxis');
  1245. }
  1246. });
  1247. // Add the color axis. This also removes the axis' own series to prevent
  1248. // them from showing up individually.
  1249. addEvent(Legend, 'afterGetAllItems', function (e) {
  1250. var _this = this;
  1251. var colorAxisItems = [],
  1252. colorAxes = this.chart.colorAxis || [],
  1253. options,
  1254. i;
  1255. var destroyItem = function (item) {
  1256. var i = e.allItems.indexOf(item);
  1257. if (i !== -1) {
  1258. // #15436
  1259. _this.destroyItem(e.allItems[i]);
  1260. e.allItems.splice(i, 1);
  1261. }
  1262. };
  1263. colorAxes.forEach(function (colorAxis) {
  1264. options = colorAxis.options;
  1265. if (options && options.showInLegend) {
  1266. // Data classes
  1267. if (options.dataClasses && options.visible) {
  1268. colorAxisItems = colorAxisItems.concat(colorAxis.getDataClassLegendSymbols());
  1269. // Gradient legend
  1270. }
  1271. else if (options.visible) {
  1272. // Add this axis on top
  1273. colorAxisItems.push(colorAxis);
  1274. }
  1275. // If dataClasses are defined or showInLegend option is not set to
  1276. // true, do not add color axis' series to legend.
  1277. colorAxis.series.forEach(function (series) {
  1278. if (!series.options.showInLegend || options.dataClasses) {
  1279. if (series.options.legendType === 'point') {
  1280. series.points.forEach(function (point) {
  1281. destroyItem(point);
  1282. });
  1283. }
  1284. else {
  1285. destroyItem(series);
  1286. }
  1287. }
  1288. });
  1289. }
  1290. });
  1291. i = colorAxisItems.length;
  1292. while (i--) {
  1293. e.allItems.unshift(colorAxisItems[i]);
  1294. }
  1295. });
  1296. addEvent(Legend, 'afterColorizeItem', function (e) {
  1297. if (e.visible && e.item.legendColor) {
  1298. e.item.legendSymbol.attr({
  1299. fill: e.item.legendColor
  1300. });
  1301. }
  1302. });
  1303. // Updates in the legend need to be reflected in the color axis (6888)
  1304. addEvent(Legend, 'afterUpdate', function () {
  1305. var colorAxes = this.chart.colorAxis;
  1306. if (colorAxes) {
  1307. colorAxes.forEach(function (colorAxis) {
  1308. colorAxis.update({}, arguments[2]);
  1309. });
  1310. }
  1311. });
  1312. // Calculate and set colors for points
  1313. addEvent(Series, 'afterTranslate', function () {
  1314. if (this.chart.colorAxis &&
  1315. this.chart.colorAxis.length ||
  1316. this.colorAttribs) {
  1317. this.translateColors();
  1318. }
  1319. });
  1320. return ColorAxis;
  1321. });
  1322. _registerModule(_modules, 'Mixins/ColorMapSeries.js', [_modules['Core/Globals.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (H, Point, U) {
  1323. /* *
  1324. *
  1325. * (c) 2010-2021 Torstein Honsi
  1326. *
  1327. * License: www.highcharts.com/license
  1328. *
  1329. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  1330. *
  1331. * */
  1332. var defined = U.defined,
  1333. addEvent = U.addEvent;
  1334. var noop = H.noop,
  1335. seriesTypes = H.seriesTypes;
  1336. // Move points to the top of the z-index order when hovered
  1337. addEvent(Point, 'afterSetState', function (e) {
  1338. var point = this; // eslint-disable-line no-invalid-this
  1339. if (point.moveToTopOnHover && point.graphic) {
  1340. point.graphic.attr({
  1341. zIndex: e && e.state === 'hover' ? 1 : 0
  1342. });
  1343. }
  1344. });
  1345. /**
  1346. * Mixin for maps and heatmaps
  1347. *
  1348. * @private
  1349. * @mixin Highcharts.colorMapPointMixin
  1350. */
  1351. var colorMapPointMixin = {
  1352. dataLabelOnNull: true,
  1353. moveToTopOnHover: true,
  1354. /* eslint-disable valid-jsdoc */
  1355. /**
  1356. * Color points have a value option that determines whether or not it is
  1357. * a null point
  1358. * @private
  1359. */
  1360. isValid: function () {
  1361. // undefined is allowed
  1362. return (this.value !== null &&
  1363. this.value !== Infinity &&
  1364. this.value !== -Infinity);
  1365. }
  1366. /* eslint-enable valid-jsdoc */
  1367. };
  1368. /**
  1369. * @private
  1370. * @mixin Highcharts.colorMapSeriesMixin
  1371. */
  1372. var colorMapSeriesMixin = {
  1373. pointArrayMap: ['value'],
  1374. axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
  1375. trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
  1376. getSymbol: noop,
  1377. parallelArrays: ['x', 'y', 'value'],
  1378. colorKey: 'value',
  1379. pointAttribs: seriesTypes.column.prototype.pointAttribs,
  1380. /* eslint-disable valid-jsdoc */
  1381. /**
  1382. * Get the color attibutes to apply on the graphic
  1383. * @private
  1384. * @function Highcharts.colorMapSeriesMixin.colorAttribs
  1385. * @param {Highcharts.Point} point
  1386. * @return {Highcharts.SVGAttributes}
  1387. */
  1388. colorAttribs: function (point) {
  1389. var ret = {};
  1390. if (defined(point.color) &&
  1391. (!point.state || point.state === 'normal') // #15746
  1392. ) {
  1393. ret[this.colorProp || 'fill'] = point.color;
  1394. }
  1395. return ret;
  1396. }
  1397. };
  1398. var exports = {
  1399. colorMapPointMixin: colorMapPointMixin,
  1400. colorMapSeriesMixin: colorMapSeriesMixin
  1401. };
  1402. return exports;
  1403. });
  1404. _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
  1405. /* *
  1406. *
  1407. * (c) 2010-2021 Torstein Honsi
  1408. *
  1409. * License: www.highcharts.com/license
  1410. *
  1411. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  1412. *
  1413. * */
  1414. var __extends = (this && this.__extends) || (function () {
  1415. var extendStatics = function (d,
  1416. b) {
  1417. extendStatics = Object.setPrototypeOf ||
  1418. ({ __proto__: [] } instanceof Array && function (d,
  1419. b) { d.__proto__ = b; }) ||
  1420. function (d,
  1421. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1422. return extendStatics(d, b);
  1423. };
  1424. return function (d, b) {
  1425. extendStatics(d, b);
  1426. function __() { this.constructor = d; }
  1427. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1428. };
  1429. })();
  1430. var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
  1431. var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
  1432. var clamp = U.clamp,
  1433. extend = U.extend,
  1434. pick = U.pick;
  1435. /* *
  1436. *
  1437. * Class
  1438. *
  1439. * */
  1440. var HeatmapPoint = /** @class */ (function (_super) {
  1441. __extends(HeatmapPoint, _super);
  1442. function HeatmapPoint() {
  1443. /* *
  1444. *
  1445. * Properties
  1446. *
  1447. * */
  1448. var _this = _super !== null && _super.apply(this,
  1449. arguments) || this;
  1450. _this.options = void 0;
  1451. _this.series = void 0;
  1452. _this.value = void 0;
  1453. _this.x = void 0;
  1454. _this.y = void 0;
  1455. return _this;
  1456. /* eslint-enable valid-jsdoc */
  1457. }
  1458. /* *
  1459. *
  1460. * Functions
  1461. *
  1462. * */
  1463. /* eslint-disable valid-jsdoc */
  1464. /**
  1465. * @private
  1466. */
  1467. HeatmapPoint.prototype.applyOptions = function (options, x) {
  1468. var point = _super.prototype.applyOptions.call(this,
  1469. options,
  1470. x);
  1471. point.formatPrefix = point.isNull || point.value === null ? 'null' : 'point';
  1472. return point;
  1473. };
  1474. HeatmapPoint.prototype.getCellAttributes = function () {
  1475. var point = this,
  1476. series = point.series,
  1477. seriesOptions = series.options,
  1478. xPad = (seriesOptions.colsize || 1) / 2,
  1479. yPad = (seriesOptions.rowsize || 1) / 2,
  1480. xAxis = series.xAxis,
  1481. yAxis = series.yAxis,
  1482. markerOptions = point.options.marker || series.options.marker,
  1483. pointPlacement = series.pointPlacementToXValue(), // #7860
  1484. pointPadding = pick(point.pointPadding,
  1485. seriesOptions.pointPadding, 0),
  1486. cellAttr = {
  1487. x1: clamp(Math.round(xAxis.len -
  1488. (xAxis.translate(point.x - xPad,
  1489. false,
  1490. true,
  1491. false,
  1492. true, -pointPlacement) || 0)), -xAxis.len, 2 * xAxis.len),
  1493. x2: clamp(Math.round(xAxis.len -
  1494. (xAxis.translate(point.x + xPad,
  1495. false,
  1496. true,
  1497. false,
  1498. true, -pointPlacement) || 0)), -xAxis.len, 2 * xAxis.len),
  1499. y1: clamp(Math.round((yAxis.translate(point.y - yPad,
  1500. false,
  1501. true,
  1502. false,
  1503. true) || 0)), -yAxis.len, 2 * yAxis.len),
  1504. y2: clamp(Math.round((yAxis.translate(point.y + yPad,
  1505. false,
  1506. true,
  1507. false,
  1508. true) || 0)), -yAxis.len, 2 * yAxis.len)
  1509. };
  1510. // Handle marker's fixed width, and height values including border
  1511. // and pointPadding while calculating cell attributes.
  1512. [['width', 'x'], ['height', 'y']].forEach(function (dimension) {
  1513. var prop = dimension[0],
  1514. direction = dimension[1];
  1515. var start = direction + '1', end = direction + '2';
  1516. var side = Math.abs(cellAttr[start] - cellAttr[end]),
  1517. borderWidth = markerOptions &&
  1518. markerOptions.lineWidth || 0,
  1519. plotPos = Math.abs(cellAttr[start] + cellAttr[end]) / 2;
  1520. if (markerOptions[prop] &&
  1521. markerOptions[prop] < side) {
  1522. cellAttr[start] = plotPos - (markerOptions[prop] / 2) -
  1523. (borderWidth / 2);
  1524. cellAttr[end] = plotPos + (markerOptions[prop] / 2) +
  1525. (borderWidth / 2);
  1526. }
  1527. // Handle pointPadding
  1528. if (pointPadding) {
  1529. if (direction === 'y') {
  1530. start = end;
  1531. end = direction + '1';
  1532. }
  1533. cellAttr[start] += pointPadding;
  1534. cellAttr[end] -= pointPadding;
  1535. }
  1536. });
  1537. return cellAttr;
  1538. };
  1539. /**
  1540. * @private
  1541. */
  1542. HeatmapPoint.prototype.haloPath = function (size) {
  1543. if (!size) {
  1544. return [];
  1545. }
  1546. var rect = this.shapeArgs;
  1547. return [
  1548. 'M',
  1549. rect.x - size,
  1550. rect.y - size,
  1551. 'L',
  1552. rect.x - size,
  1553. rect.y + rect.height + size,
  1554. rect.x + rect.width + size,
  1555. rect.y + rect.height + size,
  1556. rect.x + rect.width + size,
  1557. rect.y - size,
  1558. 'Z'
  1559. ];
  1560. };
  1561. /**
  1562. * Color points have a value option that determines whether or not it is
  1563. * a null point
  1564. * @private
  1565. */
  1566. HeatmapPoint.prototype.isValid = function () {
  1567. // undefined is allowed
  1568. return (this.value !== Infinity &&
  1569. this.value !== -Infinity);
  1570. };
  1571. return HeatmapPoint;
  1572. }(ScatterPoint));
  1573. extend(HeatmapPoint.prototype, {
  1574. dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
  1575. moveToTopOnHover: colorMapPointMixin.moveToTopOnHover
  1576. });
  1577. /* *
  1578. *
  1579. * Default Export
  1580. *
  1581. * */
  1582. return HeatmapPoint;
  1583. });
  1584. _registerModule(_modules, 'Series/Heatmap/HeatmapSeries.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorMapSeries.js'], _modules['Series/Heatmap/HeatmapPoint.js'], _modules['Mixins/LegendSymbol.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Color, ColorMapMixin, HeatmapPoint, LegendSymbolMixin, palette, SeriesRegistry, SVGRenderer, U) {
  1585. /* *
  1586. *
  1587. * (c) 2010-2021 Torstein Honsi
  1588. *
  1589. * License: www.highcharts.com/license
  1590. *
  1591. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  1592. *
  1593. * */
  1594. var __extends = (this && this.__extends) || (function () {
  1595. var extendStatics = function (d,
  1596. b) {
  1597. extendStatics = Object.setPrototypeOf ||
  1598. ({ __proto__: [] } instanceof Array && function (d,
  1599. b) { d.__proto__ = b; }) ||
  1600. function (d,
  1601. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1602. return extendStatics(d, b);
  1603. };
  1604. return function (d, b) {
  1605. extendStatics(d, b);
  1606. function __() { this.constructor = d; }
  1607. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1608. };
  1609. })();
  1610. var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
  1611. var Series = SeriesRegistry.series,
  1612. _a = SeriesRegistry.seriesTypes,
  1613. ColumnSeries = _a.column,
  1614. ScatterSeries = _a.scatter;
  1615. var symbols = SVGRenderer.prototype.symbols;
  1616. var extend = U.extend,
  1617. fireEvent = U.fireEvent,
  1618. isNumber = U.isNumber,
  1619. merge = U.merge,
  1620. pick = U.pick;
  1621. /* *
  1622. *
  1623. * Class
  1624. *
  1625. * */
  1626. /**
  1627. * @private
  1628. * @class
  1629. * @name Highcharts.seriesTypes.heatmap
  1630. *
  1631. * @augments Highcharts.Series
  1632. */
  1633. var HeatmapSeries = /** @class */ (function (_super) {
  1634. __extends(HeatmapSeries, _super);
  1635. function HeatmapSeries() {
  1636. /* *
  1637. *
  1638. * Static Properties
  1639. *
  1640. * */
  1641. var _this = _super !== null && _super.apply(this,
  1642. arguments) || this;
  1643. /* *
  1644. *
  1645. * Properties
  1646. *
  1647. * */
  1648. _this.colorAxis = void 0;
  1649. _this.data = void 0;
  1650. _this.options = void 0;
  1651. _this.points = void 0;
  1652. _this.valueMax = NaN;
  1653. _this.valueMin = NaN;
  1654. return _this;
  1655. /* eslint-enable valid-jsdoc */
  1656. }
  1657. /* *
  1658. *
  1659. * Functions
  1660. *
  1661. * */
  1662. /* eslint-disable valid-jsdoc */
  1663. /**
  1664. * @private
  1665. */
  1666. HeatmapSeries.prototype.drawPoints = function () {
  1667. var _this = this;
  1668. // In styled mode, use CSS, otherwise the fill used in the style
  1669. // sheet will take precedence over the fill attribute.
  1670. var seriesMarkerOptions = this.options.marker || {};
  1671. if (seriesMarkerOptions.enabled || this._hasPointMarkers) {
  1672. Series.prototype.drawPoints.call(this);
  1673. this.points.forEach(function (point) {
  1674. if (point.graphic) {
  1675. point.graphic[_this.chart.styledMode ? 'css' : 'animate'](_this.colorAttribs(point));
  1676. if (_this.options.borderRadius) {
  1677. point.graphic.attr({
  1678. r: _this.options.borderRadius
  1679. });
  1680. }
  1681. if (point.value === null) { // #15708
  1682. point.graphic.addClass('highcharts-null-point');
  1683. }
  1684. }
  1685. });
  1686. }
  1687. };
  1688. /**
  1689. * @private
  1690. */
  1691. HeatmapSeries.prototype.getExtremes = function () {
  1692. // Get the extremes from the value data
  1693. var _a = Series.prototype.getExtremes
  1694. .call(this,
  1695. this.valueData),
  1696. dataMin = _a.dataMin,
  1697. dataMax = _a.dataMax;
  1698. if (isNumber(dataMin)) {
  1699. this.valueMin = dataMin;
  1700. }
  1701. if (isNumber(dataMax)) {
  1702. this.valueMax = dataMax;
  1703. }
  1704. // Get the extremes from the y data
  1705. return Series.prototype.getExtremes.call(this);
  1706. };
  1707. /**
  1708. * Override to also allow null points, used when building the k-d-tree for
  1709. * tooltips in boost mode.
  1710. * @private
  1711. */
  1712. HeatmapSeries.prototype.getValidPoints = function (points, insideOnly) {
  1713. return Series.prototype.getValidPoints.call(this, points, insideOnly, true);
  1714. };
  1715. /**
  1716. * Define hasData function for non-cartesian series. Returns true if the
  1717. * series has points at all.
  1718. * @private
  1719. */
  1720. HeatmapSeries.prototype.hasData = function () {
  1721. return !!this.processedXData.length; // != 0
  1722. };
  1723. /**
  1724. * Override the init method to add point ranges on both axes.
  1725. * @private
  1726. */
  1727. HeatmapSeries.prototype.init = function () {
  1728. var options;
  1729. Series.prototype.init.apply(this, arguments);
  1730. options = this.options;
  1731. // #3758, prevent resetting in setData
  1732. options.pointRange = pick(options.pointRange, options.colsize || 1);
  1733. // general point range
  1734. this.yAxis.axisPointRange = options.rowsize || 1;
  1735. // Bind new symbol names
  1736. symbols.ellipse = symbols.circle;
  1737. };
  1738. /**
  1739. * @private
  1740. */
  1741. HeatmapSeries.prototype.markerAttribs = function (point, state) {
  1742. var pointMarkerOptions = point.marker || {},
  1743. seriesMarkerOptions = this.options.marker || {},
  1744. seriesStateOptions,
  1745. pointStateOptions,
  1746. shapeArgs = point.shapeArgs || {},
  1747. hasImage = point.hasImage,
  1748. attribs = {};
  1749. if (hasImage) {
  1750. return {
  1751. x: point.plotX,
  1752. y: point.plotY
  1753. };
  1754. }
  1755. // Setting width and height attributes on image does not affect
  1756. // on its dimensions.
  1757. if (state) {
  1758. seriesStateOptions = seriesMarkerOptions.states[state] || {};
  1759. pointStateOptions = pointMarkerOptions.states &&
  1760. pointMarkerOptions.states[state] || {};
  1761. [['width', 'x'], ['height', 'y']].forEach(function (dimension) {
  1762. // Set new width and height basing on state options.
  1763. attribs[dimension[0]] = (pointStateOptions[dimension[0]] ||
  1764. seriesStateOptions[dimension[0]] ||
  1765. shapeArgs[dimension[0]]) + (pointStateOptions[dimension[0] + 'Plus'] ||
  1766. seriesStateOptions[dimension[0] + 'Plus'] || 0);
  1767. // Align marker by a new size.
  1768. attribs[dimension[1]] =
  1769. shapeArgs[dimension[1]] +
  1770. (shapeArgs[dimension[0]] -
  1771. attribs[dimension[0]]) / 2;
  1772. });
  1773. }
  1774. return state ? attribs : shapeArgs;
  1775. };
  1776. /**
  1777. * @private
  1778. */
  1779. HeatmapSeries.prototype.pointAttribs = function (point, state) {
  1780. var series = this,
  1781. attr = Series.prototype.pointAttribs.call(series,
  1782. point,
  1783. state),
  1784. seriesOptions = series.options || {},
  1785. plotOptions = series.chart.options.plotOptions || {},
  1786. seriesPlotOptions = plotOptions.series || {},
  1787. heatmapPlotOptions = plotOptions.heatmap || {},
  1788. stateOptions,
  1789. brightness,
  1790. // Get old properties in order to keep backward compatibility
  1791. borderColor = seriesOptions.borderColor ||
  1792. heatmapPlotOptions.borderColor ||
  1793. seriesPlotOptions.borderColor,
  1794. borderWidth = seriesOptions.borderWidth ||
  1795. heatmapPlotOptions.borderWidth ||
  1796. seriesPlotOptions.borderWidth ||
  1797. attr['stroke-width'];
  1798. // Apply lineColor, or set it to default series color.
  1799. attr.stroke = ((point && point.marker && point.marker.lineColor) ||
  1800. (seriesOptions.marker && seriesOptions.marker.lineColor) ||
  1801. borderColor ||
  1802. this.color);
  1803. // Apply old borderWidth property if exists.
  1804. attr['stroke-width'] = borderWidth;
  1805. if (state) {
  1806. stateOptions =
  1807. merge(seriesOptions.states[state], seriesOptions.marker &&
  1808. seriesOptions.marker.states[state], point &&
  1809. point.options.states &&
  1810. point.options.states[state] || {});
  1811. brightness = stateOptions.brightness;
  1812. attr.fill =
  1813. stateOptions.color ||
  1814. Color.parse(attr.fill).brighten(brightness || 0).get();
  1815. attr.stroke = stateOptions.lineColor;
  1816. }
  1817. return attr;
  1818. };
  1819. /**
  1820. * @private
  1821. */
  1822. HeatmapSeries.prototype.setClip = function (animation) {
  1823. var series = this,
  1824. chart = series.chart;
  1825. Series.prototype.setClip.apply(series, arguments);
  1826. if (series.options.clip !== false || animation) {
  1827. series.markerGroup
  1828. .clip((animation || series.clipBox) && series.sharedClipKey ?
  1829. chart.sharedClips[series.sharedClipKey] :
  1830. chart.clipRect);
  1831. }
  1832. };
  1833. /**
  1834. * @private
  1835. */
  1836. HeatmapSeries.prototype.translate = function () {
  1837. var series = this, options = series.options, symbol = options.marker && options.marker.symbol || 'rect', shape = symbols[symbol] ? symbol : 'rect', hasRegularShape = ['circle', 'square'].indexOf(shape) !== -1;
  1838. series.generatePoints();
  1839. series.points.forEach(function (point) {
  1840. var pointAttr,
  1841. sizeDiff,
  1842. hasImage,
  1843. cellAttr = point.getCellAttributes(),
  1844. shapeArgs = {};
  1845. shapeArgs.x = Math.min(cellAttr.x1, cellAttr.x2);
  1846. shapeArgs.y = Math.min(cellAttr.y1, cellAttr.y2);
  1847. shapeArgs.width = Math.max(Math.abs(cellAttr.x2 - cellAttr.x1), 0);
  1848. shapeArgs.height = Math.max(Math.abs(cellAttr.y2 - cellAttr.y1), 0);
  1849. hasImage = point.hasImage =
  1850. (point.marker && point.marker.symbol || symbol || '')
  1851. .indexOf('url') === 0;
  1852. // If marker shape is regular (symetric), find shorter
  1853. // cell's side.
  1854. if (hasRegularShape) {
  1855. sizeDiff = Math.abs(shapeArgs.width - shapeArgs.height);
  1856. shapeArgs.x = Math.min(cellAttr.x1, cellAttr.x2) +
  1857. (shapeArgs.width < shapeArgs.height ? 0 : sizeDiff / 2);
  1858. shapeArgs.y = Math.min(cellAttr.y1, cellAttr.y2) +
  1859. (shapeArgs.width < shapeArgs.height ? sizeDiff / 2 : 0);
  1860. shapeArgs.width = shapeArgs.height =
  1861. Math.min(shapeArgs.width, shapeArgs.height);
  1862. }
  1863. pointAttr = {
  1864. plotX: (cellAttr.x1 + cellAttr.x2) / 2,
  1865. plotY: (cellAttr.y1 + cellAttr.y2) / 2,
  1866. clientX: (cellAttr.x1 + cellAttr.x2) / 2,
  1867. shapeType: 'path',
  1868. shapeArgs: merge(true, shapeArgs, {
  1869. d: symbols[shape](shapeArgs.x, shapeArgs.y, shapeArgs.width, shapeArgs.height)
  1870. })
  1871. };
  1872. if (hasImage) {
  1873. point.marker = {
  1874. width: shapeArgs.width,
  1875. height: shapeArgs.height
  1876. };
  1877. }
  1878. extend(point, pointAttr);
  1879. });
  1880. fireEvent(series, 'afterTranslate');
  1881. };
  1882. /**
  1883. * A heatmap is a graphical representation of data where the individual
  1884. * values contained in a matrix are represented as colors.
  1885. *
  1886. * @productdesc {highcharts}
  1887. * Requires `modules/heatmap`.
  1888. *
  1889. * @sample highcharts/demo/heatmap/
  1890. * Simple heatmap
  1891. * @sample highcharts/demo/heatmap-canvas/
  1892. * Heavy heatmap
  1893. *
  1894. * @extends plotOptions.scatter
  1895. * @excluding animationLimit, connectEnds, connectNulls, cropThreshold,
  1896. * dashStyle, findNearestPointBy, getExtremesFromAll, jitter,
  1897. * linecap, lineWidth, pointInterval, pointIntervalUnit,
  1898. * pointRange, pointStart, shadow, softThreshold, stacking,
  1899. * step, threshold, cluster
  1900. * @product highcharts highmaps
  1901. * @optionparent plotOptions.heatmap
  1902. */
  1903. HeatmapSeries.defaultOptions = merge(ScatterSeries.defaultOptions, {
  1904. /**
  1905. * Animation is disabled by default on the heatmap series.
  1906. */
  1907. animation: false,
  1908. /**
  1909. * The border radius for each heatmap item.
  1910. */
  1911. borderRadius: 0,
  1912. /**
  1913. * The border width for each heatmap item.
  1914. */
  1915. borderWidth: 0,
  1916. /**
  1917. * Padding between the points in the heatmap.
  1918. *
  1919. * @type {number}
  1920. * @default 0
  1921. * @since 6.0
  1922. * @apioption plotOptions.heatmap.pointPadding
  1923. */
  1924. /**
  1925. * @default value
  1926. * @apioption plotOptions.heatmap.colorKey
  1927. */
  1928. /**
  1929. * The main color of the series. In heat maps this color is rarely used,
  1930. * as we mostly use the color to denote the value of each point. Unless
  1931. * options are set in the [colorAxis](#colorAxis), the default value
  1932. * is pulled from the [options.colors](#colors) array.
  1933. *
  1934. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  1935. * @since 4.0
  1936. * @product highcharts
  1937. * @apioption plotOptions.heatmap.color
  1938. */
  1939. /**
  1940. * The column size - how many X axis units each column in the heatmap
  1941. * should span.
  1942. *
  1943. * @sample {highcharts} maps/demo/heatmap/
  1944. * One day
  1945. * @sample {highmaps} maps/demo/heatmap/
  1946. * One day
  1947. *
  1948. * @type {number}
  1949. * @default 1
  1950. * @since 4.0
  1951. * @product highcharts highmaps
  1952. * @apioption plotOptions.heatmap.colsize
  1953. */
  1954. /**
  1955. * The row size - how many Y axis units each heatmap row should span.
  1956. *
  1957. * @sample {highcharts} maps/demo/heatmap/
  1958. * 1 by default
  1959. * @sample {highmaps} maps/demo/heatmap/
  1960. * 1 by default
  1961. *
  1962. * @type {number}
  1963. * @default 1
  1964. * @since 4.0
  1965. * @product highcharts highmaps
  1966. * @apioption plotOptions.heatmap.rowsize
  1967. */
  1968. /**
  1969. * The color applied to null points. In styled mode, a general CSS class
  1970. * is applied instead.
  1971. *
  1972. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  1973. */
  1974. nullColor: palette.neutralColor3,
  1975. dataLabels: {
  1976. formatter: function () {
  1977. return this.point.value;
  1978. },
  1979. inside: true,
  1980. verticalAlign: 'middle',
  1981. crop: false,
  1982. overflow: false,
  1983. padding: 0 // #3837
  1984. },
  1985. /**
  1986. * @excluding radius, enabledThreshold
  1987. * @since 8.1
  1988. */
  1989. marker: {
  1990. /**
  1991. * A predefined shape or symbol for the marker. When undefined, the
  1992. * symbol is pulled from options.symbols. Other possible values are
  1993. * `'circle'`, `'square'`,`'diamond'`, `'triangle'`,
  1994. * `'triangle-down'`, `'rect'`, and `'ellipse'`.
  1995. *
  1996. * Additionally, the URL to a graphic can be given on this form:
  1997. * `'url(graphic.png)'`. Note that for the image to be applied to
  1998. * exported charts, its URL needs to be accessible by the export
  1999. * server.
  2000. *
  2001. * Custom callbacks for symbol path generation can also be added to
  2002. * `Highcharts.SVGRenderer.prototype.symbols`. The callback is then
  2003. * used by its method name, as shown in the demo.
  2004. *
  2005. * @sample {highcharts} highcharts/plotoptions/series-marker-symbol/
  2006. * Predefined, graphic and custom markers
  2007. * @sample {highstock} highcharts/plotoptions/series-marker-symbol/
  2008. * Predefined, graphic and custom markers
  2009. */
  2010. symbol: 'rect',
  2011. /** @ignore-option */
  2012. radius: 0,
  2013. lineColor: void 0,
  2014. states: {
  2015. /**
  2016. * @excluding radius, radiusPlus
  2017. */
  2018. hover: {
  2019. /**
  2020. * Set the marker's fixed width on hover state.
  2021. *
  2022. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2023. * 70px fixed marker's width and height on hover
  2024. *
  2025. * @type {number|undefined}
  2026. * @default undefined
  2027. * @product highcharts highmaps
  2028. * @apioption plotOptions.heatmap.marker.states.hover.width
  2029. */
  2030. /**
  2031. * Set the marker's fixed height on hover state.
  2032. *
  2033. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2034. * 70px fixed marker's width and height on hover
  2035. *
  2036. * @type {number|undefined}
  2037. * @default undefined
  2038. * @product highcharts highmaps
  2039. * @apioption plotOptions.heatmap.marker.states.hover.height
  2040. */
  2041. /**
  2042. * The number of pixels to increase the width of the
  2043. * selected point.
  2044. *
  2045. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2046. * 20px greater width and height on hover
  2047. *
  2048. * @type {number|undefined}
  2049. * @default undefined
  2050. * @product highcharts highmaps
  2051. * @apioption plotOptions.heatmap.marker.states.hover.widthPlus
  2052. */
  2053. /**
  2054. * The number of pixels to increase the height of the
  2055. * selected point.
  2056. *
  2057. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2058. * 20px greater width and height on hover
  2059. *
  2060. * @type {number|undefined}
  2061. * @default undefined
  2062. * @product highcharts highmaps
  2063. * @apioption plotOptions.heatmap.marker.states.hover.heightPlus
  2064. */
  2065. /**
  2066. * The additional line width for a hovered point.
  2067. *
  2068. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
  2069. * 5 pixels wider lineWidth on hover
  2070. * @sample {highmaps} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
  2071. * 5 pixels wider lineWidth on hover
  2072. */
  2073. lineWidthPlus: 0
  2074. },
  2075. /**
  2076. * @excluding radius
  2077. */
  2078. select: {
  2079. /**
  2080. * Set the marker's fixed width on select state.
  2081. *
  2082. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2083. * 70px fixed marker's width and height on hover
  2084. *
  2085. * @type {number|undefined}
  2086. * @default undefined
  2087. * @product highcharts highmaps
  2088. * @apioption plotOptions.heatmap.marker.states.select.width
  2089. */
  2090. /**
  2091. * Set the marker's fixed height on select state.
  2092. *
  2093. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2094. * 70px fixed marker's width and height on hover
  2095. *
  2096. * @type {number|undefined}
  2097. * @default undefined
  2098. * @product highcharts highmaps
  2099. * @apioption plotOptions.heatmap.marker.states.select.height
  2100. */
  2101. /**
  2102. * The number of pixels to increase the width of the
  2103. * selected point.
  2104. *
  2105. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2106. * 20px greater width and height on hover
  2107. *
  2108. * @type {number|undefined}
  2109. * @default undefined
  2110. * @product highcharts highmaps
  2111. * @apioption plotOptions.heatmap.marker.states.select.widthPlus
  2112. */
  2113. /**
  2114. * The number of pixels to increase the height of the
  2115. * selected point.
  2116. *
  2117. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2118. * 20px greater width and height on hover
  2119. *
  2120. * @type {number|undefined}
  2121. * @default undefined
  2122. * @product highcharts highmaps
  2123. * @apioption plotOptions.heatmap.marker.states.select.heightPlus
  2124. */
  2125. }
  2126. }
  2127. },
  2128. clip: true,
  2129. /** @ignore-option */
  2130. pointRange: null,
  2131. tooltip: {
  2132. pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
  2133. },
  2134. states: {
  2135. hover: {
  2136. /** @ignore-option */
  2137. halo: false,
  2138. /**
  2139. * How much to brighten the point on interaction. Requires the
  2140. * main color to be defined in hex or rgb(a) format.
  2141. *
  2142. * In styled mode, the hover brightening is by default replaced
  2143. * with a fill-opacity set in the `.highcharts-point:hover`
  2144. * rule.
  2145. */
  2146. brightness: 0.2
  2147. }
  2148. }
  2149. });
  2150. return HeatmapSeries;
  2151. }(ScatterSeries));
  2152. extend(HeatmapSeries.prototype, {
  2153. /**
  2154. * @private
  2155. */
  2156. alignDataLabel: ColumnSeries.prototype.alignDataLabel,
  2157. axisTypes: colorMapSeriesMixin.axisTypes,
  2158. colorAttribs: colorMapSeriesMixin.colorAttribs,
  2159. colorKey: colorMapSeriesMixin.colorKey,
  2160. directTouch: true,
  2161. /**
  2162. * @private
  2163. */
  2164. drawLegendSymbol: LegendSymbolMixin.drawRectangle,
  2165. getExtremesFromAll: true,
  2166. getSymbol: Series.prototype.getSymbol,
  2167. parallelArrays: colorMapSeriesMixin.parallelArrays,
  2168. pointArrayMap: ['y', 'value'],
  2169. pointClass: HeatmapPoint,
  2170. trackerGroups: colorMapSeriesMixin.trackerGroups
  2171. });
  2172. SeriesRegistry.registerSeriesType('heatmap', HeatmapSeries);
  2173. /* *
  2174. *
  2175. * Default Export
  2176. *
  2177. * */
  2178. /* *
  2179. *
  2180. * API Declarations
  2181. *
  2182. * */
  2183. /**
  2184. * Heatmap series only. Padding between the points in the heatmap.
  2185. * @name Highcharts.Point#pointPadding
  2186. * @type {number|undefined}
  2187. */
  2188. /**
  2189. * Heatmap series only. The value of the point, resulting in a color
  2190. * controled by options as set in the colorAxis configuration.
  2191. * @name Highcharts.Point#value
  2192. * @type {number|null|undefined}
  2193. */
  2194. /* *
  2195. * @interface Highcharts.PointOptionsObject in parts/Point.ts
  2196. */ /**
  2197. * Heatmap series only. Point padding for a single point.
  2198. * @name Highcharts.PointOptionsObject#pointPadding
  2199. * @type {number|undefined}
  2200. */ /**
  2201. * Heatmap series only. The value of the point, resulting in a color controled
  2202. * by options as set in the colorAxis configuration.
  2203. * @name Highcharts.PointOptionsObject#value
  2204. * @type {number|null|undefined}
  2205. */
  2206. ''; // detach doclets above
  2207. /* *
  2208. *
  2209. * API Options
  2210. *
  2211. * */
  2212. /**
  2213. * A `heatmap` series. If the [type](#series.heatmap.type) option is
  2214. * not specified, it is inherited from [chart.type](#chart.type).
  2215. *
  2216. * @productdesc {highcharts}
  2217. * Requires `modules/heatmap`.
  2218. *
  2219. * @extends series,plotOptions.heatmap
  2220. * @excluding cropThreshold, dataParser, dataURL, pointRange, stack,
  2221. * @product highcharts highmaps
  2222. * @apioption series.heatmap
  2223. */
  2224. /**
  2225. * An array of data points for the series. For the `heatmap` series
  2226. * type, points can be given in the following ways:
  2227. *
  2228. * 1. An array of arrays with 3 or 2 values. In this case, the values
  2229. * correspond to `x,y,value`. If the first value is a string, it is
  2230. * applied as the name of the point, and the `x` value is inferred.
  2231. * The `x` value can also be omitted, in which case the inner arrays
  2232. * should be of length 2\. Then the `x` value is automatically calculated,
  2233. * either starting at 0 and incremented by 1, or from `pointStart`
  2234. * and `pointInterval` given in the series options.
  2235. *
  2236. * ```js
  2237. * data: [
  2238. * [0, 9, 7],
  2239. * [1, 10, 4],
  2240. * [2, 6, 3]
  2241. * ]
  2242. * ```
  2243. *
  2244. * 2. An array of objects with named values. The following snippet shows only a
  2245. * few settings, see the complete options set below. If the total number of data
  2246. * points exceeds the series' [turboThreshold](#series.heatmap.turboThreshold),
  2247. * this option is not available.
  2248. *
  2249. * ```js
  2250. * data: [{
  2251. * x: 1,
  2252. * y: 3,
  2253. * value: 10,
  2254. * name: "Point2",
  2255. * color: "#00FF00"
  2256. * }, {
  2257. * x: 1,
  2258. * y: 7,
  2259. * value: 10,
  2260. * name: "Point1",
  2261. * color: "#FF00FF"
  2262. * }]
  2263. * ```
  2264. *
  2265. * @sample {highcharts} highcharts/chart/reflow-true/
  2266. * Numerical values
  2267. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  2268. * Arrays of numeric x and y
  2269. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  2270. * Arrays of datetime x and y
  2271. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  2272. * Arrays of point.name and y
  2273. * @sample {highcharts} highcharts/series/data-array-of-objects/
  2274. * Config objects
  2275. *
  2276. * @type {Array<Array<number>|*>}
  2277. * @extends series.line.data
  2278. * @product highcharts highmaps
  2279. * @apioption series.heatmap.data
  2280. */
  2281. /**
  2282. * The color of the point. In heat maps the point color is rarely set
  2283. * explicitly, as we use the color to denote the `value`. Options for
  2284. * this are set in the [colorAxis](#colorAxis) configuration.
  2285. *
  2286. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  2287. * @product highcharts highmaps
  2288. * @apioption series.heatmap.data.color
  2289. */
  2290. /**
  2291. * The value of the point, resulting in a color controled by options
  2292. * as set in the [colorAxis](#colorAxis) configuration.
  2293. *
  2294. * @type {number}
  2295. * @product highcharts highmaps
  2296. * @apioption series.heatmap.data.value
  2297. */
  2298. /**
  2299. * The x value of the point. For datetime axes,
  2300. * the X value is the timestamp in milliseconds since 1970.
  2301. *
  2302. * @type {number}
  2303. * @product highcharts highmaps
  2304. * @apioption series.heatmap.data.x
  2305. */
  2306. /**
  2307. * The y value of the point.
  2308. *
  2309. * @type {number}
  2310. * @product highcharts highmaps
  2311. * @apioption series.heatmap.data.y
  2312. */
  2313. /**
  2314. * Point padding for a single point.
  2315. *
  2316. * @sample maps/plotoptions/tilemap-pointpadding
  2317. * Point padding on tiles
  2318. *
  2319. * @type {number}
  2320. * @product highcharts highmaps
  2321. * @apioption series.heatmap.data.pointPadding
  2322. */
  2323. /**
  2324. * @excluding radius, enabledThreshold
  2325. * @product highcharts highmaps
  2326. * @since 8.1
  2327. * @apioption series.heatmap.data.marker
  2328. */
  2329. /**
  2330. * @excluding radius, enabledThreshold
  2331. * @product highcharts highmaps
  2332. * @since 8.1
  2333. * @apioption series.heatmap.marker
  2334. */
  2335. /**
  2336. * @excluding radius, radiusPlus
  2337. * @product highcharts highmaps
  2338. * @apioption series.heatmap.marker.states.hover
  2339. */
  2340. /**
  2341. * @excluding radius
  2342. * @product highcharts highmaps
  2343. * @apioption series.heatmap.marker.states.select
  2344. */
  2345. /**
  2346. * @excluding radius, radiusPlus
  2347. * @product highcharts highmaps
  2348. * @apioption series.heatmap.data.marker.states.hover
  2349. */
  2350. /**
  2351. * @excluding radius
  2352. * @product highcharts highmaps
  2353. * @apioption series.heatmap.data.marker.states.select
  2354. */
  2355. /**
  2356. * Set the marker's fixed width on hover state.
  2357. *
  2358. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
  2359. * 5 pixels wider lineWidth on hover
  2360. *
  2361. * @type {number|undefined}
  2362. * @default 0
  2363. * @product highcharts highmaps
  2364. * @apioption series.heatmap.marker.states.hover.lineWidthPlus
  2365. */
  2366. /**
  2367. * Set the marker's fixed width on hover state.
  2368. *
  2369. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2370. * 70px fixed marker's width and height on hover
  2371. *
  2372. * @type {number|undefined}
  2373. * @default undefined
  2374. * @product highcharts highmaps
  2375. * @apioption series.heatmap.marker.states.hover.width
  2376. */
  2377. /**
  2378. * Set the marker's fixed height on hover state.
  2379. *
  2380. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2381. * 70px fixed marker's width and height on hover
  2382. *
  2383. * @type {number|undefined}
  2384. * @default undefined
  2385. * @product highcharts highmaps
  2386. * @apioption series.heatmap.marker.states.hover.height
  2387. */
  2388. /**
  2389. * The number of pixels to increase the width of the
  2390. * hovered point.
  2391. *
  2392. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2393. * One day
  2394. *
  2395. * @type {number|undefined}
  2396. * @default undefined
  2397. * @product highcharts highmaps
  2398. * @apioption series.heatmap.marker.states.hover.widthPlus
  2399. */
  2400. /**
  2401. * The number of pixels to increase the height of the
  2402. * hovered point.
  2403. *
  2404. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2405. * One day
  2406. *
  2407. * @type {number|undefined}
  2408. * @default undefined
  2409. * @product highcharts highmaps
  2410. * @apioption series.heatmap.marker.states.hover.heightPlus
  2411. */
  2412. /**
  2413. * The number of pixels to increase the width of the
  2414. * hovered point.
  2415. *
  2416. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2417. * One day
  2418. *
  2419. * @type {number|undefined}
  2420. * @default undefined
  2421. * @product highcharts highmaps
  2422. * @apioption series.heatmap.marker.states.select.widthPlus
  2423. */
  2424. /**
  2425. * The number of pixels to increase the height of the
  2426. * hovered point.
  2427. *
  2428. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2429. * One day
  2430. *
  2431. * @type {number|undefined}
  2432. * @default undefined
  2433. * @product highcharts highmaps
  2434. * @apioption series.heatmap.marker.states.select.heightPlus
  2435. */
  2436. /**
  2437. * Set the marker's fixed width on hover state.
  2438. *
  2439. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
  2440. * 5 pixels wider lineWidth on hover
  2441. *
  2442. * @type {number|undefined}
  2443. * @default 0
  2444. * @product highcharts highmaps
  2445. * @apioption series.heatmap.data.marker.states.hover.lineWidthPlus
  2446. */
  2447. /**
  2448. * Set the marker's fixed width on hover state.
  2449. *
  2450. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2451. * 70px fixed marker's width and height on hover
  2452. *
  2453. * @type {number|undefined}
  2454. * @default undefined
  2455. * @product highcharts highmaps
  2456. * @apioption series.heatmap.data.marker.states.hover.width
  2457. */
  2458. /**
  2459. * Set the marker's fixed height on hover state.
  2460. *
  2461. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2462. * 70px fixed marker's width and height on hover
  2463. *
  2464. * @type {number|undefined}
  2465. * @default undefined
  2466. * @product highcharts highmaps
  2467. * @apioption series.heatmap.data.marker.states.hover.height
  2468. */
  2469. /**
  2470. * The number of pixels to increase the width of the
  2471. * hovered point.
  2472. *
  2473. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2474. * One day
  2475. *
  2476. * @type {number|undefined}
  2477. * @default undefined
  2478. * @product highcharts highstock
  2479. * @apioption series.heatmap.data.marker.states.hover.widthPlus
  2480. */
  2481. /**
  2482. * The number of pixels to increase the height of the
  2483. * hovered point.
  2484. *
  2485. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2486. * One day
  2487. *
  2488. * @type {number|undefined}
  2489. * @default undefined
  2490. * @product highcharts highstock
  2491. * @apioption series.heatmap.data.marker.states.hover.heightPlus
  2492. */
  2493. /**
  2494. * Set the marker's fixed width on select state.
  2495. *
  2496. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2497. * 70px fixed marker's width and height on hover
  2498. *
  2499. * @type {number|undefined}
  2500. * @default undefined
  2501. * @product highcharts highmaps
  2502. * @apioption series.heatmap.data.marker.states.select.width
  2503. */
  2504. /**
  2505. * Set the marker's fixed height on select state.
  2506. *
  2507. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
  2508. * 70px fixed marker's width and height on hover
  2509. *
  2510. * @type {number|undefined}
  2511. * @default undefined
  2512. * @product highcharts highmaps
  2513. * @apioption series.heatmap.data.marker.states.select.height
  2514. */
  2515. /**
  2516. * The number of pixels to increase the width of the
  2517. * hovered point.
  2518. *
  2519. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2520. * One day
  2521. *
  2522. * @type {number|undefined}
  2523. * @default undefined
  2524. * @product highcharts highstock
  2525. * @apioption series.heatmap.data.marker.states.select.widthPlus
  2526. */
  2527. /**
  2528. * The number of pixels to increase the height of the
  2529. * hovered point.
  2530. *
  2531. * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
  2532. * One day
  2533. *
  2534. * @type {number|undefined}
  2535. * @default undefined
  2536. * @product highcharts highstock
  2537. * @apioption series.heatmap.data.marker.states.select.heightPlus
  2538. */
  2539. ''; // adds doclets above to transpiled file
  2540. return HeatmapSeries;
  2541. });
  2542. _registerModule(_modules, 'masters/modules/heatmap.src.js', [], function () {
  2543. });
  2544. }));