PageSourceSearch

https://kysely.dev/assets/js/6364.2f062c9b.js

js kysely.dev collected 2026-10-02 03:00:35 UTC 5,200 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkkysely_site=globalThis.webpackChunkkysely_site||[]).push([[6364],{6364(e,t,a){a.d(t,{diagram:()=>C});var i=a(9389),n=a(2617),l=a(8822),r=a(3399),s=a(7694),o=a(1248),c=a(1049),d=a(8882),p=r.UI.pie,h={sections:new Map,showData:!1,config:p},g=h.sections,u=h.showData,f=structuredClone(p),m=(0,o.K)(()=>structuredClone(f),"getConfig"),w=(0,o.K)(()=>{g=new Map,u=h.showData,(0,r.IU)()},"clear"),S=(0,o.K)(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);g.has(e)||(g.set(e,t),s.R.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),$=(0,o.K)(()=>g,"getSections"),b=(0,o.K)(e=>{u=e},"setShowData"),x=(0,o.K)(()=>u,"getShowData"),y={getConfig:m,clear:w,setDiagramTitle:r.ke,getDiagramTitle:r.ab,setAccTitle:r.SV,getAccTitle:r.iN,setAccDescription:r.EI,getAccDescription:r.m7,addSection:S,getSections:$,setShowData:b,getShowData:x},D=(0,o.K)((e,t)=>{(0,i.S)(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),T={parse:(0,o.K)(async e=>{const t=await(0,c.qg)("pie",e);s.R.debug(t),D(t,y)},"parse")},k=(0,o.K)(e=>`\n  .pieCircle{\n    stroke: ${e.pieStrokeColor};\n    stroke-width : ${e.pieStrokeWidth};\n    opacity : ${e.pieOpacity};\n  }\n  .pieCircle.highlighted{\n    scale: 1.05;\n    opacity: 1;\n  }\n  .pieCircle.highlightedOnHover:hover{\n    transition-duration: 250ms;\n    scale: 1.05;\n    opacity: 1;\n  }\n  .pieOuterCircle{\n    stroke: ${e.pieOuterStrokeColor};\n    stroke-width: ${e.pieOuterStrokeWidth};\n    fill: none;\n  }\n  .pieTitleText {\n    text-anchor: middle;\n    font-size: ${e.pieTitleTextSize};\n    fill: ${e.pieTitleTextColor};\n    font-family: ${e.fontFamily};\n  }\n  .slice {\n    font-family: ${e.fontFamily};\n    fill: ${e.pieSectionTextColor};\n    font-size:${e.pieSectionTextSize};\n    // fill: white;\n  }\n  .legend text {\n    fill: ${e.pieLegendTextColor};\n    font-family: ${e.fontFamily};\n    font-size: ${e.pieLegendTextSize};\n  }\n`,"getStyles"),v=(0,o.K)(e=>{const t=[...e.values()].reduce((e,t)=>e+t,0),a=[...e.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/t*100>=1);return(0,d.rLf)().value(e=>e.value).sort(null)(a)},"createPieArcs"),C={parser:T,db:y,renderer:{draw:(0,o.K)((e,t,a,i)=>{s.R.debug("rendering pie chart\n"+e);const o=i.db,c=(0,r.D7)(),p=(0,l.$t)(o.getConfig(),c.pie),h=18,g=450,u=g,f=(0,n.D)(t),m=f.append("g");m.attr("transform","translate(225,225)");const{themeVariables:w}=c;let[S]=(0,l.I5)(w.pieOuterStrokeWidth);S??=2;const $=p.legendPosition,b=p.textPosition,x=p.donutHole>0&&p.donutHole<=.9?p.donutHole:0,y=Math.min(u,g)/2-40,D=(0,d.JLW)().innerRadius(x*y).outerRadius(y),T=(0,d.JLW)().innerRadius(y*b).outerRadius(y*b),k=m.append("g");k.append("circle").attr("cx",0).attr("cy",0).attr("r",y+S/2).attr("class","pieOuterCircle");const C=o.getSections(),A=v(C),K=[w.pie1,w.pie2,w.pie3,w.pie4,w.pie5,w.pie6,w.pie7,w.pie8,w.pie9,w.pie10,w.pie11,w.pie12];let R=0;C.forEach(e=>{R+=e});const M=A.filter(e=>"0"!==(e.data.value/R*100).toFixed(0)),O=(0,d.UMr)(K).domain([...C.keys()]);k.selectAll("mySlices").data(M).enter().append("path").attr("d",D).attr("fill",e=>O(e.data.label)).attr("class",e=>{let t="pieCircle";return"hover"===p.highlightSlice?t+=" highlightedOnHover":p.highlightSlice===e.data.label&&(t+=" highlighted"),t}),k.selectAll("mySlices").data(M).enter().append("text").text(e=>(e.data.value/R*100).toFixed(0)+"%").attr("transform",e=>"translate("+T.centroid(e)+")").style("text-anchor","middle").attr("class","slice");const z=m.append("text").text(o.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText"),W=[...C.entries()].map(([e,t])=>({label:e,value:t})),F=m.selectAll(".legend").data(W).enter().append("g").attr("class","legend");F.append("rect").attr("width",h).attr("height",h).style("fill",e=>O(e.label)).style("stroke",e=>O(e.label)),F.append("text").attr("x",22).attr("y",14).text(e=>o.getShowData()?`${e.label} [${e.value}]`:e.label);const H=Math.max(...F.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0));let L=g,I=490;const B=22,E=W.length*B;switch($){case"center":F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate("+(-H/2-22)+","+(t*B-a)+")"});break;case"top":L+=E,F.attr("transform",(e,t)=>`translate(${-H/2-22}, ${t*B-y})`),k.attr("transform",()=>`translate(0, ${E+B})`);break;case"bottom":L+=E,F.attr("transform",(e,t)=>"translate("+(-H/2-22)+","+(t*B-(-y-B))+")");break;case"left":I+=22+H,F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate("+(-y-22)+","+(t*B-a)+")"}),k.attr("transform",()=>`translate(${H+h+4}, 0)`);break;default:I+=22+H,F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate(216,"+(t*B-a)+")"})}const P=z.node()?.getBoundingClientRect().width??0,U=225-P/2,J=225+P/2,N=Math.min(0,U),V=Math.max(I,J)-N;f.attr("viewBox",`${N} 0 ${V} ${L}
1`),(0,r.a$)(f,L,V,p.useMaxWidth)},"draw")},styles:k}},9389(e,t,a){function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>i}),(0,a(1248).K)(i,"populateCommonDb")}}]);

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.