| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541 |
- /**
- * @license Highmaps JS v9.0.1 (2021-02-16)
- *
- * (c) 2009-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- */
- 'use strict';
- (function (factory) {
- if (typeof module === 'object' && module.exports) {
- factory['default'] = factory;
- module.exports = factory;
- } else if (typeof define === 'function' && define.amd) {
- define('highcharts/modules/heatmap', ['highcharts'], function (Highcharts) {
- factory(Highcharts);
- factory.Highcharts = Highcharts;
- return factory;
- });
- } else {
- factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
- }
- }(function (Highcharts) {
- var _modules = Highcharts ? Highcharts._modules : {};
- function _registerModule(obj, path, args, fn) {
- if (!obj.hasOwnProperty(path)) {
- obj[path] = fn.apply(null, args);
- }
- }
- _registerModule(_modules, 'Mixins/ColorSeries.js', [], function () {
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- /**
- * Mixin for maps and heatmaps
- *
- * @private
- * @mixin Highcharts.colorPointMixin
- */
- var colorPointMixin = {
- /* eslint-disable valid-jsdoc */
- /**
- * Set the visibility of a single point
- * @private
- * @function Highcharts.colorPointMixin.setVisible
- * @param {boolean} visible
- * @return {void}
- */
- setVisible: function (vis) {
- var point = this,
- method = vis ? 'show' : 'hide';
- point.visible = point.options.visible = Boolean(vis);
- // Show and hide associated elements
- ['graphic', 'dataLabel'].forEach(function (key) {
- if (point[key]) {
- point[key][method]();
- }
- });
- this.series.buildKDTree(); // rebuild kdtree #13195
- }
- /* eslint-enable valid-jsdoc */
- };
- /**
- * @private
- * @mixin Highcharts.colorSeriesMixin
- */
- var colorSeriesMixin = {
- optionalAxis: 'colorAxis',
- colorAxis: 0,
- /* eslint-disable valid-jsdoc */
- /**
- * In choropleth maps,
- the color is a result of the value,
- so this needs
- * translation too
- * @private
- * @function Highcharts.colorSeriesMixin.translateColors
- * @return {void}
- */
- translateColors: function () {
- var series = this,
- points = this.data.length ? this.data : this.points,
- nullColor = this.options.nullColor,
- colorAxis = this.colorAxis,
- colorKey = this.colorKey;
- points.forEach(function (point) {
- var value = point.getNestedProperty(colorKey),
- color;
- color = point.options.color ||
- (point.isNull || point.value === null ?
- nullColor :
- (colorAxis && typeof value !== 'undefined') ?
- colorAxis.toColor(value, point) :
- point.color || series.color);
- if (color && point.color !== color) {
- point.color = color;
- if (series.options.legendType === 'point' && point.legendItem) {
- series.chart.legend.colorizeItem(point, point.visible);
- }
- }
- });
- }
- /* eslint-enable valid-jsdoc */
- };
- var exports = {
- colorPointMixin: colorPointMixin,
- colorSeriesMixin: colorSeriesMixin
- };
- return exports;
- });
- _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) {
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d,
- b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d,
- b) { d.__proto__ = b; }) ||
- function (d,
- b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var color = Color.parse;
- var colorPointMixin = ColorSeriesModule.colorPointMixin,
- colorSeriesMixin = ColorSeriesModule.colorSeriesMixin;
- var noop = H.noop;
- var addEvent = U.addEvent,
- erase = U.erase,
- extend = U.extend,
- isNumber = U.isNumber,
- merge = U.merge,
- pick = U.pick,
- splat = U.splat;
- /**
- * Color axis types
- *
- * @typedef {"linear"|"logarithmic"} Highcharts.ColorAxisTypeValue
- */
- ''; // detach doclet above
- extend(Series.prototype, colorSeriesMixin);
- extend(Point.prototype, colorPointMixin);
- Chart.prototype.collectionsWithUpdate.push('colorAxis');
- Chart.prototype.collectionsWithInit.colorAxis = [Chart.prototype.addColorAxis];
- /* eslint-disable no-invalid-this, valid-jsdoc */
- /**
- * The ColorAxis object for inclusion in gradient legends.
- *
- * @class
- * @name Highcharts.ColorAxis
- * @augments Highcharts.Axis
- *
- * @param {Highcharts.Chart} chart
- * The related chart of the color axis.
- *
- * @param {Highcharts.ColorAxisOptions} userOptions
- * The color axis options for initialization.
- */
- var ColorAxis = /** @class */ (function (_super) {
- __extends(ColorAxis, _super);
- /* *
- *
- * Constructors
- *
- * */
- /**
- * @private
- */
- function ColorAxis(chart, userOptions) {
- var _this = _super.call(this,
- chart,
- userOptions) || this;
- _this.beforePadding = false; // Prevents unnecessary padding with `hc-more`
- _this.chart = void 0;
- _this.coll = 'colorAxis';
- _this.dataClasses = void 0;
- _this.legendItem = void 0;
- _this.legendItems = void 0;
- _this.name = ''; // Prevents 'undefined' in legend in IE8
- _this.options = void 0;
- _this.stops = void 0;
- _this.visible = true;
- _this.init(chart, userOptions);
- return _this;
- }
- /* *
- *
- * Functions
- *
- * */
- /**
- * Initializes the color axis.
- *
- * @function Highcharts.ColorAxis#init
- *
- * @param {Highcharts.Chart} chart
- * The related chart of the color axis.
- *
- * @param {Highcharts.ColorAxisOptions} userOptions
- * The color axis options for initialization.
- */
- ColorAxis.prototype.init = function (chart, userOptions) {
- var axis = this;
- var legend = chart.options.legend || {},
- horiz = userOptions.layout ?
- userOptions.layout !== 'vertical' :
- legend.layout !== 'vertical';
- var options = merge(ColorAxis.defaultOptions,
- userOptions, {
- showEmpty: false,
- title: null,
- visible: legend.enabled &&
- (userOptions ? userOptions.visible !== false : true)
- });
- axis.coll = 'colorAxis';
- axis.side = userOptions.side || horiz ? 2 : 1;
- axis.reversed = userOptions.reversed || !horiz;
- axis.opposite = !horiz;
- // Keep the options structure updated for export. Unlike xAxis and
- // yAxis, the colorAxis is not an array. (#3207)
- chart.options[axis.coll] = options;
- _super.prototype.init.call(this, chart, options);
- // Base init() pushes it to the xAxis array, now pop it again
- // chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
- // Prepare data classes
- if (userOptions.dataClasses) {
- axis.initDataClasses(userOptions);
- }
- axis.initStops();
- // Override original axis properties
- axis.horiz = horiz;
- axis.zoomEnabled = false;
- };
- /**
- * @private
- */
- ColorAxis.prototype.initDataClasses = function (userOptions) {
- var axis = this;
- var chart = axis.chart,
- dataClasses,
- colorCounter = 0,
- colorCount = chart.options.chart.colorCount,
- options = axis.options,
- len = userOptions.dataClasses.length;
- axis.dataClasses = dataClasses = [];
- axis.legendItems = [];
- userOptions.dataClasses.forEach(function (dataClass, i) {
- var colors;
- dataClass = merge(dataClass);
- dataClasses.push(dataClass);
- if (!chart.styledMode && dataClass.color) {
- return;
- }
- if (options.dataClassColor === 'category') {
- if (!chart.styledMode) {
- colors = chart.options.colors;
- colorCount = colors.length;
- dataClass.color = colors[colorCounter];
- }
- dataClass.colorIndex = colorCounter;
- // increase and loop back to zero
- colorCounter++;
- if (colorCounter === colorCount) {
- colorCounter = 0;
- }
- }
- else {
- dataClass.color = color(options.minColor).tweenTo(color(options.maxColor), len < 2 ? 0.5 : i / (len - 1) // #3219
- );
- }
- });
- };
- /**
- * Returns true if the series has points at all.
- *
- * @function Highcharts.ColorAxis#hasData
- *
- * @return {boolean}
- * True, if the series has points, otherwise false.
- */
- ColorAxis.prototype.hasData = function () {
- return !!(this.tickPositions || []).length;
- };
- /**
- * Override so that ticks are not added in data class axes (#6914)
- * @private
- */
- ColorAxis.prototype.setTickPositions = function () {
- if (!this.dataClasses) {
- return _super.prototype.setTickPositions.call(this);
- }
- };
- /**
- * @private
- */
- ColorAxis.prototype.initStops = function () {
- var axis = this;
- axis.stops = axis.options.stops || [
- [0, axis.options.minColor],
- [1, axis.options.maxColor]
- ];
- axis.stops.forEach(function (stop) {
- stop.color = color(stop[1]);
- });
- };
- /**
- * Extend the setOptions method to process extreme colors and color stops.
- * @private
- */
- ColorAxis.prototype.setOptions = function (userOptions) {
- var axis = this;
- _super.prototype.setOptions.call(this, userOptions);
- axis.options.crosshair = axis.options.marker;
- };
- /**
- * @private
- */
- ColorAxis.prototype.setAxisSize = function () {
- var axis = this;
- var symbol = axis.legendSymbol;
- var chart = axis.chart;
- var legendOptions = chart.options.legend || {};
- var x,
- y,
- width,
- height;
- if (symbol) {
- this.left = x = symbol.attr('x');
- this.top = y = symbol.attr('y');
- this.width = width = symbol.attr('width');
- this.height = height = symbol.attr('height');
- this.right = chart.chartWidth - x - width;
- this.bottom = chart.chartHeight - y - height;
- this.len = this.horiz ? width : height;
- this.pos = this.horiz ? x : y;
- }
- else {
- // Fake length for disabled legend to avoid tick issues
- // and such (#5205)
- this.len = (this.horiz ?
- legendOptions.symbolWidth :
- legendOptions.symbolHeight) || ColorAxis.defaultLegendLength;
- }
- };
- /**
- * @private
- */
- ColorAxis.prototype.normalizedValue = function (value) {
- var axis = this;
- if (axis.logarithmic) {
- value = axis.logarithmic.log2lin(value);
- }
- return 1 - ((axis.max - value) /
- ((axis.max - axis.min) || 1));
- };
- /**
- * Translate from a value to a color.
- * @private
- */
- ColorAxis.prototype.toColor = function (value, point) {
- var axis = this;
- var dataClasses = axis.dataClasses;
- var stops = axis.stops;
- var pos,
- from,
- to,
- color,
- dataClass,
- i;
- if (dataClasses) {
- i = dataClasses.length;
- while (i--) {
- dataClass = dataClasses[i];
- from = dataClass.from;
- to = dataClass.to;
- if ((typeof from === 'undefined' || value >= from) &&
- (typeof to === 'undefined' || value <= to)) {
- color = dataClass.color;
- if (point) {
- point.dataClass = i;
- point.colorIndex = dataClass.colorIndex;
- }
- break;
- }
- }
- }
- else {
- pos = axis.normalizedValue(value);
- i = stops.length;
- while (i--) {
- if (pos > stops[i][0]) {
- break;
- }
- }
- from = stops[i] || stops[i + 1];
- to = stops[i + 1] || from;
- // The position within the gradient
- pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
- color = from.color.tweenTo(to.color, pos);
- }
- return color;
- };
- /**
- * Override the getOffset method to add the whole axis groups inside the
- * legend.
- * @private
- */
- ColorAxis.prototype.getOffset = function () {
- var axis = this;
- var group = axis.legendGroup;
- var sideOffset = axis.chart.axisOffset[axis.side];
- if (group) {
- // Hook for the getOffset method to add groups to this parent
- // group
- axis.axisParent = group;
- // Call the base
- _super.prototype.getOffset.call(this);
- // First time only
- if (!axis.added) {
- axis.added = true;
- axis.labelLeft = 0;
- axis.labelRight = axis.width;
- }
- // Reset it to avoid color axis reserving space
- axis.chart.axisOffset[axis.side] = sideOffset;
- }
- };
- /**
- * Create the color gradient.
- * @private
- */
- ColorAxis.prototype.setLegendColor = function () {
- var axis = this;
- var horiz = axis.horiz;
- var reversed = axis.reversed;
- var one = reversed ? 1 : 0;
- var zero = reversed ? 0 : 1;
- var grad = horiz ? [one, 0,
- zero, 0] : [0,
- zero, 0,
- one]; // #3190
- axis.legendColor = {
- linearGradient: {
- x1: grad[0],
- y1: grad[1],
- x2: grad[2],
- y2: grad[3]
- },
- stops: axis.stops
- };
- };
- /**
- * The color axis appears inside the legend and has its own legend symbol.
- * @private
- */
- ColorAxis.prototype.drawLegendSymbol = function (legend, item) {
- var axis = this;
- var padding = legend.padding;
- var legendOptions = legend.options;
- var horiz = axis.horiz;
- var width = pick(legendOptions.symbolWidth,
- horiz ? ColorAxis.defaultLegendLength : 12);
- var height = pick(legendOptions.symbolHeight,
- horiz ? 12 : ColorAxis.defaultLegendLength);
- var labelPadding = pick(legendOptions.labelPadding,
- horiz ? 16 : 30);
- var itemDistance = pick(legendOptions.itemDistance, 10);
- this.setLegendColor();
- // Create the gradient
- item.legendSymbol = this.chart.renderer.rect(0, legend.baseline - 11, width, height).attr({
- zIndex: 1
- }).add(item.legendGroup);
- // Set how much space this legend item takes up
- axis.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
- axis.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
- };
- /**
- * Fool the legend.
- * @private
- */
- ColorAxis.prototype.setState = function (state) {
- this.series.forEach(function (series) {
- series.setState(state);
- });
- };
- /**
- * @private
- */
- ColorAxis.prototype.setVisible = function () {
- };
- /**
- * @private
- */
- ColorAxis.prototype.getSeriesExtremes = function () {
- var axis = this;
- var series = axis.series;
- var colorValArray,
- colorKey,
- colorValIndex,
- pointArrayMap,
- calculatedExtremes,
- cSeries,
- i = series.length,
- yData,
- j;
- this.dataMin = Infinity;
- this.dataMax = -Infinity;
- while (i--) { // x, y, value, other
- cSeries = series[i];
- colorKey = cSeries.colorKey = pick(cSeries.options.colorKey, cSeries.colorKey, cSeries.pointValKey, cSeries.zoneAxis, 'y');
- pointArrayMap = cSeries.pointArrayMap;
- calculatedExtremes = cSeries[colorKey + 'Min'] &&
- cSeries[colorKey + 'Max'];
- if (cSeries[colorKey + 'Data']) {
- colorValArray = cSeries[colorKey + 'Data'];
- }
- else {
- if (!pointArrayMap) {
- colorValArray = cSeries.yData;
- }
- else {
- colorValArray = [];
- colorValIndex = pointArrayMap.indexOf(colorKey);
- yData = cSeries.yData;
- if (colorValIndex >= 0 && yData) {
- for (j = 0; j < yData.length; j++) {
- colorValArray.push(pick(yData[j][colorValIndex], yData[j]));
- }
- }
- }
- }
- // If color key extremes are already calculated, use them.
- if (calculatedExtremes) {
- cSeries.minColorValue = cSeries[colorKey + 'Min'];
- cSeries.maxColorValue = cSeries[colorKey + 'Max'];
- }
- else {
- var cExtremes = Series.prototype.getExtremes.call(cSeries,
- colorValArray);
- cSeries.minColorValue = cExtremes.dataMin;
- cSeries.maxColorValue = cExtremes.dataMax;
- }
- if (typeof cSeries.minColorValue !== 'undefined') {
- this.dataMin =
- Math.min(this.dataMin, cSeries.minColorValue);
- this.dataMax =
- Math.max(this.dataMax, cSeries.maxColorValue);
- }
- if (!calculatedExtremes) {
- Series.prototype.applyExtremes.call(cSeries);
- }
- }
- };
- /**
- * Internal function to draw a crosshair.
- *
- * @function Highcharts.ColorAxis#drawCrosshair
- *
- * @param {Highcharts.PointerEventObject} [e]
- * The event arguments from the modified pointer event, extended with
- * `chartX` and `chartY`
- *
- * @param {Highcharts.Point} [point]
- * The Point object if the crosshair snaps to points.
- *
- * @fires Highcharts.ColorAxis#event:afterDrawCrosshair
- * @fires Highcharts.ColorAxis#event:drawCrosshair
- */
- ColorAxis.prototype.drawCrosshair = function (e, point) {
- var axis = this;
- var plotX = point && point.plotX;
- var plotY = point && point.plotY;
- var axisPos = axis.pos;
- var axisLen = axis.len;
- var crossPos;
- if (point) {
- crossPos = axis.toPixels(point.getNestedProperty(point.series.colorKey));
- if (crossPos < axisPos) {
- crossPos = axisPos - 2;
- }
- else if (crossPos > axisPos + axisLen) {
- crossPos = axisPos + axisLen + 2;
- }
- point.plotX = crossPos;
- point.plotY = axis.len - crossPos;
- _super.prototype.drawCrosshair.call(this, e, point);
- point.plotX = plotX;
- point.plotY = plotY;
- if (axis.cross &&
- !axis.cross.addedToColorAxis &&
- axis.legendGroup) {
- axis.cross
- .addClass('highcharts-coloraxis-marker')
- .add(axis.legendGroup);
- axis.cross.addedToColorAxis = true;
- if (!axis.chart.styledMode &&
- axis.crosshair) {
- axis.cross.attr({
- fill: axis.crosshair.color
- });
- }
- }
- }
- };
- /**
- * @private
- */
- ColorAxis.prototype.getPlotLinePath = function (options) {
- var axis = this,
- left = axis.left,
- pos = options.translatedValue,
- top = axis.top;
- // crosshairs only
- return isNumber(pos) ? // pos can be 0 (#3969)
- (axis.horiz ? [
- ['M', pos - 4, top - 6],
- ['L', pos + 4, top - 6],
- ['L', pos, top],
- ['Z']
- ] : [
- ['M', left, pos],
- ['L', left - 6, pos + 6],
- ['L', left - 6, pos - 6],
- ['Z']
- ]) :
- _super.prototype.getPlotLinePath.call(this, options);
- };
- /**
- * Updates a color axis instance with a new set of options. The options are
- * merged with the existing options, so only new or altered options need to
- * be specified.
- *
- * @function Highcharts.ColorAxis#update
- *
- * @param {Highcharts.ColorAxisOptions} newOptions
- * The new options that will be merged in with existing options on the color
- * axis.
- *
- * @param {boolean} [redraw]
- * Whether to redraw the chart after the color axis is altered. If doing
- * more operations on the chart, it is a good idea to set redraw to `false`
- * and call {@link Highcharts.Chart#redraw} after.
- */
- ColorAxis.prototype.update = function (newOptions, redraw) {
- var axis = this,
- chart = axis.chart,
- legend = chart.legend;
- this.series.forEach(function (series) {
- // Needed for Axis.update when choropleth colors change
- series.isDirtyData = true;
- });
- // When updating data classes, destroy old items and make sure new
- // ones are created (#3207)
- if (newOptions.dataClasses && legend.allItems || axis.dataClasses) {
- axis.destroyItems();
- }
- _super.prototype.update.call(this, newOptions, redraw);
- if (axis.legendItem) {
- axis.setLegendColor();
- legend.colorizeItem(this, true);
- }
- };
- /**
- * Destroy color axis legend items.
- * @private
- */
- ColorAxis.prototype.destroyItems = function () {
- var axis = this;
- var chart = axis.chart;
- if (axis.legendItem) {
- chart.legend.destroyItem(axis);
- }
- else if (axis.legendItems) {
- axis.legendItems.forEach(function (item) {
- chart.legend.destroyItem(item);
- });
- }
- chart.isDirtyLegend = true;
- };
- // Removing the whole axis (#14283)
- ColorAxis.prototype.destroy = function () {
- this.chart.isDirtyLegend = true;
- this.destroyItems();
- _super.prototype.destroy.apply(this, [].slice.call(arguments));
- };
- /**
- * Removes the color axis and the related legend item.
- *
- * @function Highcharts.ColorAxis#remove
- *
- * @param {boolean} [redraw=true]
- * Whether to redraw the chart following the remove.
- */
- ColorAxis.prototype.remove = function (redraw) {
- this.destroyItems();
- _super.prototype.remove.call(this, redraw);
- };
- /**
- * Get the legend item symbols for data classes.
- * @private
- */
- ColorAxis.prototype.getDataClassLegendSymbols = function () {
- var axis = this;
- var chart = axis.chart;
- var legendItems = axis.legendItems;
- var legendOptions = chart.options.legend;
- var valueDecimals = legendOptions.valueDecimals;
- var valueSuffix = legendOptions.valueSuffix || '';
- var name;
- if (!legendItems.length) {
- axis.dataClasses.forEach(function (dataClass, i) {
- var vis = true,
- from = dataClass.from,
- to = dataClass.to;
- var numberFormatter = chart.numberFormatter;
- // Assemble the default name. This can be overridden
- // by legend.options.labelFormatter
- name = '';
- if (typeof from === 'undefined') {
- name = '< ';
- }
- else if (typeof to === 'undefined') {
- name = '> ';
- }
- if (typeof from !== 'undefined') {
- name += numberFormatter(from, valueDecimals) + valueSuffix;
- }
- if (typeof from !== 'undefined' && typeof to !== 'undefined') {
- name += ' - ';
- }
- if (typeof to !== 'undefined') {
- name += numberFormatter(to, valueDecimals) + valueSuffix;
- }
- // Add a mock object to the legend items
- legendItems.push(extend({
- chart: chart,
- name: name,
- options: {},
- drawLegendSymbol: LegendSymbolMixin.drawRectangle,
- visible: true,
- setState: noop,
- isDataClass: true,
- setVisible: function () {
- vis = axis.visible = !vis;
- axis.series.forEach(function (series) {
- series.points.forEach(function (point) {
- if (point.dataClass === i) {
- point.setVisible(vis);
- }
- });
- });
- chart.legend.colorizeItem(this, vis);
- }
- }, dataClass));
- });
- }
- return legendItems;
- };
- /* *
- *
- * Static Functions
- *
- * */
- ColorAxis.defaultLegendLength = 200;
- /**
- * A color axis for series. Visually, the color
- * axis will appear as a gradient or as separate items inside the
- * legend, depending on whether the axis is scalar or based on data
- * classes.
- *
- * For supported color formats, see the
- * [docs article about colors](https://www.highcharts.com/docs/chart-design-and-style/colors).
- *
- * A scalar color axis is represented by a gradient. The colors either
- * range between the [minColor](#colorAxis.minColor) and the
- * [maxColor](#colorAxis.maxColor), or for more fine grained control the
- * colors can be defined in [stops](#colorAxis.stops). Often times, the
- * color axis needs to be adjusted to get the right color spread for the
- * data. In addition to stops, consider using a logarithmic
- * [axis type](#colorAxis.type), or setting [min](#colorAxis.min) and
- * [max](#colorAxis.max) to avoid the colors being determined by
- * outliers.
- *
- * When [dataClasses](#colorAxis.dataClasses) are used, the ranges are
- * subdivided into separate classes like categories based on their
- * values. This can be used for ranges between two values, but also for
- * a true category. However, when your data is categorized, it may be as
- * convenient to add each category to a separate series.
- *
- * Color axis does not work with: `sankey`, `sunburst`, `dependencywheel`,
- * `networkgraph`, `wordcloud`, `venn`, `gauge` and `solidgauge` series
- * types.
- *
- * Since v7.2.0 `colorAxis` can also be an array of options objects.
- *
- * See [the Axis object](/class-reference/Highcharts.Axis) for
- * programmatic access to the axis.
- *
- * @sample {highcharts} highcharts/coloraxis/custom-color-key
- * Column chart with color axis
- * @sample {highcharts} highcharts/coloraxis/horizontal-layout
- * Horizontal layout
- * @sample {highmaps} maps/coloraxis/dataclasscolor
- * With data classes
- * @sample {highmaps} maps/coloraxis/mincolor-maxcolor
- * Min color and max color
- *
- * @extends xAxis
- * @excluding alignTicks, allowDecimals, alternateGridColor, breaks,
- * categories, crosshair, dateTimeLabelFormats, height, left,
- * lineWidth, linkedTo, maxZoom, minRange, minTickInterval,
- * offset, opposite, pane, plotBands, plotLines,
- * reversedStacks, showEmpty, title, top, width, zoomEnabled
- * @product highcharts highstock highmaps
- * @type {*|Array<*>}
- * @optionparent colorAxis
- * @ignore
- */
- ColorAxis.defaultOptions = {
- /**
- * Whether to allow decimals on the color axis.
- * @type {boolean}
- * @default true
- * @product highcharts highstock highmaps
- * @apioption colorAxis.allowDecimals
- */
- /**
- * Determines how to set each data class' color if no individual
- * color is set. The default value, `tween`, computes intermediate
- * colors between `minColor` and `maxColor`. The other possible
- * value, `category`, pulls colors from the global or chart specific
- * [colors](#colors) array.
- *
- * @sample {highmaps} maps/coloraxis/dataclasscolor/
- * Category colors
- *
- * @type {string}
- * @default tween
- * @product highcharts highstock highmaps
- * @validvalue ["tween", "category"]
- * @apioption colorAxis.dataClassColor
- */
- /**
- * An array of data classes or ranges for the choropleth map. If
- * none given, the color axis is scalar and values are distributed
- * as a gradient between the minimum and maximum colors.
- *
- * @sample {highmaps} maps/demo/data-class-ranges/
- * Multiple ranges
- *
- * @sample {highmaps} maps/demo/data-class-two-ranges/
- * Two ranges
- *
- * @type {Array<*>}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.dataClasses
- */
- /**
- * The layout of the color axis. Can be `'horizontal'` or `'vertical'`.
- * If none given, the color axis has the same layout as the legend.
- *
- * @sample highcharts/coloraxis/horizontal-layout/
- * Horizontal color axis layout with vertical legend
- *
- * @type {string|undefined}
- * @since 7.2.0
- * @product highcharts highstock highmaps
- * @apioption colorAxis.layout
- */
- /**
- * The color of each data class. If not set, the color is pulled
- * from the global or chart-specific [colors](#colors) array. In
- * styled mode, this option is ignored. Instead, use colors defined
- * in CSS.
- *
- * @sample {highmaps} maps/demo/data-class-two-ranges/
- * Explicit colors
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.dataClasses.color
- */
- /**
- * The start of the value range that the data class represents,
- * relating to the point value.
- *
- * The range of each `dataClass` is closed in both ends, but can be
- * overridden by the next `dataClass`.
- *
- * @type {number}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.dataClasses.from
- */
- /**
- * The name of the data class as it appears in the legend.
- * If no name is given, it is automatically created based on the
- * `from` and `to` values. For full programmatic control,
- * [legend.labelFormatter](#legend.labelFormatter) can be used.
- * In the formatter, `this.from` and `this.to` can be accessed.
- *
- * @sample {highmaps} maps/coloraxis/dataclasses-name/
- * Named data classes
- *
- * @sample {highmaps} maps/coloraxis/dataclasses-labelformatter/
- * Formatted data classes
- *
- * @type {string}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.dataClasses.name
- */
- /**
- * The end of the value range that the data class represents,
- * relating to the point value.
- *
- * The range of each `dataClass` is closed in both ends, but can be
- * overridden by the next `dataClass`.
- *
- * @type {number}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.dataClasses.to
- */
- /** @ignore-option */
- lineWidth: 0,
- /**
- * Padding of the min value relative to the length of the axis. A
- * padding of 0.05 will make a 100px axis 5px longer.
- *
- * @product highcharts highstock highmaps
- */
- minPadding: 0,
- /**
- * The maximum value of the axis in terms of map point values. If
- * `null`, the max value is automatically calculated. If the
- * `endOnTick` option is true, the max value might be rounded up.
- *
- * @sample {highmaps} maps/coloraxis/gridlines/
- * Explicit min and max to reduce the effect of outliers
- *
- * @type {number}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.max
- */
- /**
- * The minimum value of the axis in terms of map point values. If
- * `null`, the min value is automatically calculated. If the
- * `startOnTick` option is true, the min value might be rounded
- * down.
- *
- * @sample {highmaps} maps/coloraxis/gridlines/
- * Explicit min and max to reduce the effect of outliers
- *
- * @type {number}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.min
- */
- /**
- * Padding of the max value relative to the length of the axis. A
- * padding of 0.05 will make a 100px axis 5px longer.
- *
- * @product highcharts highstock highmaps
- */
- maxPadding: 0,
- /**
- * Color of the grid lines extending from the axis across the
- * gradient.
- *
- * @sample {highmaps} maps/coloraxis/gridlines/
- * Grid lines demonstrated
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @default #e6e6e6
- * @product highcharts highstock highmaps
- * @apioption colorAxis.gridLineColor
- */
- /**
- * The width of the grid lines extending from the axis across the
- * gradient of a scalar color axis.
- *
- * @sample {highmaps} maps/coloraxis/gridlines/
- * Grid lines demonstrated
- *
- * @product highcharts highstock highmaps
- */
- gridLineWidth: 1,
- /**
- * The interval of the tick marks in axis units. When `null`, the
- * tick interval is computed to approximately follow the
- * `tickPixelInterval`.
- *
- * @type {number}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.tickInterval
- */
- /**
- * If [tickInterval](#colorAxis.tickInterval) is `null` this option
- * sets the approximate pixel interval of the tick marks.
- *
- * @product highcharts highstock highmaps
- */
- tickPixelInterval: 72,
- /**
- * Whether to force the axis to start on a tick. Use this option
- * with the `maxPadding` option to control the axis start.
- *
- * @product highcharts highstock highmaps
- */
- startOnTick: true,
- /**
- * Whether to force the axis to end on a tick. Use this option with
- * the [maxPadding](#colorAxis.maxPadding) option to control the
- * axis end.
- *
- * @product highcharts highstock highmaps
- */
- endOnTick: true,
- /** @ignore */
- offset: 0,
- /**
- * The triangular marker on a scalar color axis that points to the
- * value of the hovered area. To disable the marker, set
- * `marker: null`.
- *
- * @sample {highmaps} maps/coloraxis/marker/
- * Black marker
- *
- * @declare Highcharts.PointMarkerOptionsObject
- * @product highcharts highstock highmaps
- */
- marker: {
- /**
- * Animation for the marker as it moves between values. Set to
- * `false` to disable animation. Defaults to `{ duration: 50 }`.
- *
- * @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
- * @product highcharts highstock highmaps
- */
- animation: {
- /** @internal */
- duration: 50
- },
- /** @internal */
- width: 0.01,
- /**
- * The color of the marker.
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @product highcharts highstock highmaps
- */
- color: palette.neutralColor40
- },
- /**
- * The axis labels show the number for each tick.
- *
- * For more live examples on label options, see [xAxis.labels in the
- * Highcharts API.](/highcharts#xAxis.labels)
- *
- * @extends xAxis.labels
- * @product highcharts highstock highmaps
- */
- labels: {
- /**
- * How to handle overflowing labels on horizontal color axis. If set
- * to `"allow"`, it will not be aligned at all. By default it
- * `"justify"` labels inside the chart area. If there is room to
- * move it, it will be aligned to the edge, else it will be removed.
- *
- * @validvalue ["allow", "justify"]
- * @product highcharts highstock highmaps
- */
- overflow: 'justify',
- rotation: 0
- },
- /**
- * The color to represent the minimum of the color axis. Unless
- * [dataClasses](#colorAxis.dataClasses) or
- * [stops](#colorAxis.stops) are set, the gradient starts at this
- * value.
- *
- * If dataClasses are set, the color is based on minColor and
- * maxColor unless a color is set for each data class, or the
- * [dataClassColor](#colorAxis.dataClassColor) is set.
- *
- * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
- * Min and max colors on scalar (gradient) axis
- * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
- * On data classes
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @product highcharts highstock highmaps
- */
- minColor: palette.highlightColor10,
- /**
- * The color to represent the maximum of the color axis. Unless
- * [dataClasses](#colorAxis.dataClasses) or
- * [stops](#colorAxis.stops) are set, the gradient ends at this
- * value.
- *
- * If dataClasses are set, the color is based on minColor and
- * maxColor unless a color is set for each data class, or the
- * [dataClassColor](#colorAxis.dataClassColor) is set.
- *
- * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
- * Min and max colors on scalar (gradient) axis
- * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
- * On data classes
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @product highcharts highstock highmaps
- */
- maxColor: palette.highlightColor100,
- /**
- * Color stops for the gradient of a scalar color axis. Use this in
- * cases where a linear gradient between a `minColor` and `maxColor`
- * is not sufficient. The stops is an array of tuples, where the
- * first item is a float between 0 and 1 assigning the relative
- * position in the gradient, and the second item is the color.
- *
- * @sample {highmaps} maps/demo/heatmap/
- * Heatmap with three color stops
- *
- * @type {Array<Array<number,Highcharts.ColorString>>}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.stops
- */
- /**
- * The pixel length of the main tick marks on the color axis.
- */
- tickLength: 5,
- /**
- * The type of interpolation to use for the color axis. Can be
- * `linear` or `logarithmic`.
- *
- * @sample highcharts/coloraxis/logarithmic-with-emulate-negative-values/
- * Logarithmic color axis with extension to emulate negative
- * values
- *
- * @type {Highcharts.ColorAxisTypeValue}
- * @default linear
- * @product highcharts highstock highmaps
- * @apioption colorAxis.type
- */
- /**
- * Whether to reverse the axis so that the highest number is closest
- * to the origin. Defaults to `false` in a horizontal legend and
- * `true` in a vertical legend, where the smallest value starts on
- * top.
- *
- * @type {boolean}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.reversed
- */
- /**
- * @product highcharts highstock highmaps
- * @excluding afterBreaks, pointBreak, pointInBreak
- * @apioption colorAxis.events
- */
- /**
- * Fires when the legend item belonging to the colorAxis is clicked.
- * One parameter, `event`, is passed to the function.
- *
- * @type {Function}
- * @product highcharts highstock highmaps
- * @apioption colorAxis.events.legendItemClick
- */
- /**
- * Whether to display the colorAxis in the legend.
- *
- * @sample highcharts/coloraxis/hidden-coloraxis-with-3d-chart/
- * Hidden color axis with 3d chart
- *
- * @see [heatmap.showInLegend](#series.heatmap.showInLegend)
- *
- * @since 4.2.7
- * @product highcharts highstock highmaps
- */
- showInLegend: true
- };
- /**
- * @private
- */
- ColorAxis.keepProps = [
- 'legendGroup',
- 'legendItemHeight',
- 'legendItemWidth',
- 'legendItem',
- 'legendSymbol'
- ];
- return ColorAxis;
- }(Axis));
- // Properties to preserve after destroy, for Axis.update (#5881, #6025).
- Array.prototype.push.apply(Axis.keepProps, ColorAxis.keepProps);
- H.ColorAxis = ColorAxis;
- /**
- * Handle animation of the color attributes directly
- *
- * @private
- * @function Highcharts.Fx#fillSetter
- */ /**
- * Handle animation of the color attributes directly
- *
- * @private
- * @function Highcharts.Fx#strokeSetter
- */
- ['fill', 'stroke'].forEach(function (prop) {
- Fx.prototype[prop + 'Setter'] = function () {
- this.elem.attr(prop, color(this.start).tweenTo(color(this.end), this.pos), null, true);
- };
- });
- // Extend the chart getAxes method to also get the color axis
- addEvent(Chart, 'afterGetAxes', function () {
- var chart = this,
- options = chart.options;
- this.colorAxis = [];
- if (options.colorAxis) {
- options.colorAxis = splat(options.colorAxis);
- options.colorAxis.forEach(function (axisOptions, i) {
- axisOptions.index = i;
- new ColorAxis(chart, axisOptions); // eslint-disable-line no-new
- });
- }
- });
- // Add colorAxis to series axisTypes
- addEvent(Series, 'bindAxes', function () {
- var axisTypes = this.axisTypes;
- if (!axisTypes) {
- this.axisTypes = ['colorAxis'];
- }
- else if (axisTypes.indexOf('colorAxis') === -1) {
- axisTypes.push('colorAxis');
- }
- });
- // Add the color axis. This also removes the axis' own series to prevent
- // them from showing up individually.
- addEvent(Legend, 'afterGetAllItems', function (e) {
- var colorAxisItems = [],
- colorAxes = this.chart.colorAxis || [],
- options,
- i;
- colorAxes.forEach(function (colorAxis) {
- options = colorAxis.options;
- if (options && options.showInLegend) {
- // Data classes
- if (options.dataClasses && options.visible) {
- colorAxisItems = colorAxisItems.concat(colorAxis.getDataClassLegendSymbols());
- // Gradient legend
- }
- else if (options.visible) {
- // Add this axis on top
- colorAxisItems.push(colorAxis);
- }
- // If dataClasses are defined or showInLegend option is not set to
- // true, do not add color axis' series to legend.
- colorAxis.series.forEach(function (series) {
- if (!series.options.showInLegend || options.dataClasses) {
- if (series.options.legendType === 'point') {
- series.points.forEach(function (point) {
- erase(e.allItems, point);
- });
- }
- else {
- erase(e.allItems, series);
- }
- }
- });
- }
- });
- i = colorAxisItems.length;
- while (i--) {
- e.allItems.unshift(colorAxisItems[i]);
- }
- });
- addEvent(Legend, 'afterColorizeItem', function (e) {
- if (e.visible && e.item.legendColor) {
- e.item.legendSymbol.attr({
- fill: e.item.legendColor
- });
- }
- });
- // Updates in the legend need to be reflected in the color axis (6888)
- addEvent(Legend, 'afterUpdate', function () {
- var colorAxes = this.chart.colorAxis;
- if (colorAxes) {
- colorAxes.forEach(function (colorAxis) {
- colorAxis.update({}, arguments[2]);
- });
- }
- });
- // Calculate and set colors for points
- addEvent(Series, 'afterTranslate', function () {
- if (this.chart.colorAxis &&
- this.chart.colorAxis.length ||
- this.colorAttribs) {
- this.translateColors();
- }
- });
- return ColorAxis;
- });
- _registerModule(_modules, 'Mixins/ColorMapSeries.js', [_modules['Core/Globals.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (H, Point, U) {
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- var defined = U.defined;
- var noop = H.noop,
- seriesTypes = H.seriesTypes;
- /**
- * Mixin for maps and heatmaps
- *
- * @private
- * @mixin Highcharts.colorMapPointMixin
- */
- var colorMapPointMixin = {
- dataLabelOnNull: true,
- /* eslint-disable valid-jsdoc */
- /**
- * Color points have a value option that determines whether or not it is
- * a null point
- * @private
- */
- isValid: function () {
- // undefined is allowed
- return (this.value !== null &&
- this.value !== Infinity &&
- this.value !== -Infinity);
- },
- /**
- * @private
- */
- setState: function (state) {
- Point.prototype.setState.call(this, state);
- if (this.graphic) {
- this.graphic.attr({
- zIndex: state === 'hover' ? 1 : 0
- });
- }
- }
- /* eslint-enable valid-jsdoc */
- };
- /**
- * @private
- * @mixin Highcharts.colorMapSeriesMixin
- */
- var colorMapSeriesMixin = {
- pointArrayMap: ['value'],
- axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
- trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
- getSymbol: noop,
- parallelArrays: ['x', 'y', 'value'],
- colorKey: 'value',
- pointAttribs: seriesTypes.column.prototype.pointAttribs,
- /* eslint-disable valid-jsdoc */
- /**
- * Get the color attibutes to apply on the graphic
- * @private
- * @function Highcharts.colorMapSeriesMixin.colorAttribs
- * @param {Highcharts.Point} point
- * @return {Highcharts.SVGAttributes}
- */
- colorAttribs: function (point) {
- var ret = {};
- if (defined(point.color)) {
- ret[this.colorProp || 'fill'] = point.color;
- }
- return ret;
- }
- };
- var exports = {
- colorMapPointMixin: colorMapPointMixin,
- colorMapSeriesMixin: colorMapSeriesMixin
- };
- return exports;
- });
- _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d,
- b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d,
- b) { d.__proto__ = b; }) ||
- function (d,
- b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
- var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
- var clamp = U.clamp,
- extend = U.extend,
- pick = U.pick;
- /* *
- *
- * Class
- *
- * */
- var HeatmapPoint = /** @class */ (function (_super) {
- __extends(HeatmapPoint, _super);
- function HeatmapPoint() {
- /* *
- *
- * Properties
- *
- * */
- var _this = _super !== null && _super.apply(this,
- arguments) || this;
- _this.options = void 0;
- _this.series = void 0;
- _this.value = void 0;
- _this.x = void 0;
- _this.y = void 0;
- return _this;
- /* eslint-enable valid-jsdoc */
- }
- /* *
- *
- * Functions
- *
- * */
- /* eslint-disable valid-jsdoc */
- /**
- * @private
- */
- HeatmapPoint.prototype.applyOptions = function (options, x) {
- var point = _super.prototype.applyOptions.call(this,
- options,
- x);
- point.formatPrefix = point.isNull || point.value === null ? 'null' : 'point';
- return point;
- };
- HeatmapPoint.prototype.getCellAttributes = function () {
- var point = this,
- series = point.series,
- seriesOptions = series.options,
- xPad = (seriesOptions.colsize || 1) / 2,
- yPad = (seriesOptions.rowsize || 1) / 2,
- xAxis = series.xAxis,
- yAxis = series.yAxis,
- markerOptions = point.options.marker || series.options.marker,
- pointPlacement = series.pointPlacementToXValue(), // #7860
- pointPadding = pick(point.pointPadding,
- seriesOptions.pointPadding, 0),
- cellAttr = {
- x1: clamp(Math.round(xAxis.len -
- (xAxis.translate(point.x - xPad,
- false,
- true,
- false,
- true, -pointPlacement) || 0)), -xAxis.len, 2 * xAxis.len),
- x2: clamp(Math.round(xAxis.len -
- (xAxis.translate(point.x + xPad,
- false,
- true,
- false,
- true, -pointPlacement) || 0)), -xAxis.len, 2 * xAxis.len),
- y1: clamp(Math.round((yAxis.translate(point.y - yPad,
- false,
- true,
- false,
- true) || 0)), -yAxis.len, 2 * yAxis.len),
- y2: clamp(Math.round((yAxis.translate(point.y + yPad,
- false,
- true,
- false,
- true) || 0)), -yAxis.len, 2 * yAxis.len)
- };
- // Handle marker's fixed width, and height values including border
- // and pointPadding while calculating cell attributes.
- [['width', 'x'], ['height', 'y']].forEach(function (dimension) {
- var prop = dimension[0],
- direction = dimension[1];
- var start = direction + '1', end = direction + '2';
- var side = Math.abs(cellAttr[start] - cellAttr[end]),
- borderWidth = markerOptions &&
- markerOptions.lineWidth || 0,
- plotPos = Math.abs(cellAttr[start] + cellAttr[end]) / 2;
- if (markerOptions[prop] &&
- markerOptions[prop] < side) {
- cellAttr[start] = plotPos - (markerOptions[prop] / 2) -
- (borderWidth / 2);
- cellAttr[end] = plotPos + (markerOptions[prop] / 2) +
- (borderWidth / 2);
- }
- // Handle pointPadding
- if (pointPadding) {
- if (direction === 'y') {
- start = end;
- end = direction + '1';
- }
- cellAttr[start] += pointPadding;
- cellAttr[end] -= pointPadding;
- }
- });
- return cellAttr;
- };
- /**
- * @private
- */
- HeatmapPoint.prototype.haloPath = function (size) {
- if (!size) {
- return [];
- }
- var rect = this.shapeArgs;
- return [
- 'M',
- rect.x - size,
- rect.y - size,
- 'L',
- rect.x - size,
- rect.y + rect.height + size,
- rect.x + rect.width + size,
- rect.y + rect.height + size,
- rect.x + rect.width + size,
- rect.y - size,
- 'Z'
- ];
- };
- /**
- * Color points have a value option that determines whether or not it is
- * a null point
- * @private
- */
- HeatmapPoint.prototype.isValid = function () {
- // undefined is allowed
- return (this.value !== Infinity &&
- this.value !== -Infinity);
- };
- return HeatmapPoint;
- }(ScatterPoint));
- extend(HeatmapPoint.prototype, {
- dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
- setState: colorMapPointMixin.setState
- });
- /* *
- *
- * Default Export
- *
- * */
- return HeatmapPoint;
- });
- _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) {
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d,
- b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d,
- b) { d.__proto__ = b; }) ||
- function (d,
- b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
- var noop = H.noop;
- var Series = SeriesRegistry.series,
- _a = SeriesRegistry.seriesTypes,
- ColumnSeries = _a.column,
- ScatterSeries = _a.scatter;
- var symbols = SVGRenderer.prototype.symbols;
- var extend = U.extend,
- fireEvent = U.fireEvent,
- isNumber = U.isNumber,
- merge = U.merge,
- pick = U.pick;
- /* *
- *
- * Class
- *
- * */
- /**
- * @private
- * @class
- * @name Highcharts.seriesTypes.heatmap
- *
- * @augments Highcharts.Series
- */
- var HeatmapSeries = /** @class */ (function (_super) {
- __extends(HeatmapSeries, _super);
- function HeatmapSeries() {
- /* *
- *
- * Static Properties
- *
- * */
- var _this = _super !== null && _super.apply(this,
- arguments) || this;
- /* *
- *
- * Properties
- *
- * */
- _this.colorAxis = void 0;
- _this.data = void 0;
- _this.options = void 0;
- _this.points = void 0;
- _this.valueMax = NaN;
- _this.valueMin = NaN;
- return _this;
- /* eslint-enable valid-jsdoc */
- }
- /* *
- *
- * Functions
- *
- * */
- /* eslint-disable valid-jsdoc */
- /**
- * @private
- */
- HeatmapSeries.prototype.drawPoints = function () {
- var _this = this;
- // In styled mode, use CSS, otherwise the fill used in the style
- // sheet will take precedence over the fill attribute.
- var seriesMarkerOptions = this.options.marker || {};
- if (seriesMarkerOptions.enabled || this._hasPointMarkers) {
- Series.prototype.drawPoints.call(this);
- this.points.forEach(function (point) {
- point.graphic &&
- point.graphic[_this.chart.styledMode ? 'css' : 'animate'](_this.colorAttribs(point));
- });
- }
- };
- /**
- * @private
- */
- HeatmapSeries.prototype.getExtremes = function () {
- // Get the extremes from the value data
- var _a = Series.prototype.getExtremes
- .call(this,
- this.valueData),
- dataMin = _a.dataMin,
- dataMax = _a.dataMax;
- if (isNumber(dataMin)) {
- this.valueMin = dataMin;
- }
- if (isNumber(dataMax)) {
- this.valueMax = dataMax;
- }
- // Get the extremes from the y data
- return Series.prototype.getExtremes.call(this);
- };
- /**
- * Override to also allow null points, used when building the k-d-tree for
- * tooltips in boost mode.
- * @private
- */
- HeatmapSeries.prototype.getValidPoints = function (points, insideOnly) {
- return Series.prototype.getValidPoints.call(this, points, insideOnly, true);
- };
- /**
- * Define hasData function for non-cartesian series. Returns true if the
- * series has points at all.
- * @private
- */
- HeatmapSeries.prototype.hasData = function () {
- return !!this.processedXData.length; // != 0
- };
- /**
- * Override the init method to add point ranges on both axes.
- * @private
- */
- HeatmapSeries.prototype.init = function () {
- var options;
- Series.prototype.init.apply(this, arguments);
- options = this.options;
- // #3758, prevent resetting in setData
- options.pointRange = pick(options.pointRange, options.colsize || 1);
- // general point range
- this.yAxis.axisPointRange = options.rowsize || 1;
- // Bind new symbol names
- extend(symbols, {
- ellipse: symbols.circle,
- rect: symbols.square
- });
- };
- /**
- * @private
- */
- HeatmapSeries.prototype.markerAttribs = function (point, state) {
- var pointMarkerOptions = point.marker || {},
- seriesMarkerOptions = this.options.marker || {},
- seriesStateOptions,
- pointStateOptions,
- shapeArgs = point.shapeArgs || {},
- hasImage = point.hasImage,
- attribs = {};
- if (hasImage) {
- return {
- x: point.plotX,
- y: point.plotY
- };
- }
- // Setting width and height attributes on image does not affect
- // on its dimensions.
- if (state) {
- seriesStateOptions = seriesMarkerOptions.states[state] || {};
- pointStateOptions = pointMarkerOptions.states &&
- pointMarkerOptions.states[state] || {};
- [['width', 'x'], ['height', 'y']].forEach(function (dimension) {
- // Set new width and height basing on state options.
- attribs[dimension[0]] = (pointStateOptions[dimension[0]] ||
- seriesStateOptions[dimension[0]] ||
- shapeArgs[dimension[0]]) + (pointStateOptions[dimension[0] + 'Plus'] ||
- seriesStateOptions[dimension[0] + 'Plus'] || 0);
- // Align marker by a new size.
- attribs[dimension[1]] = shapeArgs[dimension[1]] +
- (shapeArgs[dimension[0]] - attribs[dimension[0]]) / 2;
- });
- }
- return state ? attribs : shapeArgs;
- };
- /**
- * @private
- */
- HeatmapSeries.prototype.pointAttribs = function (point, state) {
- var series = this,
- attr = Series.prototype.pointAttribs.call(series,
- point,
- state),
- seriesOptions = series.options || {},
- plotOptions = series.chart.options.plotOptions || {},
- seriesPlotOptions = plotOptions.series || {},
- heatmapPlotOptions = plotOptions.heatmap || {},
- stateOptions,
- brightness,
- // Get old properties in order to keep backward compatibility
- borderColor = seriesOptions.borderColor ||
- heatmapPlotOptions.borderColor ||
- seriesPlotOptions.borderColor,
- borderWidth = seriesOptions.borderWidth ||
- heatmapPlotOptions.borderWidth ||
- seriesPlotOptions.borderWidth ||
- attr['stroke-width'];
- // Apply lineColor, or set it to default series color.
- attr.stroke = ((point && point.marker && point.marker.lineColor) ||
- (seriesOptions.marker && seriesOptions.marker.lineColor) ||
- borderColor ||
- this.color);
- // Apply old borderWidth property if exists.
- attr['stroke-width'] = borderWidth;
- if (state) {
- stateOptions =
- merge(seriesOptions.states[state], seriesOptions.marker &&
- seriesOptions.marker.states[state], point &&
- point.options.states &&
- point.options.states[state] || {});
- brightness = stateOptions.brightness;
- attr.fill =
- stateOptions.color ||
- H.color(attr.fill).brighten(brightness || 0).get();
- attr.stroke = stateOptions.lineColor;
- }
- return attr;
- };
- /**
- * @private
- */
- HeatmapSeries.prototype.setClip = function (animation) {
- var series = this,
- chart = series.chart;
- Series.prototype.setClip.apply(series, arguments);
- if (series.options.clip !== false || animation) {
- series.markerGroup
- .clip((animation || series.clipBox) && series.sharedClipKey ?
- chart[series.sharedClipKey] :
- chart.clipRect);
- }
- };
- /**
- * @private
- */
- HeatmapSeries.prototype.translate = function () {
- 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;
- series.generatePoints();
- series.points.forEach(function (point) {
- var pointAttr,
- sizeDiff,
- hasImage,
- cellAttr = point.getCellAttributes(),
- shapeArgs = {
- x: Math.min(cellAttr.x1,
- cellAttr.x2),
- y: Math.min(cellAttr.y1,
- cellAttr.y2),
- width: Math.max(Math.abs(cellAttr.x2 - cellAttr.x1), 0),
- height: Math.max(Math.abs(cellAttr.y2 - cellAttr.y1), 0)
- };
- hasImage = point.hasImage =
- (point.marker && point.marker.symbol || symbol || '')
- .indexOf('url') === 0;
- // If marker shape is regular (symetric), find shorter
- // cell's side.
- if (hasRegularShape) {
- sizeDiff = Math.abs(shapeArgs.width - shapeArgs.height);
- shapeArgs.x = Math.min(cellAttr.x1, cellAttr.x2) +
- (shapeArgs.width < shapeArgs.height ? 0 : sizeDiff / 2);
- shapeArgs.y = Math.min(cellAttr.y1, cellAttr.y2) +
- (shapeArgs.width < shapeArgs.height ? sizeDiff / 2 : 0);
- shapeArgs.width = shapeArgs.height =
- Math.min(shapeArgs.width, shapeArgs.height);
- }
- pointAttr = {
- plotX: (cellAttr.x1 + cellAttr.x2) / 2,
- plotY: (cellAttr.y1 + cellAttr.y2) / 2,
- clientX: (cellAttr.x1 + cellAttr.x2) / 2,
- shapeType: 'path',
- shapeArgs: merge(true, shapeArgs, {
- d: symbols[shape](shapeArgs.x, shapeArgs.y, shapeArgs.width, shapeArgs.height)
- })
- };
- if (hasImage) {
- point.marker = {
- width: shapeArgs.width,
- height: shapeArgs.height
- };
- }
- extend(point, pointAttr);
- });
- fireEvent(series, 'afterTranslate');
- };
- /**
- * A heatmap is a graphical representation of data where the individual
- * values contained in a matrix are represented as colors.
- *
- * @productdesc {highcharts}
- * Requires `modules/heatmap`.
- *
- * @sample highcharts/demo/heatmap/
- * Simple heatmap
- * @sample highcharts/demo/heatmap-canvas/
- * Heavy heatmap
- *
- * @extends plotOptions.scatter
- * @excluding animationLimit, connectEnds, connectNulls, cropThreshold,
- * dashStyle, findNearestPointBy, getExtremesFromAll, jitter,
- * linecap, lineWidth, pointInterval, pointIntervalUnit,
- * pointRange, pointStart, shadow, softThreshold, stacking,
- * step, threshold, cluster
- * @product highcharts highmaps
- * @optionparent plotOptions.heatmap
- */
- HeatmapSeries.defaultOptions = merge(ScatterSeries.defaultOptions, {
- /**
- * Animation is disabled by default on the heatmap series.
- */
- animation: false,
- /**
- * The border width for each heat map item.
- */
- borderWidth: 0,
- /**
- * Padding between the points in the heatmap.
- *
- * @type {number}
- * @default 0
- * @since 6.0
- * @apioption plotOptions.heatmap.pointPadding
- */
- /**
- * @default value
- * @apioption plotOptions.heatmap.colorKey
- */
- /**
- * The main color of the series. In heat maps this color is rarely used,
- * as we mostly use the color to denote the value of each point. Unless
- * options are set in the [colorAxis](#colorAxis), the default value
- * is pulled from the [options.colors](#colors) array.
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @since 4.0
- * @product highcharts
- * @apioption plotOptions.heatmap.color
- */
- /**
- * The column size - how many X axis units each column in the heatmap
- * should span.
- *
- * @sample {highcharts} maps/demo/heatmap/
- * One day
- * @sample {highmaps} maps/demo/heatmap/
- * One day
- *
- * @type {number}
- * @default 1
- * @since 4.0
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.colsize
- */
- /**
- * The row size - how many Y axis units each heatmap row should span.
- *
- * @sample {highcharts} maps/demo/heatmap/
- * 1 by default
- * @sample {highmaps} maps/demo/heatmap/
- * 1 by default
- *
- * @type {number}
- * @default 1
- * @since 4.0
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.rowsize
- */
- /**
- * The color applied to null points. In styled mode, a general CSS class
- * is applied instead.
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- */
- nullColor: palette.neutralColor3,
- dataLabels: {
- formatter: function () {
- return this.point.value;
- },
- inside: true,
- verticalAlign: 'middle',
- crop: false,
- overflow: false,
- padding: 0 // #3837
- },
- /**
- * @excluding radius, enabledThreshold
- * @since 8.1
- */
- marker: {
- /**
- * A predefined shape or symbol for the marker. When undefined, the
- * symbol is pulled from options.symbols. Other possible values are
- * `'circle'`, `'square'`,`'diamond'`, `'triangle'`,
- * `'triangle-down'`, `'rect'`, and `'ellipse'`.
- *
- * Additionally, the URL to a graphic can be given on this form:
- * `'url(graphic.png)'`. Note that for the image to be applied to
- * exported charts, its URL needs to be accessible by the export
- * server.
- *
- * Custom callbacks for symbol path generation can also be added to
- * `Highcharts.SVGRenderer.prototype.symbols`. The callback is then
- * used by its method name, as shown in the demo.
- *
- * @sample {highcharts} highcharts/plotoptions/series-marker-symbol/
- * Predefined, graphic and custom markers
- * @sample {highstock} highcharts/plotoptions/series-marker-symbol/
- * Predefined, graphic and custom markers
- */
- symbol: 'rect',
- /** @ignore-option */
- radius: 0,
- lineColor: void 0,
- states: {
- /**
- * @excluding radius, radiusPlus
- */
- hover: {
- /**
- * Set the marker's fixed width on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.hover.width
- */
- /**
- * Set the marker's fixed height on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.hover.height
- */
- /**
- * The number of pixels to increase the width of the
- * selected point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * 20px greater width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.hover.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * selected point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * 20px greater width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.hover.heightPlus
- */
- /**
- * The additional line width for a hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
- * 5 pixels wider lineWidth on hover
- * @sample {highmaps} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
- * 5 pixels wider lineWidth on hover
- */
- lineWidthPlus: 0
- },
- /**
- * @excluding radius
- */
- select: {
- /**
- * Set the marker's fixed width on select state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.select.width
- */
- /**
- * Set the marker's fixed height on select state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.select.height
- */
- /**
- * The number of pixels to increase the width of the
- * selected point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * 20px greater width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.select.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * selected point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * 20px greater width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption plotOptions.heatmap.marker.states.select.heightPlus
- */
- }
- }
- },
- clip: true,
- /** @ignore-option */
- pointRange: null,
- tooltip: {
- pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
- },
- states: {
- hover: {
- /** @ignore-option */
- halo: false,
- /**
- * How much to brighten the point on interaction. Requires the
- * main color to be defined in hex or rgb(a) format.
- *
- * In styled mode, the hover brightening is by default replaced
- * with a fill-opacity set in the `.highcharts-point:hover`
- * rule.
- */
- brightness: 0.2
- }
- }
- });
- return HeatmapSeries;
- }(ScatterSeries));
- extend(HeatmapSeries.prototype, {
- /**
- * @private
- */
- alignDataLabel: ColumnSeries.prototype.alignDataLabel,
- axisTypes: colorMapSeriesMixin.axisTypes,
- colorAttribs: colorMapSeriesMixin.colorAttribs,
- colorKey: colorMapSeriesMixin.colorKey,
- directTouch: true,
- /**
- * @private
- */
- drawLegendSymbol: LegendSymbolMixin.drawRectangle,
- /**
- * @ignore
- * @deprecated
- */
- getBox: noop,
- getExtremesFromAll: true,
- getSymbol: Series.prototype.getSymbol,
- hasPointSpecificOptions: true,
- parallelArrays: colorMapSeriesMixin.parallelArrays,
- pointArrayMap: ['y', 'value'],
- pointClass: HeatmapPoint,
- trackerGroups: colorMapSeriesMixin.trackerGroups
- });
- SeriesRegistry.registerSeriesType('heatmap', HeatmapSeries);
- /* *
- *
- * Default Export
- *
- * */
- /* *
- *
- * API Declarations
- *
- * */
- /**
- * Heatmap series only. Padding between the points in the heatmap.
- * @name Highcharts.Point#pointPadding
- * @type {number|undefined}
- */
- /**
- * Heatmap series only. The value of the point, resulting in a color
- * controled by options as set in the colorAxis configuration.
- * @name Highcharts.Point#value
- * @type {number|null|undefined}
- */
- /* *
- * @interface Highcharts.PointOptionsObject in parts/Point.ts
- */ /**
- * Heatmap series only. Point padding for a single point.
- * @name Highcharts.PointOptionsObject#pointPadding
- * @type {number|undefined}
- */ /**
- * Heatmap series only. The value of the point, resulting in a color controled
- * by options as set in the colorAxis configuration.
- * @name Highcharts.PointOptionsObject#value
- * @type {number|null|undefined}
- */
- ''; // detach doclets above
- /* *
- *
- * API Options
- *
- * */
- /**
- * A `heatmap` series. If the [type](#series.heatmap.type) option is
- * not specified, it is inherited from [chart.type](#chart.type).
- *
- * @productdesc {highcharts}
- * Requires `modules/heatmap`.
- *
- * @extends series,plotOptions.heatmap
- * @excluding cropThreshold, dataParser, dataURL, pointRange, stack,
- * @product highcharts highmaps
- * @apioption series.heatmap
- */
- /**
- * An array of data points for the series. For the `heatmap` series
- * type, points can be given in the following ways:
- *
- * 1. An array of arrays with 3 or 2 values. In this case, the values
- * correspond to `x,y,value`. If the first value is a string, it is
- * applied as the name of the point, and the `x` value is inferred.
- * The `x` value can also be omitted, in which case the inner arrays
- * should be of length 2\. Then the `x` value is automatically calculated,
- * either starting at 0 and incremented by 1, or from `pointStart`
- * and `pointInterval` given in the series options.
- *
- * ```js
- * data: [
- * [0, 9, 7],
- * [1, 10, 4],
- * [2, 6, 3]
- * ]
- * ```
- *
- * 2. An array of objects with named values. The following snippet shows only a
- * few settings, see the complete options set below. If the total number of data
- * points exceeds the series' [turboThreshold](#series.heatmap.turboThreshold),
- * this option is not available.
- *
- * ```js
- * data: [{
- * x: 1,
- * y: 3,
- * value: 10,
- * name: "Point2",
- * color: "#00FF00"
- * }, {
- * x: 1,
- * y: 7,
- * value: 10,
- * name: "Point1",
- * color: "#FF00FF"
- * }]
- * ```
- *
- * @sample {highcharts} highcharts/chart/reflow-true/
- * Numerical values
- * @sample {highcharts} highcharts/series/data-array-of-arrays/
- * Arrays of numeric x and y
- * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
- * Arrays of datetime x and y
- * @sample {highcharts} highcharts/series/data-array-of-name-value/
- * Arrays of point.name and y
- * @sample {highcharts} highcharts/series/data-array-of-objects/
- * Config objects
- *
- * @type {Array<Array<number>|*>}
- * @extends series.line.data
- * @product highcharts highmaps
- * @apioption series.heatmap.data
- */
- /**
- * The color of the point. In heat maps the point color is rarely set
- * explicitly, as we use the color to denote the `value`. Options for
- * this are set in the [colorAxis](#colorAxis) configuration.
- *
- * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
- * @product highcharts highmaps
- * @apioption series.heatmap.data.color
- */
- /**
- * The value of the point, resulting in a color controled by options
- * as set in the [colorAxis](#colorAxis) configuration.
- *
- * @type {number}
- * @product highcharts highmaps
- * @apioption series.heatmap.data.value
- */
- /**
- * The x value of the point. For datetime axes,
- * the X value is the timestamp in milliseconds since 1970.
- *
- * @type {number}
- * @product highcharts highmaps
- * @apioption series.heatmap.data.x
- */
- /**
- * The y value of the point.
- *
- * @type {number}
- * @product highcharts highmaps
- * @apioption series.heatmap.data.y
- */
- /**
- * Point padding for a single point.
- *
- * @sample maps/plotoptions/tilemap-pointpadding
- * Point padding on tiles
- *
- * @type {number}
- * @product highcharts highmaps
- * @apioption series.heatmap.data.pointPadding
- */
- /**
- * @excluding radius, enabledThreshold
- * @product highcharts highmaps
- * @since 8.1
- * @apioption series.heatmap.data.marker
- */
- /**
- * @excluding radius, enabledThreshold
- * @product highcharts highmaps
- * @since 8.1
- * @apioption series.heatmap.marker
- */
- /**
- * @excluding radius, radiusPlus
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover
- */
- /**
- * @excluding radius
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.select
- */
- /**
- * @excluding radius, radiusPlus
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.hover
- */
- /**
- * @excluding radius
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.select
- */
- /**
- * Set the marker's fixed width on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
- * 5 pixels wider lineWidth on hover
- *
- * @type {number|undefined}
- * @default 0
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover.lineWidthPlus
- */
- /**
- * Set the marker's fixed width on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover.width
- */
- /**
- * Set the marker's fixed height on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover.height
- */
- /**
- * The number of pixels to increase the width of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.hover.heightPlus
- */
- /**
- * The number of pixels to increase the width of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.select.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.marker.states.select.heightPlus
- */
- /**
- * Set the marker's fixed width on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-linewidthplus
- * 5 pixels wider lineWidth on hover
- *
- * @type {number|undefined}
- * @default 0
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.hover.lineWidthPlus
- */
- /**
- * Set the marker's fixed width on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.hover.width
- */
- /**
- * Set the marker's fixed height on hover state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.hover.height
- */
- /**
- * The number of pixels to increase the width of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highstock
- * @apioption series.heatmap.data.marker.states.hover.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highstock
- * @apioption series.heatmap.data.marker.states.hover.heightPlus
- */
- /**
- * Set the marker's fixed width on select state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.select.width
- */
- /**
- * Set the marker's fixed height on select state.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-width
- * 70px fixed marker's width and height on hover
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highmaps
- * @apioption series.heatmap.data.marker.states.select.height
- */
- /**
- * The number of pixels to increase the width of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highstock
- * @apioption series.heatmap.data.marker.states.select.widthPlus
- */
- /**
- * The number of pixels to increase the height of the
- * hovered point.
- *
- * @sample {highcharts} maps/plotoptions/heatmap-marker-states-hover-widthplus
- * One day
- *
- * @type {number|undefined}
- * @default undefined
- * @product highcharts highstock
- * @apioption series.heatmap.data.marker.states.select.heightPlus
- */
- ''; // adds doclets above to transpiled file
- return HeatmapSeries;
- });
- _registerModule(_modules, 'masters/modules/heatmap.src.js', [], function () {
- });
- }));
|