UNPKG

@highcharts/highcharts-react-native

Version:
33 lines (31 loc) 12.6 kB
/* Highmaps JS v8.0.4 (2020-03-10) (c) 2009-2019 Torstein Honsi License: www.highcharts.com/license */ (function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/heatmap",["highcharts"],function(p){a(p);a.Highcharts=p;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function p(a,m,h,u){a.hasOwnProperty(m)||(a[m]=u.apply(null,h))}a=a?a._modules:{};p(a,"parts-map/ColorSeriesMixin.js",[a["parts/Globals.js"]],function(a){a.colorPointMixin={setVisible:function(a){var h=this,n=a?"show": "hide";h.visible=h.options.visible=!!a;["graphic","dataLabel"].forEach(function(a){if(h[a])h[a][n]()})}};a.colorSeriesMixin={optionalAxis:"colorAxis",colorAxis:0,translateColors:function(){var a=this,h=this.options.nullColor,n=this.colorAxis,p=this.colorKey;(this.data.length?this.data:this.points).forEach(function(g){var m=g.getNestedProperty(p);if(m=g.options.color||(g.isNull?h:n&&"undefined"!==typeof m?n.toColor(m,g):g.color||a.color))g.color=m})}}});p(a,"parts-map/ColorAxis.js",[a["parts/Globals.js"], a["parts/Color.js"],a["parts/Point.js"],a["parts/Legend.js"],a["mixins/legend-symbol.js"],a["parts/Utilities.js"]],function(a,m,h,u,p,g){"";var n=m.parse;m=g.addEvent;var v=g.erase,r=g.extend,x=g.isNumber,t=g.merge,q=g.pick,l=g.splat,e=a.Axis;g=a.Chart;var w=a.Series,B=a.colorPointMixin,z=a.noop;r(w.prototype,a.colorSeriesMixin);r(h.prototype,B);g.prototype.collectionsWithUpdate.push("colorAxis");g.prototype.collectionsWithInit.colorAxis=[g.prototype.addColorAxis];var y=a.ColorAxis=function(){this.init.apply(this, arguments)};r(y.prototype,e.prototype);r(y.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},width:.01,color:"#999999"},labels:{overflow:"justify",rotation:0},minColor:"#e6ebf5",maxColor:"#003399",tickLength:5,showInLegend:!0},keepProps:["legendGroup","legendItemHeight","legendItemWidth","legendItem","legendSymbol"].concat(e.prototype.keepProps),init:function(b,c){this.coll= "colorAxis";var k=this.buildOptions.call(b,this.defaultColorAxisOptions,c);e.prototype.init.call(this,b,k);c.dataClasses&&this.initDataClasses(c);this.initStops();this.horiz=!k.opposite;this.zoomEnabled=!1;this.defaultLegendLength=200},initDataClasses:function(b){var c=this.chart,k,d=0,f=c.options.chart.colorCount,a=this.options,A=b.dataClasses.length;this.dataClasses=k=[];this.legendItems=[];b.dataClasses.forEach(function(b,e){b=t(b);k.push(b);if(c.styledMode||!b.color)"category"===a.dataClassColor? (c.styledMode||(e=c.options.colors,f=e.length,b.color=e[d]),b.colorIndex=d,d++,d===f&&(d=0)):b.color=n(a.minColor).tweenTo(n(a.maxColor),2>A?.5:e/(A-1))})},hasData:function(){return!(!this.tickPositions||!this.tickPositions.length)},setTickPositions:function(){if(!this.dataClasses)return e.prototype.setTickPositions.call(this)},initStops:function(){this.stops=this.options.stops||[[0,this.options.minColor],[1,this.options.maxColor]];this.stops.forEach(function(b){b.color=n(b[1])})},buildOptions:function(b, c){var k=this.options.legend,d=c.layout?"vertical"!==c.layout:"vertical"!==k.layout;return t(b,{side:d?2:1,reversed:!d},c,{opposite:!d,showEmpty:!1,title:null,visible:k.enabled&&(c?!1!==c.visible:!0)})},setOptions:function(b){e.prototype.setOptions.call(this,b);this.options.crosshair=this.options.marker},setAxisSize:function(){var b=this.legendSymbol,c=this.chart,k=c.options.legend||{},d,f;b?(this.left=k=b.attr("x"),this.top=d=b.attr("y"),this.width=f=b.attr("width"),this.height=b=b.attr("height"), this.right=c.chartWidth-k-f,this.bottom=c.chartHeight-d-b,this.len=this.horiz?f:b,this.pos=this.horiz?k:d):this.len=(this.horiz?k.symbolWidth:k.symbolHeight)||this.defaultLegendLength},normalizedValue:function(b){this.isLog&&(b=this.val2lin(b));return 1-(this.max-b)/(this.max-this.min||1)},toColor:function(b,c){var k=this.stops,d=this.dataClasses,f;if(d)for(f=d.length;f--;){var a=d[f];var e=a.from;k=a.to;if(("undefined"===typeof e||b>=e)&&("undefined"===typeof k||b<=k)){var g=a.color;c&&(c.dataClass= f,c.colorIndex=a.colorIndex);break}}else{b=this.normalizedValue(b);for(f=k.length;f--&&!(b>k[f][0]););e=k[f]||k[f+1];k=k[f+1]||e;b=1-(k[0]-b)/(k[0]-e[0]||1);g=e.color.tweenTo(k.color,b)}return g},getOffset:function(){var b=this.legendGroup,c=this.chart.axisOffset[this.side];b&&(this.axisParent=b,e.prototype.getOffset.call(this),this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width),this.chart.axisOffset[this.side]=c)},setLegendColor:function(){var b=this.reversed;var c=b?1:0;b=b? 0:1;c=this.horiz?[c,0,b,0]:[0,b,0,c];this.legendColor={linearGradient:{x1:c[0],y1:c[1],x2:c[2],y2:c[3]},stops:this.stops}},drawLegendSymbol:function(b,c){var a=b.padding,d=b.options,f=this.horiz,e=q(d.symbolWidth,f?this.defaultLegendLength:12),g=q(d.symbolHeight,f?12:this.defaultLegendLength),l=q(d.labelPadding,f?16:30);d=q(d.itemDistance,10);this.setLegendColor();c.legendSymbol=this.chart.renderer.rect(0,b.baseline-11,e,g).attr({zIndex:1}).add(c.legendGroup);this.legendItemWidth=e+a+(f?d:l);this.legendItemHeight= g+a+(f?l:0)},setState:function(b){this.series.forEach(function(c){c.setState(b)})},visible:!0,setVisible:z,getSeriesExtremes:function(){var b=this.series,c=b.length,a;this.dataMin=Infinity;for(this.dataMax=-Infinity;c--;){var d=b[c];var f=d.colorKey=q(d.options.colorKey,d.colorKey,d.pointValKey,d.zoneAxis,"y");var e=d.pointArrayMap;var g=d[f+"Min"]&&d[f+"Max"];if(d[f+"Data"])var l=d[f+"Data"];else if(e){l=[];e=e.indexOf(f);var h=d.yData;if(0<=e&&h)for(a=0;a<h.length;a++)l.push(q(h[a][e],h[a]))}else l= d.yData;g?(d.minColorValue=d[f+"Min"],d.maxColorValue=d[f+"Max"]):(w.prototype.getExtremes.call(d,l),d.minColorValue=d.dataMin,d.maxColorValue=d.dataMax);"undefined"!==typeof d.minColorValue&&(this.dataMin=Math.min(this.dataMin,d.minColorValue),this.dataMax=Math.max(this.dataMax,d.maxColorValue));g||w.prototype.getExtremes.call(d)}},drawCrosshair:function(b,c){var a=c&&c.plotX,d=c&&c.plotY,f=this.pos,g=this.len;if(c){var l=this.toPixels(c.getNestedProperty(c.series.colorKey));l<f?l=f-2:l>f+g&&(l= f+g+2);c.plotX=l;c.plotY=this.len-l;e.prototype.drawCrosshair.call(this,b,c);c.plotX=a;c.plotY=d;this.cross&&!this.cross.addedToColorAxis&&this.legendGroup&&(this.cross.addClass("highcharts-coloraxis-marker").add(this.legendGroup),this.cross.addedToColorAxis=!0,this.chart.styledMode||this.cross.attr({fill:this.crosshair.color}))}},getPlotLinePath:function(b){var c=b.translatedValue;return x(c)?this.horiz?["M",c-4,this.top-6,"L",c+4,this.top-6,c,this.top,"Z"]:["M",this.left,c,"L",this.left-6,c+6,this.left- 6,c-6,"Z"]:e.prototype.getPlotLinePath.apply(this,arguments)},update:function(b,c){var a=this.chart,d=a.legend,f=this.buildOptions.call(a,{},b);this.series.forEach(function(b){b.isDirtyData=!0});(b.dataClasses&&d.allItems||this.dataClasses)&&this.destroyItems();a.options[this.coll]=t(this.userOptions,f);e.prototype.update.call(this,f,c);this.legendItem&&(this.setLegendColor(),d.colorizeItem(this,!0))},destroyItems:function(){var b=this.chart;this.legendItem?b.legend.destroyItem(this):this.legendItems&& this.legendItems.forEach(function(c){b.legend.destroyItem(c)});b.isDirtyLegend=!0},remove:function(b){this.destroyItems();e.prototype.remove.call(this,b)},getDataClassLegendSymbols:function(){var b=this,c=this.chart,a=this.legendItems,d=c.options.legend,f=d.valueDecimals,e=d.valueSuffix||"",l;a.length||this.dataClasses.forEach(function(d,k){var g=!0,h=d.from,n=d.to,m=c.numberFormatter;l="";"undefined"===typeof h?l="< ":"undefined"===typeof n&&(l="> ");"undefined"!==typeof h&&(l+=m(h,f)+e);"undefined"!== typeof h&&"undefined"!==typeof n&&(l+=" - ");"undefined"!==typeof n&&(l+=m(n,f)+e);a.push(r({chart:c,name:l,options:{},drawLegendSymbol:p.drawRectangle,visible:!0,setState:z,isDataClass:!0,setVisible:function(){g=this.visible=!g;b.series.forEach(function(b){b.points.forEach(function(b){b.dataClass===k&&b.setVisible(g)})});c.legend.colorizeItem(this,g)}},d))});return a},beforePadding:!1,name:""});["fill","stroke"].forEach(function(b){a.Fx.prototype[b+"Setter"]=function(){this.elem.attr(b,n(this.start).tweenTo(n(this.end), this.pos),null,!0)}});m(g,"afterGetAxes",function(){var b=this,c=b.options;this.colorAxis=[];c.colorAxis&&(c.colorAxis=l(c.colorAxis),c.colorAxis.forEach(function(c,a){c.index=a;new y(b,c)}))});m(w,"bindAxes",function(){var b=this.axisTypes;b?-1===b.indexOf("colorAxis")&&b.push("colorAxis"):this.axisTypes=["colorAxis"]});m(u,"afterGetAllItems",function(b){var c=[],a,d;(this.chart.colorAxis||[]).forEach(function(d){(a=d.options)&&a.showInLegend&&(a.dataClasses&&a.visible?c=c.concat(d.getDataClassLegendSymbols()): a.visible&&c.push(d),d.series.forEach(function(c){if(!c.options.showInLegend||a.dataClasses)"point"===c.options.legendType?c.points.forEach(function(c){v(b.allItems,c)}):v(b.allItems,c)}))});for(d=c.length;d--;)b.allItems.unshift(c[d])});m(u,"afterColorizeItem",function(b){b.visible&&b.item.legendColor&&b.item.legendSymbol.attr({fill:b.item.legendColor})});m(u,"afterUpdate",function(){var b=this.chart.colorAxis;b&&b.forEach(function(b,a,d){b.update({},d)})});m(w,"afterTranslate",function(){(this.chart.colorAxis&& this.chart.colorAxis.length||this.colorAttribs)&&this.translateColors()})});p(a,"parts-map/ColorMapSeriesMixin.js",[a["parts/Globals.js"],a["parts/Point.js"],a["parts/Utilities.js"]],function(a,m,h){var n=h.defined;h=a.noop;var p=a.seriesTypes;a.colorMapPointMixin={dataLabelOnNull:!0,isValid:function(){return null!==this.value&&Infinity!==this.value&&-Infinity!==this.value},setState:function(a){m.prototype.setState.call(this,a);this.graphic&&this.graphic.attr({zIndex:"hover"===a?1:0})}};a.colorMapSeriesMixin= {pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:h,parallelArrays:["x","y","value"],colorKey:"value",pointAttribs:p.column.prototype.pointAttribs,colorAttribs:function(a){var g={};n(a.color)&&(g[this.colorProp||"fill"]=a.color);return g}}});p(a,"parts-map/HeatmapSeries.js",[a["parts/Globals.js"],a["mixins/legend-symbol.js"],a["parts/Utilities.js"]],function(a,m,h){var n=h.clamp,p=h.extend,g=h.fireEvent,C=h.merge,v=h.pick; h=h.seriesType;var r=a.colorMapPointMixin,x=a.noop,t=a.Series,q=a.seriesTypes;h("heatmap","scatter",{animation:!1,borderWidth:0,nullColor:"#f7f7f7",dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{hover:{halo:!1,brightness:.2}}},C(a.colorMapSeriesMixin,{pointArrayMap:["y","value"],hasPointSpecificOptions:!0,getExtremesFromAll:!0, directTouch:!0,init:function(){q.scatter.prototype.init.apply(this,arguments);var a=this.options;a.pointRange=v(a.pointRange,a.colsize||1);this.yAxis.axisPointRange=a.rowsize||1},translate:function(){this.generatePoints();var a=this.options,e=a.colsize,h=a.pointPadding,m=void 0===h?0:h;a=a.rowsize;h=this.points;var p=this.xAxis,q=this.yAxis,b=(void 0===e?1:e)/2,c=(void 0===a?1:a)/2,k=this.pointPlacementToXValue(),d=function(a){return Math.round(n(p.translate(a,!1,!1,!1,!0,k),0,p.len))};h.forEach(function(a){var e= d(a.x-b),f=d(a.x+b),g=Math.round(n(q.translate(a.y-c,!1,!0,!1,!0),0,q.len)),h=Math.round(n(q.translate(a.y+c,!1,!0,!1,!0),0,q.len)),l=v(a.pointPadding,m);a.plotX=a.clientX=(e+f)/2;a.plotY=(g+h)/2;a.shapeType="rect";a.shapeArgs={x:Math.min(e,f)+l,y:Math.min(g,h)+l,width:Math.max(Math.abs(f-e)-2*l,0),height:Math.max(Math.abs(h-g)-2*l,0)}});g(this,"afterTranslate")},drawPoints:function(){var a=this.chart.styledMode?"css":"animate";q.column.prototype.drawPoints.call(this);this.points.forEach(function(e){e.graphic[a](this.colorAttribs(e))}, this)},hasData:function(){return!!this.processedXData.length},getValidPoints:function(a,e){return t.prototype.getValidPoints.call(this,a,e,!0)},animate:x,getBox:x,drawLegendSymbol:m.drawRectangle,alignDataLabel:q.column.prototype.alignDataLabel,getExtremes:function(){t.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;t.prototype.getExtremes.call(this)}}),p({haloPath:function(a){if(!a)return[];var e=this.shapeArgs;return["M",e.x-a,e.y-a,"L",e.x- a,e.y+e.height+a,e.x+e.width+a,e.y+e.height+a,e.x+e.width+a,e.y-a,"Z"]}},r));""});p(a,"masters/modules/heatmap.src.js",[],function(){})}); //# sourceMappingURL=heatmap.js.map