All Downloads are FREE. Search and download functionalities are using the official Maven repository.

@kie-tools.dashbuilder-client.dist.dashbuilder.component.svg-heatmap.index.js Maven / Gradle / Ivy

There is a newer version: 0.32.0
Show newest version
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={81:function(e,t,n){var r,a,l;l=function(){var e,t={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},n=function(){var e=function(e){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=e.xField||e.defaultXField,this._yField=e.yField||e.defaultYField,this._valueField=e.valueField||e.defaultValueField,e.radius&&(this._cfgRadius=e.radius)},n=t.defaultRadius;return e.prototype={_organiseData:function(e,t){var r=e[this._xField],a=e[this._yField],l=this._radi,o=this._data,i=this._max,u=this._min,s=e[this._valueField]||1,c=e.radius||this._cfgRadius||n;o[r]||(o[r]=[],l[r]=[]),o[r][a]?o[r][a]+=s:(o[r][a]=s,l[r][a]=c);var f=o[r][a];return f>i?(t?this.setDataMax(f):this._max=f,!1):f0)for(var e=arguments[0],t=e.length;t--;)this.addData.call(this,e[t]);else{var n=this._organiseData(arguments[0],!0);n&&(0===this._data.length&&(this._min=this._max=n.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[n]}))}return this},setData:function(e){var t=e.data,n=t.length;this._data=[],this._radi=[];for(var r=0;r0&&(this._drawAlpha(e),this._colorize())},renderAll:function(e){this._clear(),e.data.length>0&&(this._drawAlpha(function(e){for(var t=[],n=e.min,r=e.max,a=e.radi,l=(e=e.data,Object.keys(e)),o=l.length;o--;)for(var i=l[o],u=Object.keys(e[i]),s=u.length;s--;){var c=u[s],f=e[i][c],d=a[i][c];t.push({x:i,y:c,value:f,radius:d})}return{min:n,max:r,data:t}}(e)),this._colorize())},_updateGradient:function(t){this._palette=e(t)},updateConfig:function(e){e.gradient&&this._updateGradient(e),this._setStyles(e)},setDimensions:function(e,t){this._width=e,this._height=t,this.canvas.width=this.shadowCanvas.width=e,this.canvas.height=this.shadowCanvas.height=t},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(e){this._blur=0==e.blur?0:e.blur||e.defaultBlur,e.backgroundColor&&(this.canvas.style.backgroundColor=e.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=e.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=e.height||this._height,this._opacity=255*(e.opacity||0),this._maxOpacity=255*(e.maxOpacity||e.defaultMaxOpacity),this._minOpacity=255*(e.minOpacity||e.defaultMinOpacity),this._useGradientOpacity=!!e.useGradientOpacity},_drawAlpha:function(e){for(var n=this._min=e.min,r=this._max=e.max,a=(e=e.data||[]).length,l=1-this._blur;a--;){var o,i=e[a],u=i.x,s=i.y,c=i.radius,f=Math.min(i.value,r),d=u-c,p=s-c,h=this.shadowCtx;this._templates[c]?o=this._templates[c]:this._templates[c]=o=t(c,l);var m=(f-n)/(r-n);h.globalAlpha=m<.01?.01:m,h.drawImage(o,d,p),dthis._renderBoundaries[2]&&(this._renderBoundaries[2]=d+2*c),p+2*c>this._renderBoundaries[3]&&(this._renderBoundaries[3]=p+2*c)}},_colorize:function(){var e=this._renderBoundaries[0],t=this._renderBoundaries[1],n=this._renderBoundaries[2]-e,r=this._renderBoundaries[3]-t,a=this._width,l=this._height,o=this._opacity,i=this._maxOpacity,u=this._minOpacity,s=this._useGradientOpacity;e<0&&(e=0),t<0&&(t=0),e+n>a&&(n=a-e),t+r>l&&(r=l-t);for(var c=this.shadowCtx.getImageData(e,t,n,r),f=c.data,d=f.length,p=this._palette,h=3;h0?o:g>0},getDataURL:function(){return this.canvas.toDataURL()}},n}(),a=(e=!1,"canvas2d"===t.defaultRenderer&&(e=r),e),l=function(){for(var e={},t=arguments.length,n=0;n{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,l){for(var o,i,u=a(e),s=1;s{"use strict";var r=n(901),a=n(458),l=n(803);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n




© 2015 - 2024 Weber Informatics LLC | Privacy Policy