heatmap.src.js 107 KB

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