@silurus/ooxml 0.17.0 → 0.18.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 +6 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-CEHbFVsy.js → pptx-B9bdrXoy.js} +1 -1
- package/dist/{pptx-Cn6PQpHT.cjs → pptx-CUEsKfI-.cjs} +1 -1
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/{renderer-rSBto6l5.js → renderer-Ctkyp4ee.js} +386 -143
- package/dist/renderer-DfM3skLm.cjs +1 -0
- package/dist/types/index.d.ts +217 -0
- package/dist/types/pptx.d.ts +85 -0
- package/dist/types/xlsx.d.ts +132 -0
- package/dist/xlsx-C5mcZ9eL.cjs +10 -0
- package/dist/xlsx-DGP6jxn-.js +2689 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
- package/dist/renderer-DB-DghvA.cjs +0 -1
- package/dist/xlsx-B3-MeECM.js +0 -2546
- package/dist/xlsx-CWkWdRpm.cjs +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[`4472C4`,`ED7D31`,`A9D18E`,`FF0000`,`70AD47`,`4BACC6`,`FFC000`,`9E480E`,`843C0C`,`636363`,`255E91`,`967300`];function t(t,n){return n?.color?`#${n.color}`:`#${e[t%e.length]}`}function n(t,n){let r=n.dataPointColors?.[t];return r?`#${r}`:`#${e[t%e.length]}`}function r(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 i(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 a(e,t){if(e<=0)return t;let n=Math.ceil(e/t)*t;return Math.abs(n-e)<t*1e-9?n+t:n}function o(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 s(e){return Number.isInteger(e)?String(e):e.toFixed(6).replace(/\.?0+$/,``)}function c(e,t){if(!t)return s(e);if(l(t))return u(e,t);let n=d(t),r;return r=e>0?n[0]??t:e<0?n[1]??n[0]??t:n[2]??n[0]??t,r===``?``:(e<0&&n.length<2?`-`:``)+f(Math.abs(e),r)}function l(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 u(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 d(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 f(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=p(o,s),l=!1;return n.map(e=>e.kind===`lit`?e.text:l?``:(l=!0,c)).join(``)}function p(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`)}`}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,n,r,i,a,o,s=`vertical`){if(s===`horizontal`){let s=Math.max(9,Math.min(12,o*.7));e.font=`${s}px sans-serif`,e.textBaseline=`middle`;let c=n.map((e,t)=>e.name||`Series ${t+1}`),l=c.map(t=>14+e.measureText(t.slice(0,30)).width),u=r+(a-(l.reduce((e,t)=>e+t,0)+12*Math.max(0,n.length-1)))/2,d=i+o/2;for(let r=0;r<n.length;r++)e.fillStyle=t(r,n[r]),e.fillRect(u,d-s/2,10,s),e.fillStyle=`#333`,e.textAlign=`left`,e.fillText(c[r].slice(0,30),u+10+4,d),u+=l[r]+12;return}let c=Math.max(9,Math.min(12,o/(n.length+1)));e.font=`${c}px sans-serif`,e.textBaseline=`middle`;let l=c+4,u=i+(o-l*n.length)/2;for(let i=0;i<n.length;i++){e.fillStyle=t(i,n[i]),e.fillRect(r,u,10,c),e.fillStyle=`#333`,e.textAlign=`left`;let a=n[i].name||`Series ${i+1}`;e.fillText(a.slice(0,20),r+10+4,u+c/2),u+=l}}function g(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 _(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`;h(e,t.series,n,s,c,l,u);return}switch(n.side){case`r`:h(e,t.series,r+a-n.reserveW+4,c,n.reserveW-8,u);break;case`l`:h(e,t.series,r+4,c,n.reserveW-8,u);break;case`t`:h(e,t.series,s,i+d,l,n.reserveH,`horizontal`);break;case`b`:h(e,t.series,s,i+o-n.reserveH,l,n.reserveH,`horizontal`);break}}function v(e,t,n,r,i){if(t===`none`||!t)return;let a=e.strokeStyle;if(e.strokeStyle=`#888`,e.lineWidth=1,e.beginPath(),n===`val`){let n=r,a=i,o=t===`out`||t===`cross`?-4:0,s=t===`in`||t===`cross`?4:0;e.moveTo(n+o,a),e.lineTo(n+s,a)}else{let n=r,a=i,o=t===`out`||t===`cross`?4:0,s=t===`in`||t===`cross`?-4:0;e.moveTo(a,n+o),e.lineTo(a,n+s)}e.stroke(),e.strokeStyle=a}function y(e,t,n){return e.titleFontSizeHpt?e.titleFontSizeHpt/100*n:Math.max(10,t*.085)}function b(e,t,n){return e?e/100*n:Math.max(8,t*.045)}function x(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 S(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 C(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 w(e,n,r,o){let{x:s,y:l,w:u,h:d}=r,f=n.chartType===`clusteredBarH`||n.chartType===`stackedBarH`||n.chartType===`stackedBarHPct`,p=n.chartType.startsWith(`stacked`),h=n.chartType===`stackedBarPct`||n.chartType===`stackedBarHPct`,v=n.series.filter(e=>e.seriesType!==`line`),b=n.series.filter(e=>e.seriesType===`line`),w=S(n),T=w.length;if(T===0)return;let E=n.title?y(n,d,o):0,D=n.title?d*.02:0,O=n.title?d*.025:0,k=n.title?E+D+O:0,A=g(n,u,d),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,d*.045)),I=n.catAxisTitle?F+4:0,L=n.valAxisTitle?F+4:0,R={t:k+N+d*.02,r:j+u*.03,b:d*.14+I+P,l:u*.12+L+M};f&&(R.l=(n.catAxisHidden?u*.03:u*.22)+L+M,R.b=(n.valAxisHidden?d*.02:d*.08)+I+P),x(e,n,s,l+D,u,E);let z=s+R.l,B=l+R.t,V=u-R.l-R.r,H=d-R.t-R.b;if(V<=0||H<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(z,B,V,H));let U=0;for(let e=0;e<T;e++){let t=0;for(let n of v){let r=n.values[e]??0;p?t+=Math.abs(r):U=Math.max(U,Math.abs(r))}p&&(U=Math.max(U,t))}h&&(U=100),n.valMax!=null&&(U=n.valMax),U===0&&(U=1);let W=i(U),G=n.valMax??a(U,W),K=`#e0e0e0`,q=Math.round(G/W);if(e.textBaseline=`middle`,e.font=`${Math.max(8,Math.min(11,H/20))}px sans-serif`,e.fillStyle=`#555`,!n.valAxisHidden)for(let t=0;t<=q;t++){let r=t*W,i=h?`${Math.round(r)}%`:c(r,n.valAxisFormatCode);if(f){let n=z+r/G*V;e.strokeStyle=t===0?`#aaa`:K,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(n,B),e.lineTo(n,B+H),e.stroke(),e.textAlign=`center`,e.fillText(i,n,B+H+10)}else{let n=B+H-r/G*H;e.strokeStyle=t===0?`#aaa`:K,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(z,n),e.lineTo(z+V,n),e.stroke(),e.textAlign=`right`,e.fillText(i,z-4,n)}}e.strokeStyle=`#aaa`,e.lineWidth=1,f?(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke()):(e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke());let J=f?H/T:V/T,Y=p?1:Math.max(1,v.length),X=p?0:n.barOverlap??0,ee=n.barGapWidth??150,Z=J/(1+(Y-1)*(1-X/100)+ee/100),Q=p?0:Z*(1-X/100),$=(J-(Z+(Y-1)*Q))/2;for(let r=0;r<T;r++){let i=0,a=0;if(h){for(let e of v)a+=Math.abs(e.values[r]??0);a===0&&(a=1)}for(let o=0;o<v.length;o++){let s=v[o],l=s.values[r]??0,u=h?Math.abs(l)/a*100:Math.abs(l),d=t(o,s);if(f){let t=p?o:v.length-1-o,a=p?B+(T-1-r)*J+$:B+(T-1-r)*J+$+t*Q,l=u/G*V,f=p?z+i/G*V:z;e.fillStyle=d,e.fillRect(f,a,l,Z),n.showDataLabels&&u>0&&(e.font=`bold ${Math.max(7,Math.min(11,Z*.6))}px sans-serif`,C(e,h?`${Math.round(u)}%`:c(u,n.dataLabelFormatCode??s.valFormatCode??null),f,a,l,Z,`horizontal`,n.dataLabelPosition??null,n.dataLabelFontColor??null))}else{let t=p?z+r*J+$:z+r*J+$+o*Q,a=u/G*H,l=B+H-(p?i+u:u)/G*H;e.fillStyle=d,e.fillRect(t,l,Z,a),n.showDataLabels&&u>0&&(e.font=`bold ${Math.max(7,Math.min(11,Z*.6))}px sans-serif`,C(e,h?`${Math.round(u)}%`:c(u,n.dataLabelFormatCode??s.valFormatCode??null),t,l,Z,a,`vertical`,n.dataLabelPosition??null,n.dataLabelFontColor??null))}p&&(i+=u)}}if(!n.catAxisHidden){e.fillStyle=`#555`,e.font=`${Math.max(8,Math.min(11,J*.5))}px sans-serif`;for(let t=0;t<T;t++){let n=(w[t]??``).toString().slice(0,12);if(f){let r=B+(T-1-t)*J+J/2;e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(n,z-4,r)}else{let r=z+t*J+J/2;e.textAlign=`center`,e.textBaseline=`top`,e.fillText(n,r,B+H+3)}}}if(b.length>0&&!f)for(let n=0;n<b.length;n++){let r=b[n],i=t(v.length+n,r);e.strokeStyle=i,e.lineWidth=2,e.setLineDash([]),e.beginPath();let a=!1;for(let t=0;t<T;t++){let n=r.values[t];if(n==null){a=!1;continue}let i=z+t*J+J/2,o=B+H-n/G*H;a?e.lineTo(i,o):(e.moveTo(i,o),a=!0)}if(e.stroke(),r.showMarker!==!1)for(let t=0;t<T;t++){let n=r.values[t];if(n==null)continue;let a=z+t*J+J/2,o=B+H-n/G*H;e.fillStyle=i,e.beginPath(),e.arc(a,o,3,0,Math.PI*2),e.fill()}}_(e,f&&!p?{...n,series:[...n.series].reverse()}:n,A,s,l,u,d,z,B,V,H,k+2),n.catAxisTitle&&m(e,n.catAxisTitle,z,B,V,H,`cat`,F),n.valAxisTitle&&m(e,n.valAxisTitle,z,B,V,H,`val`,F)}function T(e,n,r,l){let{x:u,y:d,w:f,h:p}=r,h=S(n),C=h.length;if(C===0)return;let w=n.title?y(n,p,l):0,T=n.title?p*.045:0,E=n.title?p*.035:0,D=n.title?w+T+E:0,O=g(n,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=b(n.catAxisFontSizeHpt,p,l),P=b(n.valAxisFontSizeHpt,p,l),F=Math.max(N,P),I=n.catAxisTitle?F+4:0,L=n.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};x(e,n,u,d+T,f,w);let z=u+R.l,B=d+R.t,V=f-R.l-R.r,H=p-R.t-R.b;if(V<=0||H<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(z,B,V,H));let U=1/0,W=-1/0;for(let e of n.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),n.valMin==null?U>0&&(U=0):U=n.valMin,n.valMax==null?W<0&&(W=0):W=n.valMax,W===U&&(W=U+1);let G=i(W-U),K=n.valMin??o(U,G),q=n.valMax??a(W,G),J=q-K;if(J===0)return;let Y=e=>B+H-(e-K)/J*H,X=n.catAxisCrossBetween===`midCat`?e=>z+(C===1?V/2:e/(C-1)*V):e=>z+(e+.5)/C*V;if(!n.valAxisHidden){let t=Math.round((q-K)/G);e.font=`${P}px sans-serif`,e.textBaseline=`middle`;for(let r=0;r<=t;r++){let t=K+r*G,i=Y(t);e.strokeStyle=t===0?`#aaa`:`#e0e0e0`,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(z,i),e.lineTo(z+V,i),e.stroke(),v(e,n.valAxisMajorTickMark,`val`,z,i),e.fillStyle=`#555`,e.textAlign=`right`,e.fillText(c(t,n.valAxisFormatCode),z-6,i)}}e.strokeStyle=`#aaa`,e.lineWidth=1,e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke(),n.valAxisHidden||(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke());let ee=Math.max(1,2.25*l),Z=Math.max(2,2.5*l),Q=b(n.dataLabelFontSizeHpt,p,l);for(let r=0;r<n.series.length;r++){let i=n.series[r],a=t(r,i);e.strokeStyle=a,e.lineWidth=ee,e.setLineDash([]),e.beginPath();let o=!1;for(let t=0;t<C;t++){let n=i.values[t];if(n==null){o=!1;continue}let r=X(t),a=Y(n);o?e.lineTo(r,a):(e.moveTo(r,a),o=!0)}e.stroke(),e.fillStyle=a;let c=i.showMarker!==!1;for(let t=0;t<C;t++){let r=i.values[t];if(r!=null&&(c&&(e.beginPath(),e.arc(X(t),Y(r),Z,0,Math.PI*2),e.fill()),n.showDataLabels)){e.font=`${Q}px sans-serif`,e.fillStyle=`#333`,e.textAlign=`center`,e.textBaseline=`bottom`;let n=c?Z+1:2;e.fillText(s(r),X(t),Y(r)-n),e.fillStyle=a}}}if(!n.catAxisHidden){let t=Math.max(1,Math.ceil(C/8));e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${N}px sans-serif`;for(let r=0;r<C;r+=t){let t=X(r);v(e,n.catAxisMajorTickMark,`cat`,B+H,t),e.fillStyle=`#555`,e.fillText((h[r]??``).toString().slice(0,10),t,B+H+5)}}_(e,n,O,u,d,f,p,z,B,V,H,D+2),n.catAxisTitle&&m(e,n.catAxisTitle,z,B,V,H,`cat`,F),n.valAxisTitle&&m(e,n.valAxisTitle,z,B,V,H,`val`,F)}function E(e,n,o,s){let{x:l,y:u,w:d,h:f}=o,p=S(n),h=p.length;if(h===0)return;let v=n.chartType===`stackedArea`||n.chartType===`stackedAreaPct`,b=n.title?y(n,f,s):0,C=n.title?f*.035:0,w=n.title?f*.035:0,T=n.title?b+C+w:0,E=g(n,d,f),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,f*.045)),M=n.catAxisTitle?j+4:0,N=n.valAxisTitle?j+4:0,P={t:T+k+f*.02,r:D+d*.05,b:f*.14+M+A,l:d*.12+N+O};x(e,n,l,u+C,d,b);let F=l+P.l,I=u+P.t,L=d-P.l-P.r,R=f-P.t-P.b;if(L<=0||R<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(F,I,L,R));let z=0;for(let e=0;e<h;e++)if(v){let t=0;for(let r of n.series)t+=r.values[e]??0;z=Math.max(z,t)}else for(let t of n.series)z=Math.max(z,t.values[e]??0);n.valMax!=null&&(z=n.valMax),z===0&&(z=1);let B=i(z),V=n.valMax??a(z,B),H=e=>F+(h===1?L/2:e/(h-1)*L),U=e=>I+R-e/V*R;if(!n.valAxisHidden){e.font=`${Math.max(8,Math.min(11,R/20))}px sans-serif`,e.textBaseline=`middle`;let t=Math.round(V/B);for(let r=0;r<=t;r++){let t=r*B,i=U(t);e.strokeStyle=r===0?`#aaa`:`#e0e0e0`,e.lineWidth=r===0?1:.5,e.beginPath(),e.moveTo(F,i),e.lineTo(F+L,i),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.fillText(c(t,n.valAxisFormatCode),F-4,i)}}e.strokeStyle=`#aaa`,e.lineWidth=1,e.beginPath(),e.moveTo(F,I+R),e.lineTo(F+L,I+R),e.stroke();let W=v?Array(h).fill(0):null;for(let i=n.series.length-1;i>=0;i--){let a=n.series[i],o=t(i,a),s=I+R;if(e.beginPath(),v&&W){for(let t=0;t<h;t++){let n=(a.values[t]??0)+W[t],r=H(t),i=U(n);t===0?e.moveTo(r,i):e.lineTo(r,i)}for(let t=h-1;t>=0;t--)e.lineTo(H(t),U(W[t]));for(let e=0;e<h;e++)W[e]+=a.values[e]??0}else{e.moveTo(H(0),s);for(let t=0;t<h;t++)e.lineTo(H(t),U(a.values[t]??0));e.lineTo(H(h-1),s)}e.closePath(),e.fillStyle=r(o,.6),e.fill(),e.strokeStyle=o,e.lineWidth=1.5,e.setLineDash([]),e.stroke()}if(!n.catAxisHidden){let t=Math.max(1,Math.ceil(h/8));e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${Math.max(8,Math.min(11,L/h*.8))}px sans-serif`;for(let n=0;n<h;n+=t)e.fillText((p[n]??``).toString().slice(0,10),H(n),I+R+3)}_(e,n,E,l,u,d,f,F,I,L,R,T+2),n.catAxisTitle&&m(e,n.catAxisTitle,F,I,L,R,`cat`,j),n.valAxisTitle&&m(e,n.valAxisTitle,F,I,L,R,`val`,j)}function D(t,r,i,a,o){let{x:s,y:c,w:l,h:u}=i,d=r.series[0];if(!d)return;let f=d.categories&&d.categories.length>0?d.categories:r.categories,p=d.values.map(e=>Math.abs(e??0)),m=p.reduce((e,t)=>e+t,0);if(m===0)return;let h=r.title?y(r,u,o):0,g=r.title?u*.035:0,v=r.title?u*.035:0,b=r.title?h+g+v:0;x(t,r,s,c+g,l,h);let S=r.showLegend?(()=>{let e=r.legendPos??`r`,t=e===`l`?`l`:e===`t`?`t`:e===`b`?`b`:`r`;return t===`r`||t===`l`?{side:t,reserveW:Math.max(80,l*.28),reserveH:0}:{side:t,reserveW:0,reserveH:Math.max(18,u*.08)}})():null,C=S?.side===`r`?S.reserveW:0,w=S?.side===`l`?S.reserveW:0,T=S?.side===`t`?S.reserveH:0,E=S?.side===`b`?S.reserveH:0,D=l-C-w,O=u-b-T-E-u*.02,k=s+w+D/2,A=c+b+T+u*.02+O/2,j=Math.min(D,O)*.42,M=a?j*.5:0,N=-Math.PI/2;for(let e=0;e<p.length;e++){let i=p[e]/m*Math.PI*2,o=n(e,d);if(t.beginPath(),t.moveTo(k,A),t.arc(k,A,j,N,N+i),t.closePath(),t.fillStyle=o,t.fill(),t.strokeStyle=`#fff`,t.lineWidth=1,t.stroke(),r.showDataLabels&&i>.15){let n=N+i/2,r=j*(a?.75:.6),o=k+Math.cos(n)*r,s=A+Math.sin(n)*r,c=Math.round(p[e]/m*100);t.font=`bold ${Math.max(8,j*.1)}px sans-serif`,t.fillStyle=`#fff`,t.textAlign=`center`,t.textBaseline=`middle`,t.fillText(`${c}%`,o,s)}N+=i}if(a&&(t.beginPath(),t.arc(k,A,M,0,Math.PI*2),t.fillStyle=`#fff`,t.fill()),S){let n=p.map((t,n)=>({name:(f[n]??`Item ${n+1}`).toString(),color:d.dataPointColors?.[n]??d.color??e[n%e.length],values:[]})),i=k-D/2;_(t,{...r,series:n},S,s,c,l,u,i,A-O/2,D,O,b+2)}}function O(e,n,o,c){let{x:l,y:u,w:d,h:f}=o,p=S(n),m=p.length;if(m<3)return;let h=n.title?y(n,f,c):0,v=n.title?f*.035:0,C=n.title?f*.035:0,w=n.title?h+v+C:0,T=g(n,d,f),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;x(e,n,l,u+v,d,h);let A=d-E-D,j=f-w-O-k-f*.02,M=l+D+A/2,N=u+w+O+f*.02+j/2,P=Math.min(A,j)*.38,F=0;for(let e of n.series)for(let t of e.values)F=Math.max(F,t??0);n.valMax!=null&&(F=n.valMax),F===0&&(F=1);let I=i(F),L=n.valMax??a(F,I),R=-Math.PI/2,z=e=>R+e/m*Math.PI*2,B=Math.round(L/I);e.strokeStyle=`#ddd`,e.lineWidth=.5;for(let t=1;t<=B;t++){let n=t/B*P;e.beginPath();for(let t=0;t<m;t++){let r=z(t),i=M+Math.cos(r)*n,a=N+Math.sin(r)*n;t===0?e.moveTo(i,a):e.lineTo(i,a)}e.closePath(),e.stroke()}e.strokeStyle=`#bbb`,e.lineWidth=.5;for(let t=0;t<m;t++){let n=z(t);e.beginPath(),e.moveTo(M,N),e.lineTo(M+Math.cos(n)*P,N+Math.sin(n)*P),e.stroke()}if(!n.valAxisHidden){e.font=`${b(n.valAxisFontSizeHpt,f,c)}px sans-serif`,e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=1;t<=B;t++){let n=t/B*L,r=t/B*P;e.fillText(s(n),M-3,N-r)}}e.font=`${Math.max(8,Math.min(11,P*.2))}px sans-serif`,e.fillStyle=`#444`,e.textBaseline=`middle`;for(let t=0;t<m;t++){let n=z(t),r=M+Math.cos(n)*(P+12),i=N+Math.sin(n)*(P+12);e.textAlign=Math.cos(n)<-.1?`right`:Math.cos(n)>.1?`left`:`center`,e.fillText((p[t]??``).toString().slice(0,12),r,i)}for(let i=0;i<n.series.length;i++){let a=n.series[i],o=t(i,a);e.beginPath();for(let t=0;t<m;t++){let n=(a.values[t]??0)/L,r=z(t),i=M+Math.cos(r)*P*n,o=N+Math.sin(r)*P*n;t===0?e.moveTo(i,o):e.lineTo(i,o)}e.closePath(),e.fillStyle=r(o,.25),e.fill(),e.strokeStyle=o,e.lineWidth=2,e.stroke()}_(e,n,T,l,u,d,f,M-A/2,N-j/2,A,j,w+2)}function k(e,n,r,a){let{x:o,y:s,w:l,h:u}=r,d=n.title?y(n,u,a):0,f=n.title?u*.035:0,p=n.title?u*.035:0,h=n.title?d+f+p:0,v=g(n,l,u),b=v?.side===`r`?v.reserveW:0,S=v?.side===`l`?v.reserveW:0,C=v?.side===`t`?v.reserveH:0,w=v?.side===`b`?v.reserveH:0,T=Math.max(8,Math.min(10,u*.045)),E=n.catAxisTitle?T+4:0,D=n.valAxisTitle?T+4:0;if(n.title){let t=n.titleManualLayout;t&&(t.x!==void 0||t.y!==void 0)?x(e,n,o+t.x*l,s+t.y*u,(t.w??.5)*l,d):x(e,n,o,s+f,l,d)}let O=n.plotAreaManualLayout,k,N,P,F;if(O&&O.w!=null&&O.h!=null)k=o+O.x*l,N=s+O.y*u,P=O.w*l,F=O.h*u;else{let e={t:h+C+u*.02,r:b+l*.05,b:(n.catAxisHidden?u*.04:u*.12)+E+w,l:(n.valAxisHidden?l*.04:l*.12)+D+S};k=o+e.l,N=s+e.t,P=l-e.l-e.r,F=u-e.t-e.b}if(P<=0||F<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(k,N,P,F));let I=[],L=[];for(let e of n.series){let t=e.categories??[];for(let e of t){let t=parseFloat(e);isNaN(t)||I.push(t)}for(let t of e.values)t!=null&&L.push(t)}let R=I.length===0;if(R){let e=Math.max(...n.series.map(e=>e.values.length));for(let t=0;t<e;t++)I.push(t)}let z=Math.min(...I),B=Math.max(...I),V=Math.min(...L),H=Math.max(...L);z===B&&(--z,B+=1),V===H&&(--V,H+=1),n.valMin==null?V>0&&(V=0):V=n.valMin,n.valMax!=null&&(H=n.valMax),n.catAxisMin!=null&&(z=n.catAxisMin),n.catAxisMax!=null&&(B=n.catAxisMax);let U=e=>k+(e-z)/(B-z)*P,W=e=>N+F-(e-V)/(H-V)*F;if(!n.valAxisHidden){e.font=`${Math.max(8,Math.min(11,F/20))}px sans-serif`;let t=i(H-V),r=Math.round((H-V)/t)+1;for(let i=0;i<r;i++){let r=V+i*t;if(r>H+t*.01)break;let a=W(r);e.strokeStyle=`#e0e0e0`,e.lineWidth=.5,e.beginPath(),e.moveTo(k,a),e.lineTo(k+P,a),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(c(r,n.valAxisFormatCode),k-4,a)}}if(e.strokeStyle=`#888`,e.lineWidth=1,e.beginPath(),e.moveTo(k,N+F),e.lineTo(k+P,N+F),e.stroke(),n.valAxisHidden||(e.beginPath(),e.moveTo(k,N),e.lineTo(k,N+F),e.stroke()),!n.catAxisHidden){e.font=`${Math.max(8,Math.min(11,F/20))}px sans-serif`;let t=i(B-z),r=Math.round((B-z)/t)+1;e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`;for(let i=0;i<r;i++){let r=z+i*t;if(r>B+t*.01)break;let a=U(r);e.fillText(c(r,n.catAxisFormatCode),a,N+F+4)}}for(let r=0;r<n.series.length;r++){let i=n.series[r],o=t(r,i),s=i.categories??[];for(let t of i.errBars??[])j(e,i,t,s,R,U,W,o);if(!(i.showMarker===!1||typeof i.markerSymbol==`string`&&i.markerSymbol===`none`))for(let t=0;t<i.values.length;t++){let n=i.values[t];if(n==null)continue;let r=R?t:parseFloat(s[t]??`0`);if(isNaN(r))continue;let c=(i.dataPointOverrides??[]).find(e=>e.idx===t),l=c?.markerSymbol??i.markerSymbol??`circle`,u=c?.markerSize??i.markerSize??5,d=c?.markerFill??c?.color??i.markerFill??o,f=c?.markerLine??i.markerLine??null;A(e,U(r),W(n),l,u,d,f,a)}M(e,i,s,R,U,W,F,a)}_(e,n,v,o,s,l,u,k,N,P,F,h+2),n.catAxisTitle&&m(e,n.catAxisTitle,k,N,P,F,`cat`,T),n.valAxisTitle&&m(e,n.valAxisTitle,k,N,P,F,`val`,T)}function A(e,t,n,r,i,a,o,s){let c=Math.max(2,i*s),l=c/2;switch(e.save(),e.fillStyle=`#${a}`,o&&(e.strokeStyle=`#${o}`,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=`#${a}`,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=`#${a}`,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 j(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(P(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 M(e,t,n,r,i,a,o,s){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(c(f,u.formatCode??null)),h=e.filter(Boolean).join(` `),!h)continue}else continue;let g=m?.position??u?.position??`r`,_=m?.fontSizeHpt?m.fontSizeHpt/100*s:Math.max(9,Math.min(11,o/25)),v=m?.fontColor??u?.fontColor;N(e,i(p),a(f),h,g,_,v)}}function N(e,t,n,r,i,a,o){e.save(),e.font=`${a}px sans-serif`,e.fillStyle=o?`#${o}`:`#333`;let s=a*.6,c=t,l=n;switch(i){case`l`:e.textAlign=`right`,e.textBaseline=`middle`,c=t-s;break;case`r`:e.textAlign=`left`,e.textBaseline=`middle`,c=t+s;break;case`t`:e.textAlign=`center`,e.textBaseline=`bottom`,l=n-s;break;case`b`:e.textAlign=`center`,e.textBaseline=`top`,l=n+s;break;case`ctr`:e.textAlign=`center`,e.textBaseline=`middle`;break;default:e.textAlign=`left`,e.textBaseline=`middle`,c=t+s;break}let u=r.split(/\r?\n/),d=a*1.15,f=d*u.length,p=l;e.textBaseline===`middle`?p=l-(f-d)/2:e.textBaseline===`bottom`&&(p=l-(f-d));for(let t of u)e.fillText(t,c,p),p+=d;e.restore()}function P(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 F(e,t,n){let{x:r,y:a,w:o,h:s}=n,c=o*.11,l=o*.04,u=s*.08,d=s*.18,f=r+c,p=a+u,m=o-c-l,h=s-u-d,g=t.series[0]?.values??[],_=t.categories,v=_.length;if(v===0)return;let y=new Set(t.subtotalIndices),b=0,x=[];for(let e=0;e<v;e++){let t=g[e]??0;if(e===0||y.has(e))x.push({start:0,end:t,isSub:!0,isPos:!0}),b=t;else{let e=t>=0?b:b+t,n=t>=0?b+t:b;x.push({start:e,end:n,isSub:!1,isPos:t>=0}),b+=t}}let S=x.map(e=>e.end),C=x.map(e=>e.start),w=Math.max(...S,...C),T=Math.min(...C,0),E=w-T;if(E<=0)return;let D=E*1.1,O=T-E*.05,k=O+D,A=i(D);e.save();let j=Math.round(s*.042);e.font=`${j}px sans-serif`,e.strokeStyle=`#e8e8e8`,e.lineWidth=.7,e.fillStyle=`#666`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=Math.ceil(O/A)*A;t<=k;t+=A){let n=p+h*(1-(t-O)/D);e.beginPath(),e.moveTo(f,n),e.lineTo(f+m,n),e.stroke(),e.fillText(t.toLocaleString(),f-4,n)}e.strokeStyle=`#bbb`,e.lineWidth=1,e.beginPath(),e.moveTo(f,p),e.lineTo(f,p+h),e.lineTo(f+m,p+h),e.stroke();let M=m/v*.55,N=m/v;x.forEach((t,n)=>{let r=f+N*n+(N-M)/2,i=p+h*(1-(t.end-O)/D),a=p+h*(1-(t.start-O)/D),o=Math.max(1,a-i);if(t.isSub?(e.fillStyle=`#196ECA`,e.fillRect(r,i,M,o)):(e.strokeStyle=t.isPos?`#5BA4E6`:`#E46970`,e.lineWidth=1.5,e.strokeRect(r+.75,i+.75,M-1.5,o-1.5)),n<v-1){let o=f+N*(n+1)+(N-M)/2,s=t.isPos?i:a;e.strokeStyle=`#ccc`,e.lineWidth=.8,e.setLineDash([3,3]),e.beginPath(),e.moveTo(r+M,s),e.lineTo(o,s),e.stroke(),e.setLineDash([])}let c=g[n]??0,l=c<0?`△ ${Math.abs(c).toLocaleString()}`:c.toLocaleString();e.fillStyle=`#595959`,e.font=`bold ${Math.round(s*.044)}px sans-serif`,e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(l,r+M/2,i-3)}),e.textAlign=`center`,e.textBaseline=`top`,e.fillStyle=`#666`,e.font=`${Math.round(s*.038)}px sans-serif`;let P=p+h+4;for(let t=0;t<v;t++){let n=f+N*t+N/2;_[t].split(/\s+/).forEach((t,r)=>e.fillText(t,n,P+r*(j+2)))}e.restore()}function I(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`:w(e,t,n,r);break;case`line`:case`stackedLine`:case`stackedLinePct`:T(e,t,n,r);break;case`area`:case`stackedArea`:case`stackedAreaPct`:E(e,t,n,r);break;case`pie`:D(e,t,n,!1,r);break;case`doughnut`:D(e,t,n,!0,r);break;case`radar`:O(e,t,n,r);break;case`scatter`:case`bubble`:k(e,t,n,r);break;case`waterfall`:F(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 I}});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -293,6 +293,39 @@ declare interface ChartData {
|
|
|
293
293
|
/** `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
|
|
294
294
|
* number format (§21.2.2.35). */
|
|
295
295
|
dataLabelFormatCode?: string | null;
|
|
296
|
+
/** `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). */
|
|
297
|
+
catAxisFormatCode?: string;
|
|
298
|
+
/** `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. */
|
|
299
|
+
catAxisMin?: number;
|
|
300
|
+
catAxisMax?: number;
|
|
301
|
+
/** `<c:valAx><c:scaling><c:min/max>` — explicit Y-axis range. */
|
|
302
|
+
valAxisMin?: number;
|
|
303
|
+
valAxisMax?: number;
|
|
304
|
+
/** `<c:title><c:layout><c:manualLayout>` (§21.2.2.27) absolute placement. */
|
|
305
|
+
titleManualLayout?: ManualLayout;
|
|
306
|
+
/** `<c:plotArea><c:layout><c:manualLayout>` — `layoutTarget=inner` /
|
|
307
|
+
* `outer` controls whether axes are inside the rect or outside. */
|
|
308
|
+
plotAreaManualLayout?: ManualLayout;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare interface ChartDataLabelOverride {
|
|
312
|
+
idx: number;
|
|
313
|
+
/** Empty string = label deleted (skip drawing). */
|
|
314
|
+
text: string;
|
|
315
|
+
/** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit". undefined = inherit. */
|
|
316
|
+
position?: string;
|
|
317
|
+
fontColor?: string;
|
|
318
|
+
fontSizeHpt?: number;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare interface ChartDataPointOverride {
|
|
322
|
+
idx: number;
|
|
323
|
+
/** Resolved fill hex (no `#`). */
|
|
324
|
+
color?: string;
|
|
325
|
+
markerSymbol?: string;
|
|
326
|
+
markerSize?: number;
|
|
327
|
+
markerFill?: string;
|
|
328
|
+
markerLine?: string;
|
|
296
329
|
}
|
|
297
330
|
|
|
298
331
|
/**
|
|
@@ -341,6 +374,21 @@ declare interface ChartElement {
|
|
|
341
374
|
dataLabelFontSizeHpt: number | null;
|
|
342
375
|
}
|
|
343
376
|
|
|
377
|
+
declare interface ChartErrBars {
|
|
378
|
+
/** "x" | "y". */
|
|
379
|
+
dir: string;
|
|
380
|
+
/** "plus" | "minus" | "both". */
|
|
381
|
+
barType: string;
|
|
382
|
+
plus: (number | null)[];
|
|
383
|
+
minus: (number | null)[];
|
|
384
|
+
noEndCap: boolean;
|
|
385
|
+
/** Resolved hex (no `#`). */
|
|
386
|
+
color?: string;
|
|
387
|
+
lineWidthEmu?: number;
|
|
388
|
+
/** "solid"|"dash"|"dot"|"dashDot"|... */
|
|
389
|
+
dash?: string;
|
|
390
|
+
}
|
|
391
|
+
|
|
344
392
|
declare interface ChartSeries {
|
|
345
393
|
name: string;
|
|
346
394
|
/** Hex without '#'. null = fall back to palette. */
|
|
@@ -376,6 +424,56 @@ declare interface ChartSeries {
|
|
|
376
424
|
* chart-level `<c:dLbls><c:numFmt>` is not set. null = no series-level code.
|
|
377
425
|
*/
|
|
378
426
|
valFormatCode?: string | null;
|
|
427
|
+
/**
|
|
428
|
+
* `<c:marker><c:symbol val>` (ECMA-376 §21.2.2.32) — point marker shape.
|
|
429
|
+
* One of "circle"|"square"|"diamond"|"triangle"|"x"|"plus"|"star"|
|
|
430
|
+
* "dot"|"dash"|"picture"|"none". null = renderer default (circle when
|
|
431
|
+
* showMarker is true).
|
|
432
|
+
*/
|
|
433
|
+
markerSymbol?: string | null;
|
|
434
|
+
/**
|
|
435
|
+
* `<c:marker><c:size val>` (ECMA-376 §21.2.2.34) — marker side length in
|
|
436
|
+
* points. null = renderer default (~5 pt).
|
|
437
|
+
*/
|
|
438
|
+
markerSize?: number | null;
|
|
439
|
+
/** `<c:marker><c:spPr><a:solidFill>` resolved hex (no `#`). */
|
|
440
|
+
markerFill?: string | null;
|
|
441
|
+
/** `<c:marker><c:spPr><a:ln><a:solidFill>` resolved hex (no `#`). */
|
|
442
|
+
markerLine?: string | null;
|
|
443
|
+
/**
|
|
444
|
+
* Per-data-point overrides (ECMA-376 §21.2.2.39 `<c:dPt>`). Keyed by point
|
|
445
|
+
* index. Any unset field falls back to the series-level value.
|
|
446
|
+
*/
|
|
447
|
+
dataPointOverrides?: ChartDataPointOverride[] | null;
|
|
448
|
+
/**
|
|
449
|
+
* Per-data-point custom labels (ECMA-376 §21.2.2.45 `<c:dLbl idx>`).
|
|
450
|
+
* `text` is the resolved plain string — `<a:fld type="CELLRANGE">`
|
|
451
|
+
* placeholders are already substituted at parse time. An empty string
|
|
452
|
+
* means the point's label was deleted with `<c:delete val="1"/>` and
|
|
453
|
+
* the renderer should skip it.
|
|
454
|
+
*/
|
|
455
|
+
dataLabelOverrides?: ChartDataLabelOverride[] | null;
|
|
456
|
+
/**
|
|
457
|
+
* Series-level `<c:dLbls>` block (showVal / showSerName / position).
|
|
458
|
+
* Applied to every point lacking its own `<c:dLbl>` override.
|
|
459
|
+
*/
|
|
460
|
+
seriesDataLabels?: ChartSeriesDataLabels | null;
|
|
461
|
+
/**
|
|
462
|
+
* `<c:errBars>` per-series error bars (ECMA-376 §21.2.2.20). Up to two
|
|
463
|
+
* (one per direction). Plus / minus deltas are absolute per-point values
|
|
464
|
+
* regardless of `errValType`.
|
|
465
|
+
*/
|
|
466
|
+
errBars?: ChartErrBars[] | null;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
declare interface ChartSeriesDataLabels {
|
|
470
|
+
showVal: boolean;
|
|
471
|
+
showCatName: boolean;
|
|
472
|
+
showSerName: boolean;
|
|
473
|
+
showPercent: boolean;
|
|
474
|
+
position?: string;
|
|
475
|
+
fontColor?: string;
|
|
476
|
+
formatCode?: string;
|
|
379
477
|
}
|
|
380
478
|
|
|
381
479
|
declare interface ConditionalFormat {
|
|
@@ -383,6 +481,24 @@ declare interface ConditionalFormat {
|
|
|
383
481
|
rules: CfRule[];
|
|
384
482
|
}
|
|
385
483
|
|
|
484
|
+
declare interface DataLabelOverride {
|
|
485
|
+
idx: number;
|
|
486
|
+
text: string;
|
|
487
|
+
/** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit" or undefined → inherit. */
|
|
488
|
+
position?: string;
|
|
489
|
+
fontColor?: string;
|
|
490
|
+
fontSizeHpt?: number;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
declare interface DataPointOverride {
|
|
494
|
+
idx: number;
|
|
495
|
+
color?: string;
|
|
496
|
+
markerSymbol?: string;
|
|
497
|
+
markerSize?: number;
|
|
498
|
+
markerFill?: string;
|
|
499
|
+
markerLine?: string;
|
|
500
|
+
}
|
|
501
|
+
|
|
386
502
|
declare interface DefinedName {
|
|
387
503
|
name: string;
|
|
388
504
|
formula: string;
|
|
@@ -556,6 +672,20 @@ declare interface Dxf {
|
|
|
556
672
|
numFmt?: NumFmt | null;
|
|
557
673
|
}
|
|
558
674
|
|
|
675
|
+
declare interface ErrBars {
|
|
676
|
+
/** "x" | "y". */
|
|
677
|
+
dir: string;
|
|
678
|
+
/** "plus" | "minus" | "both". */
|
|
679
|
+
barType: string;
|
|
680
|
+
plus: (number | null)[];
|
|
681
|
+
minus: (number | null)[];
|
|
682
|
+
noEndCap: boolean;
|
|
683
|
+
/** Resolved RGB hex (no `#`). */
|
|
684
|
+
color?: string;
|
|
685
|
+
lineWidthEmu?: number;
|
|
686
|
+
dash?: string;
|
|
687
|
+
}
|
|
688
|
+
|
|
559
689
|
declare interface FieldRun {
|
|
560
690
|
/** "page" | "numPages" | "other" */
|
|
561
691
|
fieldType: string;
|
|
@@ -747,6 +877,16 @@ declare interface LoadOptions {
|
|
|
747
877
|
useGoogleFonts?: boolean;
|
|
748
878
|
}
|
|
749
879
|
|
|
880
|
+
declare interface ManualLayout {
|
|
881
|
+
xMode: string;
|
|
882
|
+
yMode: string;
|
|
883
|
+
layoutTarget?: string;
|
|
884
|
+
x: number;
|
|
885
|
+
y: number;
|
|
886
|
+
w?: number;
|
|
887
|
+
h?: number;
|
|
888
|
+
}
|
|
889
|
+
|
|
750
890
|
declare interface MediaElement {
|
|
751
891
|
type: 'media';
|
|
752
892
|
x: number;
|
|
@@ -1238,6 +1378,16 @@ declare interface SectionProps {
|
|
|
1238
1378
|
|
|
1239
1379
|
declare type SelectionMode_2 = 'cells' | 'rows' | 'cols' | 'all';
|
|
1240
1380
|
|
|
1381
|
+
declare interface SeriesDataLabels {
|
|
1382
|
+
showVal: boolean;
|
|
1383
|
+
showCatName: boolean;
|
|
1384
|
+
showSerName: boolean;
|
|
1385
|
+
showPercent: boolean;
|
|
1386
|
+
position?: string;
|
|
1387
|
+
fontColor?: string;
|
|
1388
|
+
formatCode?: string;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1241
1391
|
declare interface Shadow {
|
|
1242
1392
|
color: string;
|
|
1243
1393
|
alpha: number;
|
|
@@ -1412,6 +1562,48 @@ declare type SpaceLine = {
|
|
|
1412
1562
|
val: number;
|
|
1413
1563
|
};
|
|
1414
1564
|
|
|
1565
|
+
declare interface Sparkline {
|
|
1566
|
+
/** 1-based row of the destination cell (`<xm:sqref>`). */
|
|
1567
|
+
row: number;
|
|
1568
|
+
/** 1-based column of the destination cell. */
|
|
1569
|
+
col: number;
|
|
1570
|
+
/** Numeric values resolved from the `<xm:f>` range. `null` for empty
|
|
1571
|
+
* / non-numeric cells; honored as gaps at render time. */
|
|
1572
|
+
values: (number | null)[];
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
declare interface SparklineGroup {
|
|
1576
|
+
/** `line` (default) | `column` | `stem` (win-loss). */
|
|
1577
|
+
kind: 'line' | 'column' | 'stem';
|
|
1578
|
+
markers: boolean;
|
|
1579
|
+
high: boolean;
|
|
1580
|
+
low: boolean;
|
|
1581
|
+
first: boolean;
|
|
1582
|
+
last: boolean;
|
|
1583
|
+
negative: boolean;
|
|
1584
|
+
/** Show the horizontal axis line through 0 when data crosses it. */
|
|
1585
|
+
displayXAxis: boolean;
|
|
1586
|
+
/** `gap` (default) | `zero` | `span`. */
|
|
1587
|
+
displayEmptyCellsAs: string;
|
|
1588
|
+
/** `individual` (default) | `group` | `custom`. */
|
|
1589
|
+
minAxisType: string;
|
|
1590
|
+
maxAxisType: string;
|
|
1591
|
+
manualMin?: number;
|
|
1592
|
+
manualMax?: number;
|
|
1593
|
+
/** Stroke weight in pt for `line`. ECMA-376 default 0.75. */
|
|
1594
|
+
lineWeight: number;
|
|
1595
|
+
/** Resolved RGB hex strings (theme/tint already flattened by the parser). */
|
|
1596
|
+
colorSeries?: string;
|
|
1597
|
+
colorNegative?: string;
|
|
1598
|
+
colorAxis?: string;
|
|
1599
|
+
colorMarkers?: string;
|
|
1600
|
+
colorFirst?: string;
|
|
1601
|
+
colorLast?: string;
|
|
1602
|
+
colorHigh?: string;
|
|
1603
|
+
colorLow?: string;
|
|
1604
|
+
sparklines: Sparkline[];
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1415
1607
|
declare interface Stroke {
|
|
1416
1608
|
color: string;
|
|
1417
1609
|
/** Width in EMU */
|
|
@@ -1683,6 +1875,10 @@ declare interface Worksheet {
|
|
|
1683
1875
|
* caption and the saved item list (with selection flags) so the renderer
|
|
1684
1876
|
* can draw a static button bank without the live pivot engine. */
|
|
1685
1877
|
slicers?: SlicerAnchor[];
|
|
1878
|
+
/** Sparkline groups (Office 2010+ extension `x14:sparklineGroup`).
|
|
1879
|
+
* Cross-sheet `<xm:f>` data references are resolved to numeric values at
|
|
1880
|
+
* parse time, and theme + tint colors are flattened to `#RRGGBB`. */
|
|
1881
|
+
sparklineGroups?: SparklineGroup[];
|
|
1686
1882
|
}
|
|
1687
1883
|
|
|
1688
1884
|
export declare namespace xlsx {
|
|
@@ -1736,6 +1932,27 @@ declare interface XlsxChartSeries {
|
|
|
1736
1932
|
valFormatCode?: string | null;
|
|
1737
1933
|
/** `<c:ser><c:order>` — stacking/legend display order (§21.2.2.28). */
|
|
1738
1934
|
order?: number;
|
|
1935
|
+
/** `<c:marker><c:symbol val>` — point marker shape (ECMA-376 §21.2.2.32). */
|
|
1936
|
+
markerSymbol?: string;
|
|
1937
|
+
/** `<c:marker><c:size val>` — point marker side length in pt (§21.2.2.34). */
|
|
1938
|
+
markerSize?: number;
|
|
1939
|
+
/** `<c:marker><c:spPr>` resolved fill (no `#`). */
|
|
1940
|
+
markerFill?: string;
|
|
1941
|
+
/** `<c:marker><c:spPr><a:ln>` resolved stroke (no `#`). */
|
|
1942
|
+
markerLine?: string;
|
|
1943
|
+
/** `<c:dPt>` per-data-point overrides (§21.2.2.39). */
|
|
1944
|
+
dataPointOverrides?: DataPointOverride[];
|
|
1945
|
+
/** Per-idx custom data labels (`<c:dLbl idx>`, §21.2.2.45). Custom rich
|
|
1946
|
+
* text is flattened to plain string at parse time; CELLRANGE field
|
|
1947
|
+
* placeholders are resolved against the series' `<c15:datalabelsRange>`
|
|
1948
|
+
* cache. */
|
|
1949
|
+
dataLabelOverrides?: DataLabelOverride[];
|
|
1950
|
+
/** Series-level `<c:dLbls>` defaults applied to every point lacking its
|
|
1951
|
+
* own override. */
|
|
1952
|
+
seriesDataLabels?: SeriesDataLabels;
|
|
1953
|
+
/** `<c:errBars>` (§21.2.2.20). At parse time, plus / minus deltas are
|
|
1954
|
+
* resolved into absolute per-point values regardless of `errValType`. */
|
|
1955
|
+
errBars?: ErrBars[];
|
|
1739
1956
|
}
|
|
1740
1957
|
|
|
1741
1958
|
declare class XlsxViewer {
|
package/dist/types/pptx.d.ts
CHANGED
|
@@ -48,6 +48,26 @@ declare type Bullet = {
|
|
|
48
48
|
startAt: number | null;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
declare interface ChartDataLabelOverride {
|
|
52
|
+
idx: number;
|
|
53
|
+
/** Empty string = label deleted (skip drawing). */
|
|
54
|
+
text: string;
|
|
55
|
+
/** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit". undefined = inherit. */
|
|
56
|
+
position?: string;
|
|
57
|
+
fontColor?: string;
|
|
58
|
+
fontSizeHpt?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare interface ChartDataPointOverride {
|
|
62
|
+
idx: number;
|
|
63
|
+
/** Resolved fill hex (no `#`). */
|
|
64
|
+
color?: string;
|
|
65
|
+
markerSymbol?: string;
|
|
66
|
+
markerSize?: number;
|
|
67
|
+
markerFill?: string;
|
|
68
|
+
markerLine?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
51
71
|
/**
|
|
52
72
|
* PPTX chart element. The Rust parser emits ChartModel fields flat at the
|
|
53
73
|
* top level, alongside the element position (x/y/width/height in EMU).
|
|
@@ -94,6 +114,21 @@ declare interface ChartElement {
|
|
|
94
114
|
dataLabelFontSizeHpt: number | null;
|
|
95
115
|
}
|
|
96
116
|
|
|
117
|
+
declare interface ChartErrBars {
|
|
118
|
+
/** "x" | "y". */
|
|
119
|
+
dir: string;
|
|
120
|
+
/** "plus" | "minus" | "both". */
|
|
121
|
+
barType: string;
|
|
122
|
+
plus: (number | null)[];
|
|
123
|
+
minus: (number | null)[];
|
|
124
|
+
noEndCap: boolean;
|
|
125
|
+
/** Resolved hex (no `#`). */
|
|
126
|
+
color?: string;
|
|
127
|
+
lineWidthEmu?: number;
|
|
128
|
+
/** "solid"|"dash"|"dot"|"dashDot"|... */
|
|
129
|
+
dash?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
97
132
|
declare interface ChartSeries {
|
|
98
133
|
name: string;
|
|
99
134
|
/** Hex without '#'. null = fall back to palette. */
|
|
@@ -129,6 +164,56 @@ declare interface ChartSeries {
|
|
|
129
164
|
* chart-level `<c:dLbls><c:numFmt>` is not set. null = no series-level code.
|
|
130
165
|
*/
|
|
131
166
|
valFormatCode?: string | null;
|
|
167
|
+
/**
|
|
168
|
+
* `<c:marker><c:symbol val>` (ECMA-376 §21.2.2.32) — point marker shape.
|
|
169
|
+
* One of "circle"|"square"|"diamond"|"triangle"|"x"|"plus"|"star"|
|
|
170
|
+
* "dot"|"dash"|"picture"|"none". null = renderer default (circle when
|
|
171
|
+
* showMarker is true).
|
|
172
|
+
*/
|
|
173
|
+
markerSymbol?: string | null;
|
|
174
|
+
/**
|
|
175
|
+
* `<c:marker><c:size val>` (ECMA-376 §21.2.2.34) — marker side length in
|
|
176
|
+
* points. null = renderer default (~5 pt).
|
|
177
|
+
*/
|
|
178
|
+
markerSize?: number | null;
|
|
179
|
+
/** `<c:marker><c:spPr><a:solidFill>` resolved hex (no `#`). */
|
|
180
|
+
markerFill?: string | null;
|
|
181
|
+
/** `<c:marker><c:spPr><a:ln><a:solidFill>` resolved hex (no `#`). */
|
|
182
|
+
markerLine?: string | null;
|
|
183
|
+
/**
|
|
184
|
+
* Per-data-point overrides (ECMA-376 §21.2.2.39 `<c:dPt>`). Keyed by point
|
|
185
|
+
* index. Any unset field falls back to the series-level value.
|
|
186
|
+
*/
|
|
187
|
+
dataPointOverrides?: ChartDataPointOverride[] | null;
|
|
188
|
+
/**
|
|
189
|
+
* Per-data-point custom labels (ECMA-376 §21.2.2.45 `<c:dLbl idx>`).
|
|
190
|
+
* `text` is the resolved plain string — `<a:fld type="CELLRANGE">`
|
|
191
|
+
* placeholders are already substituted at parse time. An empty string
|
|
192
|
+
* means the point's label was deleted with `<c:delete val="1"/>` and
|
|
193
|
+
* the renderer should skip it.
|
|
194
|
+
*/
|
|
195
|
+
dataLabelOverrides?: ChartDataLabelOverride[] | null;
|
|
196
|
+
/**
|
|
197
|
+
* Series-level `<c:dLbls>` block (showVal / showSerName / position).
|
|
198
|
+
* Applied to every point lacking its own `<c:dLbl>` override.
|
|
199
|
+
*/
|
|
200
|
+
seriesDataLabels?: ChartSeriesDataLabels | null;
|
|
201
|
+
/**
|
|
202
|
+
* `<c:errBars>` per-series error bars (ECMA-376 §21.2.2.20). Up to two
|
|
203
|
+
* (one per direction). Plus / minus deltas are absolute per-point values
|
|
204
|
+
* regardless of `errValType`.
|
|
205
|
+
*/
|
|
206
|
+
errBars?: ChartErrBars[] | null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare interface ChartSeriesDataLabels {
|
|
210
|
+
showVal: boolean;
|
|
211
|
+
showCatName: boolean;
|
|
212
|
+
showSerName: boolean;
|
|
213
|
+
showPercent: boolean;
|
|
214
|
+
position?: string;
|
|
215
|
+
fontColor?: string;
|
|
216
|
+
formatCode?: string;
|
|
132
217
|
}
|
|
133
218
|
|
|
134
219
|
export declare type Fill = SolidFill | NoFill | GradientFill;
|
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -247,6 +247,19 @@ declare interface ChartData {
|
|
|
247
247
|
/** `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
|
|
248
248
|
* number format (§21.2.2.35). */
|
|
249
249
|
dataLabelFormatCode?: string | null;
|
|
250
|
+
/** `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). */
|
|
251
|
+
catAxisFormatCode?: string;
|
|
252
|
+
/** `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. */
|
|
253
|
+
catAxisMin?: number;
|
|
254
|
+
catAxisMax?: number;
|
|
255
|
+
/** `<c:valAx><c:scaling><c:min/max>` — explicit Y-axis range. */
|
|
256
|
+
valAxisMin?: number;
|
|
257
|
+
valAxisMax?: number;
|
|
258
|
+
/** `<c:title><c:layout><c:manualLayout>` (§21.2.2.27) absolute placement. */
|
|
259
|
+
titleManualLayout?: ManualLayout;
|
|
260
|
+
/** `<c:plotArea><c:layout><c:manualLayout>` — `layoutTarget=inner` /
|
|
261
|
+
* `outer` controls whether axes are inside the rect or outside. */
|
|
262
|
+
plotAreaManualLayout?: ManualLayout;
|
|
250
263
|
}
|
|
251
264
|
|
|
252
265
|
declare interface ConditionalFormat {
|
|
@@ -254,6 +267,24 @@ declare interface ConditionalFormat {
|
|
|
254
267
|
rules: CfRule[];
|
|
255
268
|
}
|
|
256
269
|
|
|
270
|
+
declare interface DataLabelOverride {
|
|
271
|
+
idx: number;
|
|
272
|
+
text: string;
|
|
273
|
+
/** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit" or undefined → inherit. */
|
|
274
|
+
position?: string;
|
|
275
|
+
fontColor?: string;
|
|
276
|
+
fontSizeHpt?: number;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
declare interface DataPointOverride {
|
|
280
|
+
idx: number;
|
|
281
|
+
color?: string;
|
|
282
|
+
markerSymbol?: string;
|
|
283
|
+
markerSize?: number;
|
|
284
|
+
markerFill?: string;
|
|
285
|
+
markerLine?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
257
288
|
declare interface DefinedName {
|
|
258
289
|
name: string;
|
|
259
290
|
formula: string;
|
|
@@ -270,6 +301,20 @@ declare interface Dxf {
|
|
|
270
301
|
numFmt?: NumFmt | null;
|
|
271
302
|
}
|
|
272
303
|
|
|
304
|
+
declare interface ErrBars {
|
|
305
|
+
/** "x" | "y". */
|
|
306
|
+
dir: string;
|
|
307
|
+
/** "plus" | "minus" | "both". */
|
|
308
|
+
barType: string;
|
|
309
|
+
plus: (number | null)[];
|
|
310
|
+
minus: (number | null)[];
|
|
311
|
+
noEndCap: boolean;
|
|
312
|
+
/** Resolved RGB hex (no `#`). */
|
|
313
|
+
color?: string;
|
|
314
|
+
lineWidthEmu?: number;
|
|
315
|
+
dash?: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
273
318
|
export declare interface Fill {
|
|
274
319
|
patternType: string;
|
|
275
320
|
fgColor: string | null;
|
|
@@ -336,6 +381,16 @@ declare interface LegendManualLayout {
|
|
|
336
381
|
h: number;
|
|
337
382
|
}
|
|
338
383
|
|
|
384
|
+
declare interface ManualLayout {
|
|
385
|
+
xMode: string;
|
|
386
|
+
yMode: string;
|
|
387
|
+
layoutTarget?: string;
|
|
388
|
+
x: number;
|
|
389
|
+
y: number;
|
|
390
|
+
w?: number;
|
|
391
|
+
h?: number;
|
|
392
|
+
}
|
|
393
|
+
|
|
339
394
|
export declare interface MergeCell {
|
|
340
395
|
top: number;
|
|
341
396
|
left: number;
|
|
@@ -437,6 +492,16 @@ declare interface RunFont {
|
|
|
437
492
|
declare type SelectionMode_2 = 'cells' | 'rows' | 'cols' | 'all';
|
|
438
493
|
export { SelectionMode_2 as SelectionMode }
|
|
439
494
|
|
|
495
|
+
declare interface SeriesDataLabels {
|
|
496
|
+
showVal: boolean;
|
|
497
|
+
showCatName: boolean;
|
|
498
|
+
showSerName: boolean;
|
|
499
|
+
showPercent: boolean;
|
|
500
|
+
position?: string;
|
|
501
|
+
fontColor?: string;
|
|
502
|
+
formatCode?: string;
|
|
503
|
+
}
|
|
504
|
+
|
|
440
505
|
declare interface ShapeAnchor {
|
|
441
506
|
fromCol: number;
|
|
442
507
|
fromColOff: number;
|
|
@@ -508,6 +573,48 @@ declare interface SlicerItem {
|
|
|
508
573
|
selected: boolean;
|
|
509
574
|
}
|
|
510
575
|
|
|
576
|
+
declare interface Sparkline {
|
|
577
|
+
/** 1-based row of the destination cell (`<xm:sqref>`). */
|
|
578
|
+
row: number;
|
|
579
|
+
/** 1-based column of the destination cell. */
|
|
580
|
+
col: number;
|
|
581
|
+
/** Numeric values resolved from the `<xm:f>` range. `null` for empty
|
|
582
|
+
* / non-numeric cells; honored as gaps at render time. */
|
|
583
|
+
values: (number | null)[];
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare interface SparklineGroup {
|
|
587
|
+
/** `line` (default) | `column` | `stem` (win-loss). */
|
|
588
|
+
kind: 'line' | 'column' | 'stem';
|
|
589
|
+
markers: boolean;
|
|
590
|
+
high: boolean;
|
|
591
|
+
low: boolean;
|
|
592
|
+
first: boolean;
|
|
593
|
+
last: boolean;
|
|
594
|
+
negative: boolean;
|
|
595
|
+
/** Show the horizontal axis line through 0 when data crosses it. */
|
|
596
|
+
displayXAxis: boolean;
|
|
597
|
+
/** `gap` (default) | `zero` | `span`. */
|
|
598
|
+
displayEmptyCellsAs: string;
|
|
599
|
+
/** `individual` (default) | `group` | `custom`. */
|
|
600
|
+
minAxisType: string;
|
|
601
|
+
maxAxisType: string;
|
|
602
|
+
manualMin?: number;
|
|
603
|
+
manualMax?: number;
|
|
604
|
+
/** Stroke weight in pt for `line`. ECMA-376 default 0.75. */
|
|
605
|
+
lineWeight: number;
|
|
606
|
+
/** Resolved RGB hex strings (theme/tint already flattened by the parser). */
|
|
607
|
+
colorSeries?: string;
|
|
608
|
+
colorNegative?: string;
|
|
609
|
+
colorAxis?: string;
|
|
610
|
+
colorMarkers?: string;
|
|
611
|
+
colorFirst?: string;
|
|
612
|
+
colorLast?: string;
|
|
613
|
+
colorHigh?: string;
|
|
614
|
+
colorLow?: string;
|
|
615
|
+
sparklines: Sparkline[];
|
|
616
|
+
}
|
|
617
|
+
|
|
511
618
|
export declare interface Styles {
|
|
512
619
|
fonts: Font[];
|
|
513
620
|
fills: Fill[];
|
|
@@ -607,6 +714,10 @@ export declare interface Worksheet {
|
|
|
607
714
|
* caption and the saved item list (with selection flags) so the renderer
|
|
608
715
|
* can draw a static button bank without the live pivot engine. */
|
|
609
716
|
slicers?: SlicerAnchor[];
|
|
717
|
+
/** Sparkline groups (Office 2010+ extension `x14:sparklineGroup`).
|
|
718
|
+
* Cross-sheet `<xm:f>` data references are resolved to numeric values at
|
|
719
|
+
* parse time, and theme + tint colors are flattened to `#RRGGBB`. */
|
|
720
|
+
sparklineGroups?: SparklineGroup[];
|
|
610
721
|
}
|
|
611
722
|
|
|
612
723
|
/**
|
|
@@ -629,6 +740,27 @@ declare interface XlsxChartSeries {
|
|
|
629
740
|
valFormatCode?: string | null;
|
|
630
741
|
/** `<c:ser><c:order>` — stacking/legend display order (§21.2.2.28). */
|
|
631
742
|
order?: number;
|
|
743
|
+
/** `<c:marker><c:symbol val>` — point marker shape (ECMA-376 §21.2.2.32). */
|
|
744
|
+
markerSymbol?: string;
|
|
745
|
+
/** `<c:marker><c:size val>` — point marker side length in pt (§21.2.2.34). */
|
|
746
|
+
markerSize?: number;
|
|
747
|
+
/** `<c:marker><c:spPr>` resolved fill (no `#`). */
|
|
748
|
+
markerFill?: string;
|
|
749
|
+
/** `<c:marker><c:spPr><a:ln>` resolved stroke (no `#`). */
|
|
750
|
+
markerLine?: string;
|
|
751
|
+
/** `<c:dPt>` per-data-point overrides (§21.2.2.39). */
|
|
752
|
+
dataPointOverrides?: DataPointOverride[];
|
|
753
|
+
/** Per-idx custom data labels (`<c:dLbl idx>`, §21.2.2.45). Custom rich
|
|
754
|
+
* text is flattened to plain string at parse time; CELLRANGE field
|
|
755
|
+
* placeholders are resolved against the series' `<c15:datalabelsRange>`
|
|
756
|
+
* cache. */
|
|
757
|
+
dataLabelOverrides?: DataLabelOverride[];
|
|
758
|
+
/** Series-level `<c:dLbls>` defaults applied to every point lacking its
|
|
759
|
+
* own override. */
|
|
760
|
+
seriesDataLabels?: SeriesDataLabels;
|
|
761
|
+
/** `<c:errBars>` (§21.2.2.20). At parse time, plus / minus deltas are
|
|
762
|
+
* resolved into absolute per-point values regardless of `errValType`. */
|
|
763
|
+
errBars?: ErrBars[];
|
|
632
764
|
}
|
|
633
765
|
|
|
634
766
|
export declare class XlsxViewer {
|