chunk-2d22e12c.0468c6a5.js 2.8 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22e12c"],{f9cf:function(e,t,r){"use strict";r.r(t),r.d(t,"version",(function(){return b})),r.d(t,"gexf",(function(){return n})),r.d(t,"prepareBoxplotData",(function(){return g}));var n={};r.r(n),r.d(n,"parse",(function(){return i}));var a=r("313e"),o=r("6d8b");function i(e){var t;if("string"===typeof e){var r=new DOMParser;t=r.parseFromString(e,"text/xml")}else t=e;if(!t||t.getElementsByTagName("parsererror").length)return null;var n=c(t,"gexf");if(!n)return null;for(var a=c(n,"graph"),o=l(c(a,"attributes")),i={},f=0;f<o.length;f++)i[o[f].id]=o[f];return{nodes:u(c(a,"nodes"),i),links:s(c(a,"edges"))}}function l(e){return e?o["map"](p(e,"attribute"),(function(e){return{id:f(e,"id"),title:f(e,"title"),type:f(e,"type")}})):[]}function u(e,t){return e?o["map"](p(e,"node"),(function(e){var r=f(e,"id"),n=f(e,"label"),a={id:r,name:n,itemStyle:{normal:{}}},o=c(e,"viz:size"),i=c(e,"viz:position"),l=c(e,"viz:color"),u=c(e,"attvalues");if(o&&(a.symbolSize=parseFloat(f(o,"value"))),i&&(a.x=parseFloat(f(i,"x")),a.y=parseFloat(f(i,"y"))),l&&(a.itemStyle.normal.color="rgb("+[0|f(l,"r"),0|f(l,"g"),0|f(l,"b")].join(",")+")"),u){var s=p(u,"attvalue");a.attributes={};for(var v=0;v<s.length;v++){var d=s[v],g=f(d,"for"),b=f(d,"value"),h=t[g];if(h){switch(h.type){case"integer":case"long":b=parseInt(b,10);break;case"float":case"double":b=parseFloat(b);break;case"boolean":b="true"===b.toLowerCase();break;default:}a.attributes[g]=b}}}return a})):[]}function s(e){return e?o["map"](p(e,"edge"),(function(e){var t=f(e,"id"),r=f(e,"label"),n=f(e,"source"),a=f(e,"target"),o={id:t,name:r,source:n,target:a,lineStyle:{normal:{}}},i=o.lineStyle.normal,l=c(e,"viz:thickness"),u=c(e,"viz:color");return l&&(i.width=parseFloat(l.getAttribute("value"))),u&&(i.color="rgb("+[0|f(u,"r"),0|f(u,"g"),0|f(u,"b")].join(",")+")"),o})):[]}function f(e,t){return e.getAttribute(t)}function c(e,t){var r=e.firstChild;while(r){if(1===r.nodeType&&r.nodeName.toLowerCase()===t.toLowerCase())return r;r=r.nextSibling}return null}function p(e,t){var r=e.firstChild,n=[];while(r)r.nodeName.toLowerCase()===t.toLowerCase()&&n.push(r),r=r.nextSibling;return n}function v(e){return e.sort((function(e,t){return e-t})),e}function d(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],o=r-n;return o?a+o*(e[n]-a):a}var g=function(e,t){t=t||{};for(var r=[],n=[],a=[],o=t.boundIQR,i="none"===o||0===o,l=0;l<e.length;l++){a.push(l+"");var u=v(e[l].slice()),s=d(u,.25),f=d(u,.5),c=d(u,.75),p=u[0],g=u[u.length-1],b=(null==o?1.5:o)*(c-s),h=i?p:Math.max(p,s-b),m=i?g:Math.min(g,c+b);r.push([h,s,f,c,m]);for(var w=0;w<u.length;w++){var x=u[w];if(x<h||x>m){var y=[l,x];"vertical"===t.layout&&y.reverse(),n.push(y)}}}return{boxData:r,outliers:n,axisData:a}},b="1.0.0";a["dataTool"]&&(a["dataTool"].version=b,a["dataTool"].gexf=n,a["dataTool"].prepareBoxplotData=g)}}]);