UNPKG

zingchart

Version:

Our JavaScript charting library is a commercial product. But the full branded version is free to try, forever.

8 lines (7 loc) 2.52 kB
/* All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied, replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the ZingChart End User License Agreement which can be requested by email at support@zingchart.com. Build 2.9.11_ES6 */ zingchart.setModule("vectorplot"),function(){zingchart.bind(null,"dataparse",function(BJ,o){for(var i,H=zingchart.getLoader(BJ.id),c=0,cLen=o[ZC._[16]].length;c<cLen;c++)if(o[ZC._[16]][c].type&&"vectorplot"===o[ZC._[16]][c].type){var sGraphType=o[ZC._[16]][c].type;o[ZC._[16]][c]["plugin-type"]=sGraphType;var IE=o[ZC._[16]][c];zingchart.normalize(IE),IE.type="scatter";var MB={};IE.options&&(MB=IE.options[sGraphType]||IE.options),ZC._todash_(MB),MB.data=MB.data||[];var aData=[];if("string"==typeof MB.data&&"javascript:"===MB.data.substring(0,11))try{var DW=ZC.AR.AAZ(MB.data.substring(11)),E9=DW[0];eval(E9)&&(aData=eval(E9).call(H,DW[1]),H.QZ[MB.data]="zc.ext.load")}catch(e){}else aData=MB.data;var oArrow={"min-length":5,"max-length":10,style:{"border-width":0,"background-color":"#333333",size:3,aspect:[2,5]}};MB.arrow&&ZC._cp_(MB.arrow,oArrow),IE.plot=IE.plot||{},IE.plot.marker=IE.plot.marker||{},IE.plot.marker.alpha=0,IE.plot.marker[ZC._[21]]=ZC._i_(.9*oArrow["max-length"]),IE.plot["hover-marker"]=IE.plot["hover-marker"]||{},IE.plot["hover-marker"].alpha=.25,IE.arrows=[],IE[ZC._[11]]=[{values:[],"data-direction":[],"data-length":[]}],IE.tooltip=IE.tooltip||{},IE.tooltip.text=IE.tooltip.text||"Point:<b>[%scale-key-value, %node-value]</b><br><br>Length:<b>%data-length</b><br>Direction:<b>%data-direction&deg;</b>";var AFF=Number.MAX_VALUE,iMaxLength=-Number.MAX_VALUE;for(i=0;i<aData.length;i++)AFF=Math.min(AFF,aData[i][2]),iMaxLength=Math.max(iMaxLength,aData[i][2]);for(i=0;i<aData.length;i++){IE[ZC._[11]][0][ZC._[5]].push([aData[i][0],aData[i][1]]),IE[ZC._[11]][0]["data-length"].push(aData[i][2]),IE[ZC._[11]][0]["data-direction"].push(aData[i][3]);var oArrowData={};ZC._cp_(oArrow.style,oArrowData),oArrowData.x="scale:name=scale-x;value="+aData[i][0],oArrowData.y="scale:name=scale-y;value="+aData[i][1],oArrowData.angle=aData[i][3],oArrowData.length=iMaxLength===AFF?(oArrow["min-length"]+oArrow["max-length"])/2:oArrow["min-length"]+(oArrow["max-length"]-oArrow["min-length"])*(aData[i][2]-AFF)/(iMaxLength-AFF),oArrowData.flat=!0,aData[i][4]&&(oArrowData[ZC._[0]]=aData[i][4]),IE.arrows.push(oArrowData)}}return o})}();