PageSourceSearch

https://outbreak.info/assets/Donut-72ce76de.js

js outbreak.info collected 2026-10-02 05:15:18 UTC 6,727 bytes, 1 lines download raw bytes

1import{s as me}from"./select-b5bdf8e7.js";import{a as ge}from"./array-9f3ba611.js";import{c as R}from"./constant-f354b64a.js";import{h as ue,e as P,t as U,c as q,s as j,m as ae,a as se,p as ie,b as W,d as b,f as oe,g as he,i as pe}from"./math-9c28c395.js";import{w as ye}from"./path-bbeba479.js";import{o as ce}from"./ordinal-74808f44.js";import{c as ve}from"./colors-98f238a0.js";import{w as xe,o as Ae,b as z,c as L,d as fe,F as be,e as we,f as Re,t as Te,j as de,q as E}from"./index-1ad9b78e.js";import"./init-a5b10ee5.js";function ke(r){return r.innerRadius}function Pe(r){return r.outerRadius}function Se(r){return r.startAngle}function Fe(r){return r.endAngle}function Me(r){return r&&r.padAngle}function Ne(r,i,x,g,h,p,f,e){var m=x-r,l=g-i,n=f-h,v=e-p,t=v*m-n*l;if(!(t*t<P))return t=(n*(i-p)-v*(r-h))/t,[r+t*m,i+t*l]}function Q(r,i,x,g,h,p,f){var e=r-x,m=i-g,l=(f?p:-p)/W(e*e+m*m),n=l*m,v=-l*e,t=r+n,u=i+v,s=x+n,c=g+v,M=(t+s)/2,d=(u+c)/2,w=s-t,A=c-u,y=w*w+A*A,T=h-p,k=t*c-s*u,D=(A<0?-1:1)*W(pe(0,T*T*y-k*k)),V=(k*A-w*D)/y,C=(-k*w-A*D)/y,N=(k*A+w*D)/y,S=(-k*w+A*D)/y,F=V-M,a=C-d,o=N-M,$=S-d;return F*F+a*a>o*o+$*$&&(V=N,C=S),{cx:V,cy:C,x01:-n,y01:-v,x11:V*(h/T-1),y11:C*(h/T-1)}}function je(){var r=ke,i=Pe,x=R(0),g=null,h=Se,p=Fe,f=Me,e=null,m=ye(l);function l(){var n,v,t=+r.apply(this,arguments),u=+i.apply(this,arguments),s=h.apply(this,arguments)-ue,c=p.apply(this,arguments)-ue,M=se(c-s),d=c>s;if(e||(e=n=m()),u<t&&(v=u,u=t,t=v),!(u>P))e.moveTo(0,0);else if(M>U-P)e.moveTo(u*q(s),u*j(s)),e.arc(0,0,u,s,c,!d),t>P&&(e.moveTo(t*q(c),t*j(c)),e.arc(0,0,t,c,s,d));else{var w=s,A=c,y=s,T=c,k=M,D=M,V=f.apply(this,arguments)/2,C=V>P&&(g?+g.apply(this,arguments):W(t*t+u*u)),N=ae(se(u-t)/2,+x.apply(this,arguments)),S=N,F=N,a,o;if(C>P){var $=oe(C/t*j(V)),Z=oe(C/u*j(V));(k-=$*2)>P?($*=d?1:-1,y+=$,T-=$):(k=0,y=T=(s+c)/2),(D-=Z*2)>P?(Z*=d?1:-1,w+=Z,A-=Z):(D=0,w=A=(s+c)/2)}var I=u*q(w),O=u*j(w),G=t*q(T),H=t*j(T);if(N>P){var J=u*q(A),K=u*j(A),X=t*q(y),Y=t*j(y),B;if(M<ie)if(B=Ne(I,O,X,Y,J,K,G,H)){var _=I-B[0],ee=O-B[1],ne=J-B[0],te=K-B[1],re=1/j(he((_*ne+ee*te)/(W(_*_+ee*ee)*W(ne*ne+te*te)))/2),le=W(B[0]*B[0]+B[1]*B[1]);S=ae(N,(t-le)/(re-1)),F=ae(N,(u-le)/(re+1))}else S=F=0}D>P?F>P?(a=Q(X,Y,I,O,u,F,d),o=Q(J,K,G,H,u,F,d),e.moveTo(a.cx+a.x01,a.cy+a.y01),F<N?e.arc(a.cx,a.cy,F,b(a.y01,a.x01),b(o.y01,o.x01),!d):(e.arc(a.cx,a.cy,F,b(a.y01,a.x01),b(a.y11,a.x11),!d),e.arc(0,0,u,b(a.cy+a.y11,a.cx+a.x11),b(o.cy+o.y11,o.cx+o.x11),!d),e.arc(o.cx,o.cy,F,b(o.y11,o.x11),b(o.y01,o.x01),!d))):(e.moveTo(I,O),e.arc(0,0,u,w,A,!d)):e.moveTo(I,O),!(t>P)||!(k>P)?e.lineTo(G,H):S>P?(a=Q(G,H,J,K,t,-S,d),o=Q(I,O,X,Y,t,-S,d),e.lineTo(a.cx+a.x01,a.cy+a.y01),S<N?e.arc(a.cx,a.cy,S,b(a.y01,a.x01),b(o.y01,o.x01),!d):(e.arc(a.cx,a.cy,S,b(a.y01,a.x01),b(a.y11,a.x11),!d),e.arc(0,0,t,b(a.cy+a.y11,a.cx+a.x11),b(o.cy+o.y11,o.cx+o.x11),d),e.arc(o.cx,o.cy,S,b(o.y11,o.x11),b(o.y01,o.x01),!d))):e.arc(0,0,t,T,y,d)}if(e.closePath(),n)return e=null,n+""||null}return l.centroid=function(){var n=(+r.apply(this,arguments)+ +i.apply(this,arguments))/2,v=(+h.apply(this,arguments)+ +p.apply(this,arguments))/2-ie/2;return[q(v)*n,j(v)*n]},l.innerRadius=function(n){return arguments.length?(r=typeof n=="function"?n:R(+n),l):r},l.outerRadius=function(n){return arguments.length?(i=typeof n=="function"?n:R(+n),l):i},l.cornerRadius=function(n){return arguments.length?(x=typeof n=="function"?n:R(+n),l):x},l.padRadius=function(n){return arguments.length?(g=n==null?null:typeof n=="function"?n:R(+n),l):g},l.startAngle=function(n){return arguments.length?(h=typeof n=="function"?n:R(+n),l):h},l.endAngle=function(n){return arguments.length?(p=typeof n=="function"?n:R(+n),l):p},l.padAngle=function(n){return arguments.length?(f=typeof n=="function"?n:R(+n),l):f},l.context=function(n){return arguments.length?(e=n??null,l):e},l}function Be(r,i){return i<r?-1:i>r?1:i>=r?0:NaN}function De(r){return r}function Ve(){var r=De,i=Be,x=null,g=R(0),h=R(U),p=R(0);function f(e){var m,l=(e=ge(e)).length,n,v,t=0,u=new Array(l),s=new Array(l),c=+g.apply(this,arguments),M=Math.min(U,Math.max(-U,h.apply(this,arguments)-c)),d,w=Math.min(Math.abs(M)/l,p.apply(this,arguments)),A=w*(M<0?-1:1),y;for(m=0;m<l;++m)(y=s[u[m]=m]=+r(e[m],m,e))>0&&(t+=y);for(i!=null?u.sort(function(T,k){return i(s[T],s[k])}):x!=null&&u.sort(function(T,k){return x(e[T],e[k])}),m=0,v=t?(M-l*A)/t:0;m<l;++m,c=d)n=u[m],y=s[n],d=c+(y>0?y*v:0)+A,s[n]={data:e[n],index:m,value:y,startAngle:c,endAngle:d,padAngle:w};return s}return f.value=function(e){return arguments.length?(r=typeof e=="function"?e:R(+e),f):r},f.sortValues=function(e){return arguments.length?(i=e,x=null,f):i},f.sort=function(e){return arguments.length?(x=e,i=null,f):x},f.startAngle=function(e){return arguments.length?(g=typeof e=="function"?e:R(+e),f):g},f.endAngle=function(e){return arguments.length?(h=typeof e=="function"?e:R(+e),f):h},f.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:R(+e),f):p},f}const Ce=ve("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),$e=["id"],qe=["width","height"],Ee=["transform"],Ie={class:"ml-2",style:{"max-width":"150px"}},Oe={key:0,style:{color:"#bababa"},class:"line-height-sm text-left d-block"},Ue={__name:"Donut",props:{data:Array,id:String,width:{type:Number,default:60}},setup(r){const i=r,x=E(.4),g=E([]),h=E(null),p=E(null),f=E(null),e=E(null),m=E(null),l=()=>{h.value=me(m.value),p.value=Ve().sort((t,u)=>t.value>u.value?-1:1).value(t=>t.count),f.value=je().innerRadius(i.width/2*x.value).outerRadius(i.width/2-1)},n=()=>{i.data&&i.data[0]&&i.width&&v()},v=()=>{g.value=i.data.filter(s=>s.count);const t=p.value(g.value);i.id==="Type"?e.value=ce().range(["#507ea3","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#b475a3","#ff98a8","#a97252","#9c755f"]).domain(["Dataset","WebSite","Publication","Analysis","Protocol","ImageObject","ClinicalTr
1ial","Book","ComputationalTool"]).unknown("#bababa"):e.value=ce(Ce).domain(g.value.map(s=>s.term).slice(0,5)).unknown("#bababa"),h.value.selectAll("path").data(t).join(s=>{s.append("path").attr("d",f.value).style("fill",c=>e.value(c.data.term))},s=>s.attr("d",f.value).style("fill",c=>e.value(c.data.term)))};return xe(()=>i.data,()=>{n()},{deep:!0}),Ae(()=>{l(),n()}),(t,u)=>(z(),L("div",{id:`donut-${r.id}`,class:"donut-group d-flex"},[(z(),L("svg",{width:r.width,height:r.width,class:"donut"},[fe("g",{ref_key:"pieRef",ref:m,transform:`translate(${r.width/2},${r.width/2})`},null,8,Ee)],8,qe)),fe("div",Ie,[(z(!0),L(be,null,we(g.value,(s,c)=>(z(),L("div",{key:c,class:"line-height-sm text-left text-break"},[e.value&&c<5?(z(),L("small",{key:0,style:Re({color:e.value(s.term)})},Te(s.term),5)):de("",!0)]))),128)),g.value.length>5?(z(),L("small",Oe," other ")):de("",!0)])],8,$e))}};export{Ue as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.