@silurus/ooxml 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/pptx-BmIUjNvr.js +23385 -0
- package/dist/pptx-CpcYbH-I.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/renderer-Dy1T2soN.cjs +1 -0
- package/dist/{renderer-CbBv_93T.js → renderer-SjpGWvxf.js} +27 -24
- package/dist/types/index.d.ts +44 -0
- package/dist/types/pptx.d.ts +12 -0
- package/dist/types/xlsx.d.ts +32 -0
- package/dist/xlsx-Bd44HD4a.js +3296 -0
- package/dist/xlsx-CE2KLjqR.cjs +11 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
- package/dist/pptx-CGx5usXB.cjs +0 -1
- package/dist/pptx-CWwwY1fU.js +0 -23379
- package/dist/renderer-CB0JSJFW.cjs +0 -1
- package/dist/xlsx-BcgXX4Im.js +0 -3267
- package/dist/xlsx-vIH_eoWl.cjs +0 -11
package/dist/pptx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-C6N7p_Or.cjs`),t=require(`./pptx-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-C6N7p_Or.cjs`),t=require(`./pptx-CpcYbH-I.cjs`);exports.PptxPresentation=t.r,exports.PptxViewer=t.n,exports.autoResize=e.t,exports.renderSlide=t.i;
|
package/dist/pptx.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t=5){if(e===0)return 1;let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r;return(i<1.5?1:i<3.5?2:i<7.5?5:10)*r}function t(e,t,n=0){if(e<=0)return t;let r=e+(e-n)/20;return Math.ceil(r/t)*t}function n(e,t){if(e>=0)return 0;let n=Math.floor(e/t)*t;return Math.abs(n-e)<t*1e-9?n-t:n}function r(e){return Number.isInteger(e)?String(e):e.toFixed(6).replace(/\.?0+$/,``)}function i(e,t){if(!t)return r(e);if(a(t))return o(e,t);let n=s(t),i;return i=e>0?n[0]??t:e<0?n[1]??n[0]??t:n[2]??n[0]??t,i===``?``:(e<0&&n.length<2?`-`:``)+c(Math.abs(e),i)}function a(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`){t=!t;continue}if(!t){if(r===`\\`){n++;continue}if(r===`[`){for(;n<e.length&&e[n]!==`]`;)n++;continue}if(r===`y`||r===`Y`||r===`d`||r===`D`||r===`m`||r===`M`||r===`h`||r===`H`||r===`s`||r===`S`)return!0}}return!1}function o(e,t){let n=Date.UTC(1899,11,30),r=e<60?e+1:e,i=n+Math.floor(r)*864e5,a=new Date(i),o=a.getUTCFullYear(),s=a.getUTCMonth()+1,c=a.getUTCDate(),l=(e-Math.floor(e))*86400,u=Math.floor(l/3600),d=Math.floor(l%3600/60),f=Math.floor(l%60),p=``,m=!1,h=0;for(;h<t.length;){let e=t[h];if(e===`"`){m=!m,h++;continue}if(m){p+=e,h++;continue}if(e===`\\`&&h+1<t.length){p+=t[h+1],h+=2;continue}if(e===`[`){for(;h<t.length&&t[h]!==`]`;)h++;h<t.length&&h++;continue}if(e===`y`||e===`Y`){let e=0;for(;h<t.length&&(t[h]===`y`||t[h]===`Y`);)e++,h++;p+=e>=3?String(o):String(o%100).padStart(2,`0`);continue}if(e===`m`||e===`M`){let e=0;for(;h<t.length&&(t[h]===`m`||t[h]===`M`);)e++,h++;p.match(/[Hh]+\W*$/)?p+=e>=2?String(d).padStart(2,`0`):String(d):p+=e>=2?String(s).padStart(2,`0`):String(s);continue}if(e===`d`||e===`D`){let e=0;for(;h<t.length&&(t[h]===`d`||t[h]===`D`);)e++,h++;p+=e>=2?String(c).padStart(2,`0`):String(c);continue}if(e===`h`||e===`H`){let e=0;for(;h<t.length&&(t[h]===`h`||t[h]===`H`);)e++,h++;p+=e>=2?String(u).padStart(2,`0`):String(u);continue}if(e===`s`||e===`S`){let e=0;for(;h<t.length&&(t[h]===`s`||t[h]===`S`);)e++,h++;p+=e>=2?String(f).padStart(2,`0`):String(f);continue}p+=e,h++}return p}function s(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length){n+=i+e[r+1],r++;continue}if(i===`"`){for(n+=i,r++;r<e.length&&e[r]!==`"`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`[`){for(n+=i,r++;r<e.length&&e[r]!==`]`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`;`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function c(e,t){let n=[],r=0,i=!1,a=!1;for(;r<t.length;){let e=t[r];if(e===`"`){r++;let e=``;for(;r<t.length&&t[r]!==`"`;)e+=t[r],r++;r<t.length&&r++,n.push({kind:`lit`,text:e});continue}if(e===`\\`&&r+1<t.length){n.push({kind:`lit`,text:t[r+1]}),r+=2;continue}if(e===`_`&&r+1<t.length){n.push({kind:`lit`,text:` `}),r+=2;continue}if(e===`*`&&r+1<t.length){r+=2;continue}if(e===`[`){for(r++;r<t.length&&t[r]!==`]`;)r++;r<t.length&&r++;continue}if(e===`%`){a=!0,n.push({kind:`lit`,text:`%`}),r++;continue}if(e===`#`||e===`0`||e===`.`||e===`,`||e===`?`){let e=``;for(;r<t.length&&(t[r]===`#`||t[r]===`0`||t[r]===`.`||t[r]===`,`||t[r]===`?`);)e+=t[r],r++;n.push({kind:`num`,text:e}),i=!0;continue}n.push({kind:`lit`,text:e}),r++}if(!i)return n.map(e=>e.text).join(``);let o=a?e*100:e,s=``;for(let e of n)e.kind===`num`&&(s+=e.text);let c=l(o,s),u=!1;return n.map(e=>e.kind===`lit`?e.text:u?``:(u=!0,c)).join(``)}function l(e,t){let n=t.indexOf(`.`),r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):``,a=/,/.test(r),o=(i.match(/[#0?]/g)??[]).length,s=(r.replace(/,/g,``).match(/0/g)??[]).length,[c,l=``]=e.toFixed(o).split(`.`),u=c.padStart(s,`0`),d=a?u.replace(/\B(?=(\d{3})+(?!\d))/g,`,`):u;return o===0?d:`${d}.${l.padEnd(o,`0`)}`}var u=[`4472C4`,`ED7D31`,`A9D18E`,`FF0000`,`70AD47`,`4BACC6`,`FFC000`,`9E480E`,`843C0C`,`636363`,`255E91`,`967300`];function d(e,t){return t?.color?`#${t.color}`:`#${u[e%u.length]}`}function f(e,t){let n=t.dataPointColors?.[e];return n?`#${n}`:`#${u[e%u.length]}`}function p(e,t){let n=e.startsWith(`#`)?e.slice(1):e;return`rgba(${parseInt(n.slice(0,2),16)},${parseInt(n.slice(2,4),16)},${parseInt(n.slice(4,6),16)},${t})`}function m(e,t,n,r,i,a,o,s){e.save(),e.font=`${s}px sans-serif`,e.fillStyle=`#555`,o===`cat`?(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t.slice(0,30),n+i/2,r+a+s+2)):(e.translate(n-s-4,r+a/2),e.rotate(-Math.PI/2),e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t.slice(0,30),0,0)),e.restore()}function h(e){return e&&(e===`line`||e===`stackedLine`||e===`stackedLinePct`||e===`radar`||e===`scatter`)?`line`:`fill`}function g(e,t,n,r,i,a,o){if(e.fillStyle=n,t===`line`){e.strokeStyle=n;let t=e.lineWidth;e.lineWidth=Math.max(1.5,o*.15),e.beginPath();let s=i+o/2;e.moveTo(r,s),e.lineTo(r+a,s),e.stroke(),e.lineWidth=t}else e.fillRect(r,i,a,o)}function _(e,t,n,r,i,a,o=`vertical`,s){let c=h(s);if(o===`horizontal`){let o=Math.max(9,Math.min(12,a*.7));e.font=`${o}px sans-serif`,e.textBaseline=`middle`;let s=t.map((e,t)=>e.name||`Series ${t+1}`),l=s.map(t=>14+e.measureText(t.slice(0,30)).width),u=n+(i-(l.reduce((e,t)=>e+t,0)+12*Math.max(0,t.length-1)))/2,f=r+a/2;for(let n=0;n<t.length;n++)g(e,c,d(n,t[n]),u,f-o/2,10,o),e.fillStyle=`#333`,e.textAlign=`left`,e.fillText(s[n].slice(0,30),u+10+4,f),u+=l[n]+12;return}let l=Math.max(9,Math.min(12,a/(t.length+1)));e.font=`${l}px sans-serif`,e.textBaseline=`middle`;let u=l+4,f=r+(a-u*t.length)/2;for(let r=0;r<t.length;r++){g(e,c,d(r,t[r]),n,f,10,l),e.fillStyle=`#333`,e.textAlign=`left`;let i=t[r].name||`Series ${r+1}`;e.fillText(i.slice(0,20),n+10+4,f+l/2),f+=u}}function v(e,t,n){if(!e.showLegend)return null;let r=e.legendPos??`r`,i=r===`l`?`l`:r===`t`?`t`:r===`b`?`b`:`r`;return i===`r`||i===`l`?{side:i,reserveW:Math.max(80,t*.22),reserveH:0}:{side:i,reserveW:0,reserveH:Math.max(18,n*.08)}}function y(e,t,n,r,i,a,o,s,c,l,u,d){if(!n)return;let f=t.legendManualLayout;if(f&&f.xMode===`edge`&&f.yMode===`edge`&&f.w>0&&f.h>0){let n=r+f.x*a,s=i+f.y*o,c=f.w*a,l=f.h*o,u=c>=l?`horizontal`:`vertical`;_(e,t.series,n,s,c,l,u,t.chartType);return}switch(n.side){case`r`:_(e,t.series,r+a-n.reserveW+4,c,n.reserveW-8,u,`vertical`,t.chartType);break;case`l`:_(e,t.series,r+4,c,n.reserveW-8,u,`vertical`,t.chartType);break;case`t`:_(e,t.series,s,i+d,l,n.reserveH,`horizontal`,t.chartType);break;case`b`:_(e,t.series,s,i+o-n.reserveH,l,n.reserveH,`horizontal`,t.chartType);break}}function b(e,t,n,r,i,a,o){if(t===`none`||!t)return;let s=o?Math.max(4,o+2):4,c=e.strokeStyle,l=e.lineWidth;if(e.strokeStyle=a??`#888`,e.lineWidth=o??1,e.beginPath(),n===`val`){let n=r,a=i,o=t===`out`||t===`cross`?-s:0,c=t===`in`||t===`cross`?s:0;e.moveTo(n+o,a),e.lineTo(n+c,a)}else{let n=r,a=i,o=t===`out`||t===`cross`?s:0,c=t===`in`||t===`cross`?-s:0;e.moveTo(a,n+o),e.lineTo(a,n+c)}e.stroke(),e.strokeStyle=c,e.lineWidth=l}function x(e,t,n){return e.titleFontSizeHpt?e.titleFontSizeHpt/100*n:Math.max(10,t*.085)}function S(e,t,n){return e?e/100*n:Math.max(8,t*.045)}function C(e,t,n,r,i,a){t.title&&(e.font=`bold ${a}px ${t.titleFontFace?`"${t.titleFontFace}", Calibri, Arial, sans-serif`:`Calibri, Arial, sans-serif`}`,e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:`#333`,e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t.title,n+i/2,r))}function w(e){if(e.categories.length>0)return e.categories;let t=e.series[0];if(t?.categories&&t.categories.length>0)return t.categories;let n=0;for(let t of e.series)t.values.length>n&&(n=t.values.length);return n>0?Array.from({length:n},(e,t)=>String(t+1)):[]}function T(e,t,n,r,i,a,o,s,c){let l=s??`outEnd`;if(e.fillStyle=c?`#${c}`:`#333`,o===`vertical`){let o=n+a/2;l===`inBase`?(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t,o,r+i-2)):l===`inEnd`?(e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t,o,r+2)):l===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,o,r+i/2)):(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t,o,r-1))}else{let o=r+a/2;l===`inBase`?(e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t,n+4,o)):l===`inEnd`?(e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(t,n+i-4,o)):l===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,n+i/2,o)):(e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t,n+i+2,o))}}function E(n,r,a,o){let{x:s,y:c,w:l,h:u}=a,f=r.chartType===`clusteredBarH`||r.chartType===`stackedBarH`||r.chartType===`stackedBarHPct`,p=r.chartType.startsWith(`stacked`),h=r.chartType===`stackedBarPct`||r.chartType===`stackedBarHPct`,g=r.series.filter(e=>e.seriesType!==`line`),_=r.series.filter(e=>e.seriesType===`line`),b=w(r),S=b.length;if(S===0)return;let E=r.title?x(r,u,o):0,D=r.title?u*.02:0,O=r.title?u*.025:0,k=r.title?E+D+O:0,A=v(r,l,u),j=A?.side===`r`?A.reserveW:0,M=A?.side===`l`?A.reserveW:0,N=A?.side===`t`?A.reserveH:0,P=A?.side===`b`?A.reserveH:0,F=Math.max(8,Math.min(10,u*.045)),I=r.catAxisTitle?F+4:0,L=r.valAxisTitle?F+4:0,R={t:k+N+u*.02,r:j+l*.03,b:u*.14+I+P,l:l*.12+L+M};f&&(R.l=(r.catAxisHidden?l*.03:l*.22)+L+M,R.b=(r.valAxisHidden?u*.02:u*.08)+I+P),C(n,r,s,c+D,l,E);let z=r.plotAreaManualLayout,B,V,H,U;if(z&&z.w!=null&&z.h!=null?(B=s+z.x*l,V=c+z.y*u,H=z.w*l,U=z.h*u):(B=s+R.l,V=c+R.t,H=l-R.l-R.r,U=u-R.t-R.b),H<=0||U<=0)return;r.plotAreaBg&&(n.fillStyle=`#${r.plotAreaBg}`,n.fillRect(B,V,H,U));let W=0;for(let e=0;e<S;e++){let t=0;for(let n of g){let r=n.values[e]??0;p?t+=Math.abs(r):W=Math.max(W,Math.abs(r))}p&&(W=Math.max(W,t))}h&&(W=100),r.valMax!=null&&(W=r.valMax),W===0&&(W=1);let G=e(W),K=r.valMax??t(W,G),q=`#e0e0e0`,J=Math.round(K/G);if(n.textBaseline=`middle`,n.font=`${Math.max(8,Math.min(11,U/20))}px sans-serif`,n.fillStyle=r.valAxisFontColor?`#${r.valAxisFontColor}`:`#555`,!r.valAxisHidden)for(let e=0;e<=J;e++){let t=e*G,a=h?`${Math.round(t)}%`:i(t,r.valAxisFormatCode);if(f){let r=B+t/K*H;n.strokeStyle=e===0?`#aaa`:q,n.lineWidth=e===0?1:.5,n.beginPath(),n.moveTo(r,V),n.lineTo(r,V+U),n.stroke(),n.textAlign=`center`,n.fillText(a,r,V+U+10)}else{let r=V+U-t/K*U;n.strokeStyle=e===0?`#aaa`:q,n.lineWidth=e===0?1:.5,n.beginPath(),n.moveTo(B,r),n.lineTo(B+H,r),n.stroke(),n.textAlign=`right`,n.fillText(a,B-4,r)}}let Y=r.catAxisLineColor?`#${r.catAxisLineColor}`:`#aaa`,X=r.valAxisLineColor?`#${r.valAxisLineColor}`:`#aaa`,Z=r.catAxisLineWidthEmu?Math.max(.5,r.catAxisLineWidthEmu/12700):1,ee=r.valAxisLineWidthEmu?Math.max(.5,r.valAxisLineWidthEmu/12700):1,te=(e,t,r,i,a,o)=>{n.strokeStyle=a,n.lineWidth=o,n.beginPath(),n.moveTo(e,t),n.lineTo(r,i),n.stroke()},ne=!r.catAxisHidden&&!r.catAxisLineHidden,re=!r.valAxisHidden&&!r.valAxisLineHidden&&r.valAxisLineColor!=null;f?(ne&&te(B,V,B,V+U,Y,Z),re&&te(B,V+U,B+H,V+U,X,ee)):(ne&&te(B,V+U,B+H,V+U,Y,Z),re&&te(B,V,B,V+U,X,ee));let Q=f?U/S:H/S,ie=p?1:Math.max(1,g.length),ae=p?0:r.barOverlap??0,oe=r.barGapWidth??150,$=Q/(1+(ie-1)*(1-ae/100)+oe/100),se=p?0:$*(1-ae/100),ce=(Q-($+(ie-1)*se))/2;for(let e=0;e<S;e++){let t=0,a=0;if(h){for(let t of g)a+=Math.abs(t.values[e]??0);a===0&&(a=1)}for(let s=0;s<g.length;s++){let c=g[s],l=c.values[e]??0,u=h?Math.abs(l)/a*100:Math.abs(l),m=d(s,c);if(f){let a=p?s:g.length-1-s,l=p?V+(S-1-e)*Q+ce:V+(S-1-e)*Q+ce+a*se,d=u/K*H,f=p?B+t/K*H:B;n.fillStyle=m,n.fillRect(f,l,d,$),r.showDataLabels&&u>0&&(n.font=`bold ${r.dataLabelFontSizeHpt?r.dataLabelFontSizeHpt/100*o:Math.max(7,Math.min(11,$*.6))}px sans-serif`,T(n,h?`${Math.round(u)}%`:i(u,r.dataLabelFormatCode??c.valFormatCode??null),f,l,d,$,`horizontal`,r.dataLabelPosition??null,c.labelColor??r.dataLabelFontColor??null))}else{let a=p?B+e*Q+ce:B+e*Q+ce+s*se,l=u/K*U,d=V+U-(p?t+u:u)/K*U;n.fillStyle=m,n.fillRect(a,d,$,l),r.showDataLabels&&u>0&&(n.font=`bold ${r.dataLabelFontSizeHpt?r.dataLabelFontSizeHpt/100*o:Math.max(7,Math.min(11,$*.6))}px sans-serif`,T(n,h?`${Math.round(u)}%`:i(u,r.dataLabelFormatCode??c.valFormatCode??null),a,d,l,$,`vertical`,r.dataLabelPosition??null,c.labelColor??r.dataLabelFontColor??null))}p&&(t+=u)}}if(!r.catAxisHidden){n.fillStyle=r.catAxisFontColor?`#${r.catAxisFontColor}`:`#555`,n.font=`${Math.max(8,Math.min(11,Q*.5))}px sans-serif`;for(let e=0;e<S;e++){let t=(b[e]??``).toString().slice(0,12);if(f){let r=V+(S-1-e)*Q+Q/2;n.textAlign=`right`,n.textBaseline=`middle`,n.fillText(t,B-4,r)}else{let r=B+e*Q+Q/2;n.textAlign=`center`,n.textBaseline=`top`,n.fillText(t,r,V+U+3)}}}if(_.length>0&&!f)for(let e=0;e<_.length;e++){let t=_[e],r=d(g.length+e,t);n.strokeStyle=r,n.lineWidth=2,n.setLineDash([]),n.beginPath();let i=!1;for(let e=0;e<S;e++){let r=t.values[e];if(r==null){i=!1;continue}let a=B+e*Q+Q/2,o=V+U-r/K*U;i?n.lineTo(a,o):(n.moveTo(a,o),i=!0)}if(n.stroke(),t.showMarker!==!1)for(let e=0;e<S;e++){let i=t.values[e];if(i==null)continue;let a=B+e*Q+Q/2,o=V+U-i/K*U;n.fillStyle=r,n.beginPath(),n.arc(a,o,3,0,Math.PI*2),n.fill()}}y(n,f&&!p?{...r,series:[...r.series].reverse()}:r,A,s,c,l,u,B,V,H,U,k+2),r.catAxisTitle&&m(n,r.catAxisTitle,B,V,H,U,`cat`,F),r.valAxisTitle&&m(n,r.valAxisTitle,B,V,H,U,`val`,F)}function D(a,o,s,c){let{x:l,y:u,w:f,h:p}=s,h=w(o),g=h.length;if(g===0)return;let _=o.title?x(o,p,c):0,T=o.title?p*.045:0,E=o.title?p*.035:0,D=o.title?_+T+E:0,O=v(o,f,p),k=O?.side===`r`?O.reserveW:0,A=O?.side===`l`?O.reserveW:0,j=O?.side===`t`?O.reserveH:0,M=O?.side===`b`?O.reserveH:0,N=S(o.catAxisFontSizeHpt,p,c),P=S(o.valAxisFontSizeHpt,p,c),F=Math.max(N,P),I=o.catAxisTitle?F+4:0,L=o.valAxisTitle?F+4:0,R={t:D+j+P/2+2,r:k+f*.05,b:N+12+I+M,l:P*2.2+10+L+A};C(a,o,l,u+T,f,_);let z=l+R.l,B=u+R.t,V=f-R.l-R.r,H=p-R.t-R.b;if(V<=0||H<=0)return;o.plotAreaBg&&(a.fillStyle=`#${o.plotAreaBg}`,a.fillRect(z,B,V,H));let U=1/0,W=-1/0;for(let e of o.series)for(let t of e.values)t!=null&&(U=Math.min(U,t),W=Math.max(W,t));isFinite(U)||(U=0,W=1),o.valMin==null?U>0&&(U=0):U=o.valMin,o.valMax==null?W<0&&(W=0):W=o.valMax,W===U&&(W=U+1);let G=e(W-U),K=o.valMin??n(U,G),q=o.valMax??t(W,G),J=q-K;if(J===0)return;let Y=e=>B+H-(e-K)/J*H,X=o.catAxisCrossBetween===`midCat`?e=>z+(g===1?V/2:e/(g-1)*V):e=>z+(e+.5)/g*V;if(!o.valAxisHidden){let e=Math.round((q-K)/G);a.font=`${P}px sans-serif`,a.textBaseline=`middle`;for(let t=0;t<=e;t++){let e=K+t*G,n=Y(e);a.strokeStyle=e===0?`#aaa`:`#e0e0e0`,a.lineWidth=e===0?1:.5,a.beginPath(),a.moveTo(z,n),a.lineTo(z+V,n),a.stroke(),b(a,o.valAxisMajorTickMark,`val`,z,n),a.fillStyle=o.valAxisFontColor?`#${o.valAxisFontColor}`:`#555`,a.textAlign=`right`,a.fillText(i(e,o.valAxisFormatCode),z-6,n)}}a.strokeStyle=`#aaa`,a.lineWidth=1,!o.catAxisHidden&&!o.catAxisLineHidden&&(a.beginPath(),a.moveTo(z,B+H),a.lineTo(z+V,B+H),a.stroke()),!o.valAxisHidden&&!o.valAxisLineHidden&&(a.beginPath(),a.moveTo(z,B),a.lineTo(z,B+H),a.stroke());let Z=Math.max(1,2.25*c),ee=Math.max(2,2.5*c),te=S(o.dataLabelFontSizeHpt,p,c);for(let e=0;e<o.series.length;e++){let t=o.series[e],n=d(e,t);a.strokeStyle=n,a.lineWidth=Z,a.setLineDash([]),a.beginPath();let i=!1;for(let e=0;e<g;e++){let n=t.values[e];if(n==null){i=!1;continue}let r=X(e),o=Y(n);i?a.lineTo(r,o):(a.moveTo(r,o),i=!0)}a.stroke(),a.fillStyle=n;let s=t.showMarker!==!1;for(let e=0;e<g;e++){let i=t.values[e];if(i!=null&&(s&&(a.beginPath(),a.arc(X(e),Y(i),ee,0,Math.PI*2),a.fill()),o.showDataLabels)){a.font=`${te}px sans-serif`,a.fillStyle=`#333`,a.textAlign=`center`,a.textBaseline=`bottom`;let t=s?ee+1:2;a.fillText(r(i),X(e),Y(i)-t),a.fillStyle=n}}}if(!o.catAxisHidden){let e=Math.max(1,Math.ceil(g/8)),t=o.catAxisFontColor?`#${o.catAxisFontColor}`:`#555`;a.fillStyle=t,a.textAlign=`center`,a.textBaseline=`top`,a.font=`${N}px sans-serif`;for(let n=0;n<g;n+=e){let e=X(n);b(a,o.catAxisMajorTickMark,`cat`,B+H,e),a.fillStyle=t,a.fillText((h[n]??``).toString().slice(0,10),e,B+H+5)}}y(a,o,O,l,u,f,p,z,B,V,H,D+2),o.catAxisTitle&&m(a,o.catAxisTitle,z,B,V,H,`cat`,F),o.valAxisTitle&&m(a,o.valAxisTitle,z,B,V,H,`val`,F)}function O(n,r,a,o){let{x:s,y:c,w:l,h:u}=a,f=w(r),h=f.length;if(h===0)return;let g=r.chartType===`stackedArea`||r.chartType===`stackedAreaPct`,_=r.title?x(r,u,o):0,b=r.title?u*.035:0,S=r.title?u*.035:0,T=r.title?_+b+S:0,E=v(r,l,u),D=E?.side===`r`?E.reserveW:0,O=E?.side===`l`?E.reserveW:0,k=E?.side===`t`?E.reserveH:0,A=E?.side===`b`?E.reserveH:0,j=Math.max(8,Math.min(10,u*.045)),M=r.catAxisTitle?j+4:0,N=r.valAxisTitle?j+4:0,P={t:T+k+u*.02,r:D+l*.05,b:u*.14+M+A,l:l*.12+N+O};C(n,r,s,c+b,l,_);let F=s+P.l,I=c+P.t,L=l-P.l-P.r,R=u-P.t-P.b;if(L<=0||R<=0)return;r.plotAreaBg&&(n.fillStyle=`#${r.plotAreaBg}`,n.fillRect(F,I,L,R));let z=0;for(let e=0;e<h;e++)if(g){let t=0;for(let n of r.series)t+=n.values[e]??0;z=Math.max(z,t)}else for(let t of r.series)z=Math.max(z,t.values[e]??0);r.valMax!=null&&(z=r.valMax),z===0&&(z=1);let B=e(z),V=r.valMax??t(z,B),H=e=>F+(h===1?L/2:e/(h-1)*L),U=e=>I+R-e/V*R;if(!r.valAxisHidden){n.font=`${Math.max(8,Math.min(11,R/20))}px sans-serif`,n.textBaseline=`middle`;let e=Math.round(V/B);for(let t=0;t<=e;t++){let e=t*B,a=U(e);n.strokeStyle=t===0?`#aaa`:`#e0e0e0`,n.lineWidth=t===0?1:.5,n.beginPath(),n.moveTo(F,a),n.lineTo(F+L,a),n.stroke(),n.fillStyle=r.valAxisFontColor?`#${r.valAxisFontColor}`:`#555`,n.textAlign=`right`,n.fillText(i(e,r.valAxisFormatCode),F-4,a)}}!r.catAxisHidden&&!r.catAxisLineHidden&&(n.strokeStyle=`#aaa`,n.lineWidth=1,n.beginPath(),n.moveTo(F,I+R),n.lineTo(F+L,I+R),n.stroke());let W=g?Array(h).fill(0):null;for(let e=r.series.length-1;e>=0;e--){let t=r.series[e],i=d(e,t),a=I+R;if(n.beginPath(),g&&W){for(let e=0;e<h;e++){let r=(t.values[e]??0)+W[e],i=H(e),a=U(r);e===0?n.moveTo(i,a):n.lineTo(i,a)}for(let e=h-1;e>=0;e--)n.lineTo(H(e),U(W[e]));for(let e=0;e<h;e++)W[e]+=t.values[e]??0}else{n.moveTo(H(0),a);for(let e=0;e<h;e++)n.lineTo(H(e),U(t.values[e]??0));n.lineTo(H(h-1),a)}n.closePath(),n.fillStyle=p(i,.6),n.fill(),n.strokeStyle=i,n.lineWidth=1.5,n.setLineDash([]),n.stroke()}if(!r.catAxisHidden){let e=Math.max(1,Math.ceil(h/8));n.fillStyle=r.catAxisFontColor?`#${r.catAxisFontColor}`:`#555`,n.textAlign=`center`,n.textBaseline=`top`,n.font=`${Math.max(8,Math.min(11,L/h*.8))}px sans-serif`;for(let t=0;t<h;t+=e)n.fillText((f[t]??``).toString().slice(0,10),H(t),I+R+3)}y(n,r,E,s,c,l,u,F,I,L,R,T+2),r.catAxisTitle&&m(n,r.catAxisTitle,F,I,L,R,`cat`,j),r.valAxisTitle&&m(n,r.valAxisTitle,F,I,L,R,`val`,j)}function k(e,t,n,r,i){let{x:a,y:o,w:s,h:c}=n,l=t.series[0];if(!l)return;let d=l.categories&&l.categories.length>0?l.categories:t.categories,p=l.values.map(e=>Math.abs(e??0)),m=p.reduce((e,t)=>e+t,0);if(m===0)return;let h=t.title?x(t,c,i):0,g=t.title?c*.035:0,_=t.title?c*.035:0,v=t.title?h+g+_:0;C(e,t,a,o+g,s,h);let b=t.showLegend?(()=>{let e=t.legendPos??`r`,n=e===`l`?`l`:e===`t`?`t`:e===`b`?`b`:`r`;return n===`r`||n===`l`?{side:n,reserveW:Math.max(80,s*.28),reserveH:0}:{side:n,reserveW:0,reserveH:Math.max(18,c*.08)}})():null,S=b?.side===`r`?b.reserveW:0,w=b?.side===`l`?b.reserveW:0,T=b?.side===`t`?b.reserveH:0,E=b?.side===`b`?b.reserveH:0,D=s-S-w,O=c-v-T-E-c*.02,k=a+w+D/2,A=o+v+T+c*.02+O/2,j=Math.min(D,O)*.42,M=r?j*.5:0,N=-Math.PI/2;for(let n=0;n<p.length;n++){let i=p[n]/m*Math.PI*2,a=f(n,l);if(e.beginPath(),e.moveTo(k,A),e.arc(k,A,j,N,N+i),e.closePath(),e.fillStyle=a,e.fill(),e.strokeStyle=`#fff`,e.lineWidth=1,e.stroke(),t.showDataLabels&&i>.15){let t=N+i/2,a=j*(r?.75:.6),o=k+Math.cos(t)*a,s=A+Math.sin(t)*a,c=Math.round(p[n]/m*100);e.font=`bold ${Math.max(8,j*.1)}px sans-serif`,e.fillStyle=`#fff`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`${c}%`,o,s)}N+=i}if(r&&(e.beginPath(),e.arc(k,A,M,0,Math.PI*2),e.fillStyle=`#fff`,e.fill()),b){let n=p.map((e,t)=>({name:(d[t]??`Item ${t+1}`).toString(),color:l.dataPointColors?.[t]??l.color??u[t%u.length],values:[]})),r=k-D/2;y(e,{...t,series:n},b,a,o,s,c,r,A-O/2,D,O,v+2)}}function A(n,i,a,o){let{x:s,y:c,w:l,h:u}=a,f=w(i),m=f.length;if(m<3)return;let h=i.title?x(i,u,o):0,g=i.title?u*.035:0,_=i.title?u*.035:0,b=i.title?h+g+_:0,T=v(i,l,u),E=T?.side===`r`?T.reserveW:0,D=T?.side===`l`?T.reserveW:0,O=T?.side===`t`?T.reserveH:0,k=T?.side===`b`?T.reserveH:0;C(n,i,s,c+g,l,h);let A=l-E-D,j=u-b-O-k-u*.02,M=s+D+A/2,N=c+b+O+u*.02+j/2,P=Math.min(A,j)*.38,F=0;for(let e of i.series)for(let t of e.values)F=Math.max(F,t??0);i.valMax!=null&&(F=i.valMax),F===0&&(F=1);let I=e(F),L=i.valMax??t(F,I),R=-Math.PI/2,z=e=>R+e/m*Math.PI*2,B=Math.round(L/I);n.strokeStyle=`#ddd`,n.lineWidth=.5;for(let e=1;e<=B;e++){let t=e/B*P;n.beginPath();for(let e=0;e<m;e++){let r=z(e),i=M+Math.cos(r)*t,a=N+Math.sin(r)*t;e===0?n.moveTo(i,a):n.lineTo(i,a)}n.closePath(),n.stroke()}n.strokeStyle=`#bbb`,n.lineWidth=.5;for(let e=0;e<m;e++){let t=z(e);n.beginPath(),n.moveTo(M,N),n.lineTo(M+Math.cos(t)*P,N+Math.sin(t)*P),n.stroke()}if(!i.valAxisHidden){n.font=`${S(i.valAxisFontSizeHpt,u,o)}px sans-serif`,n.fillStyle=`#555`,n.textAlign=`right`,n.textBaseline=`middle`;for(let e=1;e<=B;e++){let t=e/B*L,i=e/B*P;n.fillText(r(t),M-3,N-i)}}n.font=`${Math.max(8,Math.min(11,P*.2))}px sans-serif`,n.fillStyle=`#444`,n.textBaseline=`middle`;for(let e=0;e<m;e++){let t=z(e),r=M+Math.cos(t)*(P+12),i=N+Math.sin(t)*(P+12);n.textAlign=Math.cos(t)<-.1?`right`:Math.cos(t)>.1?`left`:`center`,n.fillText((f[e]??``).toString().slice(0,12),r,i)}let V=i.radarStyle===`filled`,H=Math.max(2,P*.025);for(let e=0;e<i.series.length;e++){let t=i.series[e],r=d(e,t),a=[];for(let e=0;e<m;e++){let n=t.values[e];if(n==null){a.push(null);continue}let r=n/L,i=z(e);a.push([M+Math.cos(i)*P*r,N+Math.sin(i)*P*r])}n.beginPath();let o=!1;for(let e of a){if(e==null){o=!1;continue}o?n.lineTo(e[0],e[1]):(n.moveTo(e[0],e[1]),o=!0)}let s=a.every(e=>e!=null);if(V&&s?(n.closePath(),n.fillStyle=p(r,.25),n.fill()):s&&n.closePath(),n.strokeStyle=r,n.lineWidth=2,n.stroke(),!V&&t.showMarker!==!1){n.fillStyle=r;for(let e of a)e!=null&&(n.beginPath(),n.arc(e[0],e[1],H,0,Math.PI*2),n.fill())}}y(n,i,T,s,c,l,u,M-A/2,N-j/2,A,j,b+2)}function j(t,n,r,a){let{x:o,y:s,w:c,h:l}=r,u=n.title?x(n,l,a):0,f=n.title?l*.035:0,p=n.title?l*.035:0,h=n.title?u+f+p:0,g=v(n,c,l),_=g?.side===`r`?g.reserveW:0,S=g?.side===`l`?g.reserveW:0,w=g?.side===`t`?g.reserveH:0,T=g?.side===`b`?g.reserveH:0,E=Math.max(8,Math.min(10,l*.045)),D=n.catAxisTitle?E+4:0,O=n.valAxisTitle?E+4:0;if(n.title){let e=n.titleManualLayout;e&&(e.x!==void 0||e.y!==void 0)?C(t,n,o+e.x*c,s+e.y*l,(e.w??.5)*c,u):C(t,n,o,s+f,c,u)}let k=n.plotAreaManualLayout,A,j,F,L;if(k&&k.w!=null&&k.h!=null)A=o+k.x*c,j=s+k.y*l,F=k.w*c,L=k.h*l;else{let e={t:h+w+l*.02,r:_+c*.05,b:(n.catAxisHidden?l*.04:l*.12)+D+T,l:(n.valAxisHidden?c*.04:c*.12)+O+S};A=o+e.l,j=s+e.t,F=c-e.l-e.r,L=l-e.t-e.b}if(F<=0||L<=0)return;n.plotAreaBg&&(t.fillStyle=`#${n.plotAreaBg}`,t.fillRect(A,j,F,L));let R=[],z=[];for(let e of n.series){let t=e.categories??[];for(let e of t){let t=parseFloat(e);isNaN(t)||R.push(t)}for(let t of e.values)t!=null&&z.push(t)}let B=R.length===0;if(B){let e=Math.max(...n.series.map(e=>e.values.length));for(let t=0;t<e;t++)R.push(t)}let V=Math.min(...R),H=Math.max(...R),U=Math.min(...z),W=Math.max(...z);if(V===H&&(--V,H+=1),U===W&&(--U,W+=1),n.valMin==null?U>0&&(U=0):U=n.valMin,n.valMax!=null&&(W=n.valMax),n.catAxisMin!=null&&(V=n.catAxisMin),n.catAxisMax!=null&&(H=n.catAxisMax),n.catAxisMin==null||n.catAxisMax==null){let t=e(H-V);t>0&&(n.catAxisMin??(V=Math.floor(V/t)*t),n.catAxisMax??(H=Math.ceil(H/t)*t))}let G=e=>A+(e-V)/(H-V)*F,K=e=>j+L-(e-U)/(W-U)*L;if(!n.valAxisHidden){let r=Math.max(8,Math.min(11,L/20));t.font=`${n.valAxisFontBold?`bold `:``}${r}px sans-serif`;let a=e(W-U),o=Math.round((W-U)/a)+1;for(let e=0;e<o;e++){let r=U+e*a;if(r>W+a*.01)break;let o=K(r);t.strokeStyle=`#e0e0e0`,t.lineWidth=.5,t.beginPath(),t.moveTo(A,o),t.lineTo(A+F,o),t.stroke(),t.fillStyle=`#555`,t.textAlign=`right`,t.textBaseline=`middle`,t.fillText(i(r,n.valAxisFormatCode),A-4,o);let s=n.valAxisLineColor?`#${n.valAxisLineColor}`:void 0,c=n.valAxisLineWidthEmu?Math.max(.5,n.valAxisLineWidthEmu/12700):void 0;b(t,n.valAxisMajorTickMark,`val`,A,o,s,c)}}let q=j+L;if(n.catAxisCrossesAt!=null)q=I(K(n.catAxisCrossesAt),j,j+L);else{let e=n.catAxisCrosses??`autoZero`;e===`autoZero`&&U<0&&W>0?q=I(K(0),j,j+L):e===`min`?q=j+L:e===`max`&&(q=j)}if(!n.catAxisHidden&&!n.catAxisLineHidden&&(t.save(),t.strokeStyle=n.catAxisLineColor?`#${n.catAxisLineColor}`:`#888`,t.lineWidth=n.catAxisLineWidthEmu?Math.max(.5,n.catAxisLineWidthEmu/12700):1,t.lineCap=`butt`,t.beginPath(),t.moveTo(A,q),t.lineTo(A+F,q),t.stroke(),t.restore()),!n.valAxisHidden&&!n.valAxisLineHidden&&(t.save(),t.strokeStyle=n.valAxisLineColor?`#${n.valAxisLineColor}`:`#888`,t.lineWidth=n.valAxisLineWidthEmu?Math.max(.5,n.valAxisLineWidthEmu/12700):1,t.beginPath(),t.moveTo(A,j),t.lineTo(A,j+L),t.stroke(),t.restore()),!n.catAxisHidden){let r=Math.max(8,Math.min(11,L/20));t.font=`${n.catAxisFontBold?`bold `:``}${r}px sans-serif`;let a=e(H-V),o=Math.round((H-V)/a)+1;t.fillStyle=`#555`,t.textAlign=`center`,t.textBaseline=`top`;for(let e=0;e<o;e++){let r=V+e*a;if(r>H+a*.01)break;let o=G(r);t.fillText(i(r,n.catAxisFormatCode),o,q+4);let s=n.catAxisLineColor?`#${n.catAxisLineColor}`:void 0,c=n.catAxisLineWidthEmu?Math.max(.5,n.catAxisLineWidthEmu/12700):void 0;b(t,n.catAxisMajorTickMark,`cat`,q,o,s,c)}}let J=n.chartType===`bubble`,Y=J?`marker`:n.scatterStyle??`marker`,X=Y===`line`||Y===`lineMarker`||Y===`lineNoMarker`,Z=Y===`smooth`||Y===`smoothMarker`||Y===`smoothNoMarker`,ee=Y===`lineNoMarker`||Y===`smoothNoMarker`;for(let e=0;e<n.series.length;e++){let r=n.series[e],i=d(e,r),o=r.categories??[];for(let e of r.errBars??[])N(t,r,e,o,B,G,K,i);if(X||Z){let e=[];for(let t=0;t<r.values.length;t++){let n=r.values[t];if(n==null)continue;let i=B?t:parseFloat(o[t]??`0`);isNaN(i)||e.push({x:G(i),y:K(n)})}if(e.length>=2){if(t.save(),t.strokeStyle=r.color?`#${r.color}`:i,t.lineWidth=1.5,t.beginPath(),t.moveTo(e[0].x,e[0].y),Z&&e.length>=3)for(let n=0;n<e.length-1;n++){let r=e[n-1]??e[n],i=e[n],a=e[n+1],o=e[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;t.bezierCurveTo(s,c,l,u,a.x,a.y)}else for(let n=1;n<e.length;n++)t.lineTo(e[n].x,e[n].y);t.stroke(),t.restore()}}if(!(ee||r.showMarker===!1||typeof r.markerSymbol==`string`&&r.markerSymbol===`none`)){let e=0;if(J&&r.bubbleSizes&&r.bubbleSizes.length>0){let t=Math.max(0,...r.bubbleSizes.filter(e=>e!=null));t>0&&(e=Math.min(F,L)/Math.max(8,r.values.length*1.6)/Math.sqrt(t))}for(let n=0;n<r.values.length;n++){let s=r.values[n];if(s==null)continue;let c=B?n:parseFloat(o[n]??`0`);if(isNaN(c))continue;let l=(r.dataPointOverrides??[]).find(e=>e.idx===n),u=l?.markerSymbol??r.markerSymbol??`circle`,d=l?.markerSize??r.markerSize??5;if(J&&e>0){let t=r.bubbleSizes?.[n];t!=null&&t>0&&(d=Math.sqrt(t)*e*2/a)}let f=l?.markerFill??l?.color??r.markerFill??i,p=l?.markerLine??r.markerLine??null;M(t,G(c),K(s),u,d,f,p,a)}}P(t,r,o,B,G,K,L,a)}y(t,n,g,o,s,c,l,A,j,F,L,h+2),n.catAxisTitle&&m(t,n.catAxisTitle,A,j,F,L,`cat`,E),n.valAxisTitle&&m(t,n.valAxisTitle,A,j,F,L,`val`,E)}function M(e,t,n,r,i,a,o,s){let c=Math.max(2,i*s),l=c/2,u=a.startsWith(`#`)?a:`#${a}`,d=o?o.startsWith(`#`)?o:`#${o}`:null;switch(e.save(),e.fillStyle=u,d&&(e.strokeStyle=d,e.lineWidth=1),r){case`square`:e.fillRect(t-l,n-l,c,c),o&&e.strokeRect(t-l,n-l,c,c);break;case`diamond`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n),e.lineTo(t,n+l),e.lineTo(t-l,n),e.closePath(),e.fill(),o&&e.stroke();break;case`triangle`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n+l),e.lineTo(t-l,n+l),e.closePath(),e.fill(),o&&e.stroke();break;case`x`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n-l),e.lineTo(t+l,n+l),e.moveTo(t-l,n+l),e.lineTo(t+l,n-l),e.stroke();break;case`plus`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.moveTo(t,n-l),e.lineTo(t,n+l),e.stroke();break;case`star`:e.beginPath();for(let r=0;r<10;r++){let i=r%2==0?l:l*.45,a=-Math.PI/2+r*Math.PI/5,o=t+Math.cos(a)*i,s=n+Math.sin(a)*i;r===0?e.moveTo(o,s):e.lineTo(o,s)}e.closePath(),e.fill(),o&&e.stroke();break;case`dot`:e.beginPath(),e.arc(t,n,Math.max(1,c*.25),0,Math.PI*2),e.fill();break;case`dash`:{let r=Math.max(1,c*.25);e.fillRect(t-l,n-r/2,c,r);break}default:e.beginPath(),e.arc(t,n,l,0,Math.PI*2),e.fill(),o&&e.stroke();break}e.restore()}function N(e,t,n,r,i,a,o,s){e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/12700):1,e.setLineDash(L(n.dash));let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`,u=n.dir===`x`,d=e.lineWidth*1.5;for(let s=0;s<t.values.length;s++){let f=t.values[s];if(f==null)continue;let p=i?s:parseFloat(r[s]??`0`);if(isNaN(p))continue;let m=a(p),h=o(f),g=t=>{let r=m,i=h;u?r=a(p+t):i=o(f+t),e.beginPath(),e.moveTo(m,h),e.lineTo(r,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),u?(e.moveTo(r,i-d),e.lineTo(r,i+d)):(e.moveTo(r-d,i),e.lineTo(r+d,i)),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&g(e)}if(l){let e=n.minus[s];e!=null&&g(-e)}}e.restore()}function P(e,t,n,r,a,o,s,c){let l=t.dataLabelOverrides??[];if(l.length===0&&!t.seriesDataLabels)return;let u=t.seriesDataLabels;for(let d=0;d<t.values.length;d++){let f=t.values[d];if(f==null)continue;let p=r?d:parseFloat(n[d]??`0`);if(isNaN(p))continue;let m=l.find(e=>e.idx===d),h;if(m){if(m.text===``)continue;h=m.text}else if(u&&(u.showVal||u.showSerName||u.showCatName)){let e=[];if(u.showCatName&&!r&&e.push(n[d]??``),u.showSerName&&e.push(t.name),u.showVal&&e.push(i(f,u.formatCode??null)),h=e.filter(Boolean).join(` `),!h)continue}else continue;let g=m?.position??u?.position??`r`,_=m?.fontSizeHpt??u?.fontSizeHpt,v=_?_/100*c:Math.max(9,Math.min(11,s/25)),y=m?.fontColor??u?.fontColor,b=m?.fontBold??u?.fontBold??!1;F(e,a(p),o(f),h,g,v,y,b)}}function F(e,t,n,r,i,a,o,s){e.save(),e.font=`${s?`bold `:``}${a}px sans-serif`,e.fillStyle=o?`#${o}`:`#333`;let c=a*.6,l=t,u=n;switch(i){case`l`:e.textAlign=`right`,e.textBaseline=`middle`,l=t-c;break;case`r`:e.textAlign=`left`,e.textBaseline=`middle`,l=t+c;break;case`t`:e.textAlign=`center`,e.textBaseline=`bottom`,u=n-c;break;case`b`:e.textAlign=`center`,e.textBaseline=`top`,u=n+c;break;case`ctr`:e.textAlign=`center`,e.textBaseline=`middle`;break;default:e.textAlign=`left`,e.textBaseline=`middle`,l=t+c;break}let d=r.split(/\r?\n/),f=a*1.15,p=f*d.length,m=u;e.textBaseline===`middle`?m=u-(p-f)/2:e.textBaseline===`bottom`&&(m=u-(p-f));for(let t of d)e.fillText(t,l,m),m+=f;e.restore()}function I(e,t,n){return e<t?t:e>n?n:e}function L(e){if(!e)return[];switch(e){case`solid`:return[];case`dot`:case`sysDot`:return[1,2];case`dash`:case`sysDash`:return[4,2];case`lgDash`:return[8,3];case`dashDot`:case`sysDashDot`:return[4,2,1,2];case`lgDashDot`:return[8,3,1,3];case`dashDotDot`:case`sysDashDotDot`:case`lgDashDotDot`:return[4,2,1,2,1,2];default:return[]}}function R(t,n,r){let{x:i,y:a,w:o,h:s}=r,c=n.plotAreaManualLayout,l,u,d,f;if(c&&c.w!=null&&c.h!=null)l=i+c.x*o,u=a+c.y*s,d=c.w*o,f=c.h*s;else{let e=n.valAxisHidden?o*.01:o*.11,t=o*.01,r=s*.12,c=s*.14;l=i+e,u=a+r,d=o-e-t,f=s-r-c}let p=n.series[0]?.values??[],m=n.categories,h=m.length;if(h===0)return;let g=new Set(n.subtotalIndices),_=0,v=[];for(let e=0;e<h;e++){let t=p[e]??0;if(e===0||g.has(e))v.push({start:0,end:t,isSub:!0,isPos:!0}),_=t;else{let e=t>=0?_:_+t,n=t>=0?_+t:_;v.push({start:e,end:n,isSub:!1,isPos:t>=0}),_+=t}}let y=v.map(e=>e.end),b=v.map(e=>e.start),x=Math.max(...y,...b),S=Math.min(...b,0),C=x-S;if(C<=0)return;let w=S<0?S-C*.05:0,T=(x-w)*1.1,E=w+T,D=e(T);t.save();let O=Math.round(s*.042);if(t.font=`${O}px sans-serif`,!n.valAxisHidden){t.strokeStyle=`#e8e8e8`,t.lineWidth=.7,t.fillStyle=`#666`,t.textAlign=`right`,t.textBaseline=`middle`;for(let e=Math.ceil(w/D)*D;e<=E;e+=D){let n=u+f*(1-(e-w)/T);t.beginPath(),t.moveTo(l,n),t.lineTo(l+d,n),t.stroke(),t.fillText(e.toLocaleString(),l-4,n)}}let k=!n.valAxisHidden&&!n.valAxisLineHidden,A=!n.catAxisHidden&&!n.catAxisLineHidden;(k||A)&&(t.strokeStyle=`#bbb`,t.lineWidth=1,t.beginPath(),k?(t.moveTo(l,u),t.lineTo(l,u+f),A&&t.lineTo(l+d,u+f)):A&&(t.moveTo(l,u+f),t.lineTo(l+d,u+f)),t.stroke());let j=d/h,M=j/(1+(n.barGapWidth??150)/100);v.forEach((e,r)=>{let i=l+j*r+(j-M)/2,a=u+f*(1-(e.end-w)/T),o=u+f*(1-(e.start-w)/T),c=Math.max(1,o-a);if(e.isSub?(t.fillStyle=`#196ECA`,t.fillRect(i,a,M,c)):(t.strokeStyle=e.isPos?`#5BA4E6`:`#E46970`,t.lineWidth=1.5,t.strokeRect(i+.75,a+.75,M-1.5,c-1.5)),r<h-1){let n=l+j*(r+1)+(j-M)/2,s=e.isPos?a:o;t.strokeStyle=`#ccc`,t.lineWidth=.8,t.setLineDash([3,3]),t.beginPath(),t.moveTo(i+M,s),t.lineTo(n,s),t.stroke(),t.setLineDash([])}let d=p[r]??0,m=d<0?`△ ${Math.abs(d).toLocaleString()}`:d.toLocaleString(),g=n.series[0]?.dataLabelColors?.[r]??null;t.fillStyle=g?`#${g}`:n.dataLabelFontColor?`#${n.dataLabelFontColor}`:`#595959`,t.font=`bold ${Math.round(s*.044)}px sans-serif`,t.textAlign=`center`,d<0?(t.textBaseline=`top`,t.fillText(m,i+M/2,o+3)):(t.textBaseline=`bottom`,t.fillText(m,i+M/2,a-3))}),t.textAlign=`center`,t.textBaseline=`top`,t.fillStyle=`#666`,t.font=`${Math.round(s*.038)}px sans-serif`;let N=u+f+4;for(let e=0;e<h;e++){let n=l+j*e+j/2;m[e].split(/\s+/).forEach((e,r)=>t.fillText(e,n,N+r*(O+2)))}t.restore()}function z(e,t,n,r=1.333){let{x:i,y:a,w:o,h:s}=n;if(t.chartBg&&(e.fillStyle=`#${t.chartBg}`,e.fillRect(i,a,o,s)),t.series.length===0){e.fillStyle=`#888`,e.font=`12px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`(no data)`,i+o/2,a+s/2);return}switch(t.chartType){case`clusteredBar`:case`clusteredBarH`:case`stackedBar`:case`stackedBarH`:case`stackedBarPct`:case`stackedBarHPct`:E(e,t,n,r);break;case`line`:case`stackedLine`:case`stackedLinePct`:D(e,t,n,r);break;case`area`:case`stackedArea`:case`stackedAreaPct`:O(e,t,n,r);break;case`pie`:k(e,t,n,!1,r);break;case`doughnut`:k(e,t,n,!0,r);break;case`radar`:A(e,t,n,r);break;case`scatter`:case`bubble`:j(e,t,n,r);break;case`waterfall`:R(e,t,n);break;default:e.fillStyle=`#888`,e.font=`11px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`Chart: ${t.chartType}`,i+o/2,a+s/2)}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return z}});
|
|
@@ -355,7 +355,7 @@ function E(n, r, a, o) {
|
|
|
355
355
|
}
|
|
356
356
|
h && (W = 100), r.valMax != null && (W = r.valMax), W === 0 && (W = 1);
|
|
357
357
|
let G = e(W), K = r.valMax ?? t(W, G), q = "#e0e0e0", J = Math.round(K / G);
|
|
358
|
-
if (n.textBaseline = "middle", n.font = `${Math.max(8, Math.min(11, U / 20))}px sans-serif`, n.fillStyle = "#555", !r.valAxisHidden) for (let e = 0; e <= J; e++) {
|
|
358
|
+
if (n.textBaseline = "middle", n.font = `${Math.max(8, Math.min(11, U / 20))}px sans-serif`, n.fillStyle = r.valAxisFontColor ? `#${r.valAxisFontColor}` : "#555", !r.valAxisHidden) for (let e = 0; e <= J; e++) {
|
|
359
359
|
let t = e * G, a = h ? `${Math.round(t)}%` : i(t, r.valAxisFormatCode);
|
|
360
360
|
if (f) {
|
|
361
361
|
let r = B + t / K * H;
|
|
@@ -365,8 +365,11 @@ function E(n, r, a, o) {
|
|
|
365
365
|
n.strokeStyle = e === 0 ? "#aaa" : q, n.lineWidth = e === 0 ? 1 : .5, n.beginPath(), n.moveTo(B, r), n.lineTo(B + H, r), n.stroke(), n.textAlign = "right", n.fillText(a, B - 4, r);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
let Y = r.catAxisLineColor ? `#${r.catAxisLineColor}` : "#aaa", X = r.valAxisLineColor ? `#${r.valAxisLineColor}` : "#aaa", Z = r.catAxisLineWidthEmu ? Math.max(.5, r.catAxisLineWidthEmu / 12700) : 1, ee = r.valAxisLineWidthEmu ? Math.max(.5, r.valAxisLineWidthEmu / 12700) : 1, te = (e, t, r, i, a, o) => {
|
|
369
|
+
n.strokeStyle = a, n.lineWidth = o, n.beginPath(), n.moveTo(e, t), n.lineTo(r, i), n.stroke();
|
|
370
|
+
}, ne = !r.catAxisHidden && !r.catAxisLineHidden, re = !r.valAxisHidden && !r.valAxisLineHidden && r.valAxisLineColor != null;
|
|
371
|
+
f ? (ne && te(B, V, B, V + U, Y, Z), re && te(B, V + U, B + H, V + U, X, ee)) : (ne && te(B, V + U, B + H, V + U, Y, Z), re && te(B, V, B, V + U, X, ee));
|
|
372
|
+
let Q = f ? U / S : H / S, ie = p ? 1 : Math.max(1, g.length), ae = p ? 0 : r.barOverlap ?? 0, oe = r.barGapWidth ?? 150, $ = Q / (1 + (ie - 1) * (1 - ae / 100) + oe / 100), se = p ? 0 : $ * (1 - ae / 100), ce = (Q - ($ + (ie - 1) * se)) / 2;
|
|
370
373
|
for (let e = 0; e < S; e++) {
|
|
371
374
|
let t = 0, a = 0;
|
|
372
375
|
if (h) {
|
|
@@ -376,24 +379,24 @@ function E(n, r, a, o) {
|
|
|
376
379
|
for (let s = 0; s < g.length; s++) {
|
|
377
380
|
let c = g[s], l = c.values[e] ?? 0, u = h ? Math.abs(l) / a * 100 : Math.abs(l), m = d(s, c);
|
|
378
381
|
if (f) {
|
|
379
|
-
let a = p ? s : g.length - 1 - s, l = p ? V + (S - 1 - e) *
|
|
382
|
+
let a = p ? s : g.length - 1 - s, l = p ? V + (S - 1 - e) * Q + ce : V + (S - 1 - e) * Q + ce + a * se, d = u / K * H, f = p ? B + t / K * H : B;
|
|
380
383
|
n.fillStyle = m, n.fillRect(f, l, d, $), r.showDataLabels && u > 0 && (n.font = `bold ${r.dataLabelFontSizeHpt ? r.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`, T(n, h ? `${Math.round(u)}%` : i(u, r.dataLabelFormatCode ?? c.valFormatCode ?? null), f, l, d, $, "horizontal", r.dataLabelPosition ?? null, c.labelColor ?? r.dataLabelFontColor ?? null));
|
|
381
384
|
} else {
|
|
382
|
-
let a = p ? B + e *
|
|
385
|
+
let a = p ? B + e * Q + ce : B + e * Q + ce + s * se, l = u / K * U, d = V + U - (p ? t + u : u) / K * U;
|
|
383
386
|
n.fillStyle = m, n.fillRect(a, d, $, l), r.showDataLabels && u > 0 && (n.font = `bold ${r.dataLabelFontSizeHpt ? r.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`, T(n, h ? `${Math.round(u)}%` : i(u, r.dataLabelFormatCode ?? c.valFormatCode ?? null), a, d, l, $, "vertical", r.dataLabelPosition ?? null, c.labelColor ?? r.dataLabelFontColor ?? null));
|
|
384
387
|
}
|
|
385
388
|
p && (t += u);
|
|
386
389
|
}
|
|
387
390
|
}
|
|
388
391
|
if (!r.catAxisHidden) {
|
|
389
|
-
n.fillStyle = "#555", n.font = `${Math.max(8, Math.min(11,
|
|
392
|
+
n.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#555", n.font = `${Math.max(8, Math.min(11, Q * .5))}px sans-serif`;
|
|
390
393
|
for (let e = 0; e < S; e++) {
|
|
391
394
|
let t = (b[e] ?? "").toString().slice(0, 12);
|
|
392
395
|
if (f) {
|
|
393
|
-
let r = V + (S - 1 - e) *
|
|
396
|
+
let r = V + (S - 1 - e) * Q + Q / 2;
|
|
394
397
|
n.textAlign = "right", n.textBaseline = "middle", n.fillText(t, B - 4, r);
|
|
395
398
|
} else {
|
|
396
|
-
let r = B + e *
|
|
399
|
+
let r = B + e * Q + Q / 2;
|
|
397
400
|
n.textAlign = "center", n.textBaseline = "top", n.fillText(t, r, V + U + 3);
|
|
398
401
|
}
|
|
399
402
|
}
|
|
@@ -408,13 +411,13 @@ function E(n, r, a, o) {
|
|
|
408
411
|
i = !1;
|
|
409
412
|
continue;
|
|
410
413
|
}
|
|
411
|
-
let a = B + e *
|
|
414
|
+
let a = B + e * Q + Q / 2, o = V + U - r / K * U;
|
|
412
415
|
i ? n.lineTo(a, o) : (n.moveTo(a, o), i = !0);
|
|
413
416
|
}
|
|
414
417
|
if (n.stroke(), t.showMarker !== !1) for (let e = 0; e < S; e++) {
|
|
415
418
|
let i = t.values[e];
|
|
416
419
|
if (i == null) continue;
|
|
417
|
-
let a = B + e *
|
|
420
|
+
let a = B + e * Q + Q / 2, o = V + U - i / K * U;
|
|
418
421
|
n.fillStyle = r, n.beginPath(), n.arc(a, o, 3, 0, Math.PI * 2), n.fill();
|
|
419
422
|
}
|
|
420
423
|
}
|
|
@@ -447,11 +450,11 @@ function D(a, o, s, c) {
|
|
|
447
450
|
a.font = `${P}px sans-serif`, a.textBaseline = "middle";
|
|
448
451
|
for (let t = 0; t <= e; t++) {
|
|
449
452
|
let e = K + t * G, n = Y(e);
|
|
450
|
-
a.strokeStyle = e === 0 ? "#aaa" : "#e0e0e0", a.lineWidth = e === 0 ? 1 : .5, a.beginPath(), a.moveTo(z, n), a.lineTo(z + V, n), a.stroke(), b(a, o.valAxisMajorTickMark, "val", z, n), a.fillStyle = "#555", a.textAlign = "right", a.fillText(i(e, o.valAxisFormatCode), z - 6, n);
|
|
453
|
+
a.strokeStyle = e === 0 ? "#aaa" : "#e0e0e0", a.lineWidth = e === 0 ? 1 : .5, a.beginPath(), a.moveTo(z, n), a.lineTo(z + V, n), a.stroke(), b(a, o.valAxisMajorTickMark, "val", z, n), a.fillStyle = o.valAxisFontColor ? `#${o.valAxisFontColor}` : "#555", a.textAlign = "right", a.fillText(i(e, o.valAxisFormatCode), z - 6, n);
|
|
451
454
|
}
|
|
452
455
|
}
|
|
453
456
|
a.strokeStyle = "#aaa", a.lineWidth = 1, !o.catAxisHidden && !o.catAxisLineHidden && (a.beginPath(), a.moveTo(z, B + H), a.lineTo(z + V, B + H), a.stroke()), !o.valAxisHidden && !o.valAxisLineHidden && (a.beginPath(), a.moveTo(z, B), a.lineTo(z, B + H), a.stroke());
|
|
454
|
-
let Z = Math.max(1, 2.25 * c),
|
|
457
|
+
let Z = Math.max(1, 2.25 * c), ee = Math.max(2, 2.5 * c), te = S(o.dataLabelFontSizeHpt, p, c);
|
|
455
458
|
for (let e = 0; e < o.series.length; e++) {
|
|
456
459
|
let t = o.series[e], n = d(e, t);
|
|
457
460
|
a.strokeStyle = n, a.lineWidth = Z, a.setLineDash([]), a.beginPath();
|
|
@@ -469,19 +472,19 @@ function D(a, o, s, c) {
|
|
|
469
472
|
let s = t.showMarker !== !1;
|
|
470
473
|
for (let e = 0; e < g; e++) {
|
|
471
474
|
let i = t.values[e];
|
|
472
|
-
if (i != null && (s && (a.beginPath(), a.arc(X(e), Y(i),
|
|
473
|
-
a.font = `${
|
|
474
|
-
let t = s ?
|
|
475
|
+
if (i != null && (s && (a.beginPath(), a.arc(X(e), Y(i), ee, 0, Math.PI * 2), a.fill()), o.showDataLabels)) {
|
|
476
|
+
a.font = `${te}px sans-serif`, a.fillStyle = "#333", a.textAlign = "center", a.textBaseline = "bottom";
|
|
477
|
+
let t = s ? ee + 1 : 2;
|
|
475
478
|
a.fillText(r(i), X(e), Y(i) - t), a.fillStyle = n;
|
|
476
479
|
}
|
|
477
480
|
}
|
|
478
481
|
}
|
|
479
482
|
if (!o.catAxisHidden) {
|
|
480
|
-
let e = Math.max(1, Math.ceil(g / 8));
|
|
481
|
-
a.fillStyle =
|
|
482
|
-
for (let
|
|
483
|
-
let e = X(
|
|
484
|
-
b(a, o.catAxisMajorTickMark, "cat", B + H, e), a.fillStyle =
|
|
483
|
+
let e = Math.max(1, Math.ceil(g / 8)), t = o.catAxisFontColor ? `#${o.catAxisFontColor}` : "#555";
|
|
484
|
+
a.fillStyle = t, a.textAlign = "center", a.textBaseline = "top", a.font = `${N}px sans-serif`;
|
|
485
|
+
for (let n = 0; n < g; n += e) {
|
|
486
|
+
let e = X(n);
|
|
487
|
+
b(a, o.catAxisMajorTickMark, "cat", B + H, e), a.fillStyle = t, a.fillText((h[n] ?? "").toString().slice(0, 10), e, B + H + 5);
|
|
485
488
|
}
|
|
486
489
|
}
|
|
487
490
|
y(a, o, O, l, u, f, p, z, B, V, H, D + 2), o.catAxisTitle && m(a, o.catAxisTitle, z, B, V, H, "cat", F), o.valAxisTitle && m(a, o.valAxisTitle, z, B, V, H, "val", F);
|
|
@@ -512,7 +515,7 @@ function O(n, r, a, o) {
|
|
|
512
515
|
let e = Math.round(V / B);
|
|
513
516
|
for (let t = 0; t <= e; t++) {
|
|
514
517
|
let e = t * B, a = U(e);
|
|
515
|
-
n.strokeStyle = t === 0 ? "#aaa" : "#e0e0e0", n.lineWidth = t === 0 ? 1 : .5, n.beginPath(), n.moveTo(F, a), n.lineTo(F + L, a), n.stroke(), n.fillStyle = "#555", n.textAlign = "right", n.fillText(i(e, r.valAxisFormatCode), F - 4, a);
|
|
518
|
+
n.strokeStyle = t === 0 ? "#aaa" : "#e0e0e0", n.lineWidth = t === 0 ? 1 : .5, n.beginPath(), n.moveTo(F, a), n.lineTo(F + L, a), n.stroke(), n.fillStyle = r.valAxisFontColor ? `#${r.valAxisFontColor}` : "#555", n.textAlign = "right", n.fillText(i(e, r.valAxisFormatCode), F - 4, a);
|
|
516
519
|
}
|
|
517
520
|
}
|
|
518
521
|
!r.catAxisHidden && !r.catAxisLineHidden && (n.strokeStyle = "#aaa", n.lineWidth = 1, n.beginPath(), n.moveTo(F, I + R), n.lineTo(F + L, I + R), n.stroke());
|
|
@@ -535,7 +538,7 @@ function O(n, r, a, o) {
|
|
|
535
538
|
}
|
|
536
539
|
if (!r.catAxisHidden) {
|
|
537
540
|
let e = Math.max(1, Math.ceil(h / 8));
|
|
538
|
-
n.fillStyle = "#555", n.textAlign = "center", n.textBaseline = "top", n.font = `${Math.max(8, Math.min(11, L / h * .8))}px sans-serif`;
|
|
541
|
+
n.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#555", n.textAlign = "center", n.textBaseline = "top", n.font = `${Math.max(8, Math.min(11, L / h * .8))}px sans-serif`;
|
|
539
542
|
for (let t = 0; t < h; t += e) n.fillText((f[t] ?? "").toString().slice(0, 10), H(t), I + R + 3);
|
|
540
543
|
}
|
|
541
544
|
y(n, r, E, s, c, l, u, F, I, L, R, T + 2), r.catAxisTitle && m(n, r.catAxisTitle, F, I, L, R, "cat", j), r.valAxisTitle && m(n, r.valAxisTitle, F, I, L, R, "val", j);
|
|
@@ -716,7 +719,7 @@ function j(t, n, r, a) {
|
|
|
716
719
|
b(t, n.catAxisMajorTickMark, "cat", q, o, s, c);
|
|
717
720
|
}
|
|
718
721
|
}
|
|
719
|
-
let J = n.chartType === "bubble", Y = J ? "marker" : n.scatterStyle ?? "marker", X = Y === "line" || Y === "lineMarker" || Y === "lineNoMarker", Z = Y === "smooth" || Y === "smoothMarker" || Y === "smoothNoMarker",
|
|
722
|
+
let J = n.chartType === "bubble", Y = J ? "marker" : n.scatterStyle ?? "marker", X = Y === "line" || Y === "lineMarker" || Y === "lineNoMarker", Z = Y === "smooth" || Y === "smoothMarker" || Y === "smoothNoMarker", ee = Y === "lineNoMarker" || Y === "smoothNoMarker";
|
|
720
723
|
for (let e = 0; e < n.series.length; e++) {
|
|
721
724
|
let r = n.series[e], i = d(e, r), o = r.categories ?? [];
|
|
722
725
|
for (let e of r.errBars ?? []) N(t, r, e, o, B, G, K, i);
|
|
@@ -740,7 +743,7 @@ function j(t, n, r, a) {
|
|
|
740
743
|
t.stroke(), t.restore();
|
|
741
744
|
}
|
|
742
745
|
}
|
|
743
|
-
if (!(
|
|
746
|
+
if (!(ee || r.showMarker === !1 || typeof r.markerSymbol == "string" && r.markerSymbol === "none")) {
|
|
744
747
|
let e = 0;
|
|
745
748
|
if (J && r.bubbleSizes && r.bubbleSizes.length > 0) {
|
|
746
749
|
let t = Math.max(0, ...r.bubbleSizes.filter((e) => e != null));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -421,6 +421,18 @@ declare interface ChartElement {
|
|
|
421
421
|
catAxisFontSizeHpt: number | null;
|
|
422
422
|
/** `<c:valAx><c:txPr>` font size (hpt). null = proportional default. */
|
|
423
423
|
valAxisFontSizeHpt: number | null;
|
|
424
|
+
/** `<c:catAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
|
|
425
|
+
catAxisFontColor?: string | null;
|
|
426
|
+
/** `<c:valAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
|
|
427
|
+
valAxisFontColor?: string | null;
|
|
428
|
+
/** `<c:catAx><c:spPr><a:ln><a:solidFill>` axis-line color (hex without '#'). */
|
|
429
|
+
catAxisLineColor?: string | null;
|
|
430
|
+
/** `<c:catAx><c:spPr><a:ln w>` axis-line width in EMU. */
|
|
431
|
+
catAxisLineWidthEmu?: number | null;
|
|
432
|
+
/** `<c:valAx><c:spPr><a:ln><a:solidFill>` axis-line color (hex without '#'). */
|
|
433
|
+
valAxisLineColor?: string | null;
|
|
434
|
+
/** `<c:valAx><c:spPr><a:ln w>` axis-line width in EMU. */
|
|
435
|
+
valAxisLineWidthEmu?: number | null;
|
|
424
436
|
/** `<c:dLbls><c:txPr>` font size (hpt) for data-point value labels. */
|
|
425
437
|
dataLabelFontSizeHpt: number | null;
|
|
426
438
|
/** `<c:legend><c:legendPos val>` — "r" (default) | "l" | "t" | "b" | "tr". */
|
|
@@ -1986,6 +1998,10 @@ declare interface SheetMeta {
|
|
|
1986
1998
|
name: string;
|
|
1987
1999
|
sheetId: number;
|
|
1988
2000
|
rId: string;
|
|
2001
|
+
/** Sheet tab color (`<sheetPr><tabColor>`, ECMA-376 §18.3.1.93) resolved to
|
|
2002
|
+
* `#RRGGBB`. Surfaced at workbook-list time so tabs can be painted up front.
|
|
2003
|
+
* Absent when the sheet declares no tab color. */
|
|
2004
|
+
tabColor?: string | null;
|
|
1989
2005
|
}
|
|
1990
2006
|
|
|
1991
2007
|
declare interface SlicerAnchor {
|
|
@@ -2568,7 +2584,12 @@ declare class XlsxViewer {
|
|
|
2568
2584
|
private tabStrip;
|
|
2569
2585
|
private navPrev;
|
|
2570
2586
|
private navNext;
|
|
2587
|
+
private navGroup;
|
|
2571
2588
|
private tabs;
|
|
2589
|
+
/** Per-tab colors parallel to `tabs`, from `<sheetPr><tabColor>`. */
|
|
2590
|
+
private tabColors;
|
|
2591
|
+
private zoomSlider;
|
|
2592
|
+
private zoomLabel;
|
|
2572
2593
|
private currentSheet;
|
|
2573
2594
|
private currentWorksheet;
|
|
2574
2595
|
private opts;
|
|
@@ -2611,6 +2632,18 @@ declare class XlsxViewer {
|
|
|
2611
2632
|
private updateNavButtons;
|
|
2612
2633
|
private updateTabActive;
|
|
2613
2634
|
private tabStyle;
|
|
2635
|
+
/** Excel-style zoom control pinned to the right end of the tab bar:
|
|
2636
|
+
* `− [────slider────] + 100%`. Live-updates the cell scale on input. */
|
|
2637
|
+
private buildZoomControl;
|
|
2638
|
+
/** Map a slider position [0,100] to a scale factor. 50 → 1.0 (100%), with a
|
|
2639
|
+
* separate linear segment on each side so the center is always 100%. */
|
|
2640
|
+
private zoomPosToScale;
|
|
2641
|
+
/** Inverse of {@link zoomPosToScale}: scale factor → slider position [0,100]. */
|
|
2642
|
+
private zoomScaleToPos;
|
|
2643
|
+
/** Set the cell/header scale and re-lay-out the current sheet. Clamped to the
|
|
2644
|
+
* zoom bounds; keeps the slider thumb, percentage label and the row-header-
|
|
2645
|
+
* aligned tab-nav width in sync. */
|
|
2646
|
+
setScale(scale: number): void;
|
|
2614
2647
|
private updateSpacerSize;
|
|
2615
2648
|
private renderCurrentSheet;
|
|
2616
2649
|
private computeHeaderHighlight;
|
|
@@ -2621,6 +2654,14 @@ declare class XlsxViewer {
|
|
|
2621
2654
|
declare interface XlsxViewerOptions {
|
|
2622
2655
|
/** Scale factor for cell/header dimensions (default 1). 0.5 = half size. */
|
|
2623
2656
|
cellScale?: number;
|
|
2657
|
+
/** Show the Excel-style zoom slider at the right end of the sheet-tab bar.
|
|
2658
|
+
* Default `true`. Set `false` to hide it (e.g. when the host supplies its
|
|
2659
|
+
* own zoom control). */
|
|
2660
|
+
showZoomSlider?: boolean;
|
|
2661
|
+
/** Lower/upper bounds for the zoom slider as scale factors. Default 0.1–4
|
|
2662
|
+
* (10%–400%, matching Excel's zoom range). */
|
|
2663
|
+
zoomMin?: number;
|
|
2664
|
+
zoomMax?: number;
|
|
2624
2665
|
onReady?: (sheetNames: string[]) => void;
|
|
2625
2666
|
onSheetChange?: (index: number, name: string) => void;
|
|
2626
2667
|
onError?: (err: Error) => void;
|
|
@@ -2654,6 +2695,9 @@ declare class XlsxWorkbook {
|
|
|
2654
2695
|
load(source: string | ArrayBuffer, opts?: LoadOptions_3): Promise<void>;
|
|
2655
2696
|
get sheetNames(): string[];
|
|
2656
2697
|
get sheetCount(): number;
|
|
2698
|
+
/** Per-sheet tab colors (`#RRGGBB`) parallel to {@link sheetNames}.
|
|
2699
|
+
* `null` for sheets that declare no tab color. */
|
|
2700
|
+
get tabColors(): (string | null)[];
|
|
2657
2701
|
getWorksheet(sheetIndex: number): Promise<Worksheet>;
|
|
2658
2702
|
renderViewport(target: HTMLCanvasElement | OffscreenCanvas, sheetIndex: number, viewport: ViewportRange, opts?: RenderViewportOptions): Promise<void>;
|
|
2659
2703
|
destroy(): void;
|
package/dist/types/pptx.d.ts
CHANGED
|
@@ -116,6 +116,18 @@ declare interface ChartElement {
|
|
|
116
116
|
catAxisFontSizeHpt: number | null;
|
|
117
117
|
/** `<c:valAx><c:txPr>` font size (hpt). null = proportional default. */
|
|
118
118
|
valAxisFontSizeHpt: number | null;
|
|
119
|
+
/** `<c:catAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
|
|
120
|
+
catAxisFontColor?: string | null;
|
|
121
|
+
/** `<c:valAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
|
|
122
|
+
valAxisFontColor?: string | null;
|
|
123
|
+
/** `<c:catAx><c:spPr><a:ln><a:solidFill>` axis-line color (hex without '#'). */
|
|
124
|
+
catAxisLineColor?: string | null;
|
|
125
|
+
/** `<c:catAx><c:spPr><a:ln w>` axis-line width in EMU. */
|
|
126
|
+
catAxisLineWidthEmu?: number | null;
|
|
127
|
+
/** `<c:valAx><c:spPr><a:ln><a:solidFill>` axis-line color (hex without '#'). */
|
|
128
|
+
valAxisLineColor?: string | null;
|
|
129
|
+
/** `<c:valAx><c:spPr><a:ln w>` axis-line width in EMU. */
|
|
130
|
+
valAxisLineWidthEmu?: number | null;
|
|
119
131
|
/** `<c:dLbls><c:txPr>` font size (hpt) for data-point value labels. */
|
|
120
132
|
dataLabelFontSizeHpt: number | null;
|
|
121
133
|
/** `<c:legend><c:legendPos val>` — "r" (default) | "l" | "t" | "b" | "tr". */
|
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -703,6 +703,10 @@ export declare interface SheetMeta {
|
|
|
703
703
|
name: string;
|
|
704
704
|
sheetId: number;
|
|
705
705
|
rId: string;
|
|
706
|
+
/** Sheet tab color (`<sheetPr><tabColor>`, ECMA-376 §18.3.1.93) resolved to
|
|
707
|
+
* `#RRGGBB`. Surfaced at workbook-list time so tabs can be painted up front.
|
|
708
|
+
* Absent when the sheet declares no tab color. */
|
|
709
|
+
tabColor?: string | null;
|
|
706
710
|
}
|
|
707
711
|
|
|
708
712
|
declare interface SlicerAnchor {
|
|
@@ -952,7 +956,12 @@ export declare class XlsxViewer {
|
|
|
952
956
|
private tabStrip;
|
|
953
957
|
private navPrev;
|
|
954
958
|
private navNext;
|
|
959
|
+
private navGroup;
|
|
955
960
|
private tabs;
|
|
961
|
+
/** Per-tab colors parallel to `tabs`, from `<sheetPr><tabColor>`. */
|
|
962
|
+
private tabColors;
|
|
963
|
+
private zoomSlider;
|
|
964
|
+
private zoomLabel;
|
|
956
965
|
private currentSheet;
|
|
957
966
|
private currentWorksheet;
|
|
958
967
|
private opts;
|
|
@@ -995,6 +1004,18 @@ export declare class XlsxViewer {
|
|
|
995
1004
|
private updateNavButtons;
|
|
996
1005
|
private updateTabActive;
|
|
997
1006
|
private tabStyle;
|
|
1007
|
+
/** Excel-style zoom control pinned to the right end of the tab bar:
|
|
1008
|
+
* `− [────slider────] + 100%`. Live-updates the cell scale on input. */
|
|
1009
|
+
private buildZoomControl;
|
|
1010
|
+
/** Map a slider position [0,100] to a scale factor. 50 → 1.0 (100%), with a
|
|
1011
|
+
* separate linear segment on each side so the center is always 100%. */
|
|
1012
|
+
private zoomPosToScale;
|
|
1013
|
+
/** Inverse of {@link zoomPosToScale}: scale factor → slider position [0,100]. */
|
|
1014
|
+
private zoomScaleToPos;
|
|
1015
|
+
/** Set the cell/header scale and re-lay-out the current sheet. Clamped to the
|
|
1016
|
+
* zoom bounds; keeps the slider thumb, percentage label and the row-header-
|
|
1017
|
+
* aligned tab-nav width in sync. */
|
|
1018
|
+
setScale(scale: number): void;
|
|
998
1019
|
private updateSpacerSize;
|
|
999
1020
|
private renderCurrentSheet;
|
|
1000
1021
|
private computeHeaderHighlight;
|
|
@@ -1005,6 +1026,14 @@ export declare class XlsxViewer {
|
|
|
1005
1026
|
export declare interface XlsxViewerOptions {
|
|
1006
1027
|
/** Scale factor for cell/header dimensions (default 1). 0.5 = half size. */
|
|
1007
1028
|
cellScale?: number;
|
|
1029
|
+
/** Show the Excel-style zoom slider at the right end of the sheet-tab bar.
|
|
1030
|
+
* Default `true`. Set `false` to hide it (e.g. when the host supplies its
|
|
1031
|
+
* own zoom control). */
|
|
1032
|
+
showZoomSlider?: boolean;
|
|
1033
|
+
/** Lower/upper bounds for the zoom slider as scale factors. Default 0.1–4
|
|
1034
|
+
* (10%–400%, matching Excel's zoom range). */
|
|
1035
|
+
zoomMin?: number;
|
|
1036
|
+
zoomMax?: number;
|
|
1008
1037
|
onReady?: (sheetNames: string[]) => void;
|
|
1009
1038
|
onSheetChange?: (index: number, name: string) => void;
|
|
1010
1039
|
onError?: (err: Error) => void;
|
|
@@ -1038,6 +1067,9 @@ export declare class XlsxWorkbook {
|
|
|
1038
1067
|
load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<void>;
|
|
1039
1068
|
get sheetNames(): string[];
|
|
1040
1069
|
get sheetCount(): number;
|
|
1070
|
+
/** Per-sheet tab colors (`#RRGGBB`) parallel to {@link sheetNames}.
|
|
1071
|
+
* `null` for sheets that declare no tab color. */
|
|
1072
|
+
get tabColors(): (string | null)[];
|
|
1041
1073
|
getWorksheet(sheetIndex: number): Promise<Worksheet>;
|
|
1042
1074
|
renderViewport(target: HTMLCanvasElement | OffscreenCanvas, sheetIndex: number, viewport: ViewportRange, opts?: RenderViewportOptions): Promise<void>;
|
|
1043
1075
|
destroy(): void;
|