@petal-nexus/toolkit 0.1.0 → 0.1.1
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 +31 -12
- package/dist/petal-toolkit.cjs10.js +1 -1
- package/dist/petal-toolkit.cjs11.js +1 -1
- package/dist/petal-toolkit.cjs1123.js +1 -1
- package/dist/petal-toolkit.cjs1125.js +1 -1
- package/dist/petal-toolkit.cjs1128.js +1 -1
- package/dist/petal-toolkit.cjs12.js +1 -1
- package/dist/petal-toolkit.cjs13.js +1 -1
- package/dist/petal-toolkit.cjs1320.js +1 -1
- package/dist/petal-toolkit.cjs1320.js.map +1 -1
- package/dist/petal-toolkit.cjs1321.js +1 -1
- package/dist/petal-toolkit.cjs1321.js.map +1 -1
- package/dist/petal-toolkit.cjs1322.js +1 -2
- package/dist/petal-toolkit.cjs1322.js.map +1 -1
- package/dist/petal-toolkit.cjs1325.js +1 -1
- package/dist/petal-toolkit.cjs1327.js +1 -1
- package/dist/petal-toolkit.cjs1328.js +1 -1
- package/dist/petal-toolkit.cjs1329.js +1 -1
- package/dist/petal-toolkit.cjs1329.js.map +1 -1
- package/dist/petal-toolkit.cjs1330.js +1 -1
- package/dist/petal-toolkit.cjs1330.js.map +1 -1
- package/dist/petal-toolkit.cjs1331.js +2 -1
- package/dist/petal-toolkit.cjs1331.js.map +1 -1
- package/dist/petal-toolkit.cjs1332.js +1 -1
- package/dist/petal-toolkit.cjs1332.js.map +1 -1
- package/dist/petal-toolkit.cjs1333.js +1 -1
- package/dist/petal-toolkit.cjs1333.js.map +1 -1
- package/dist/petal-toolkit.cjs1334.js +1 -1
- package/dist/petal-toolkit.cjs1334.js.map +1 -1
- package/dist/petal-toolkit.cjs1335.js +1 -1
- package/dist/petal-toolkit.cjs1346.js +1 -1
- package/dist/petal-toolkit.cjs1347.js +1 -1
- package/dist/petal-toolkit.cjs1348.js +1 -1
- package/dist/petal-toolkit.cjs14.js +1 -1
- package/dist/petal-toolkit.cjs15.js +1 -1
- package/dist/petal-toolkit.cjs18.js +1 -1
- package/dist/petal-toolkit.cjs19.js +1 -1
- package/dist/petal-toolkit.cjs22.js +1 -1
- package/dist/petal-toolkit.cjs24.js +1 -1
- package/dist/petal-toolkit.cjs25.js +1 -1
- package/dist/petal-toolkit.cjs26.js +1 -1
- package/dist/petal-toolkit.cjs27.js +1 -1
- package/dist/petal-toolkit.cjs30.js +1 -1
- package/dist/petal-toolkit.cjs31.js +1 -1
- package/dist/petal-toolkit.cjs32.js +1 -1
- package/dist/petal-toolkit.cjs34.js +1 -1
- package/dist/petal-toolkit.cjs35.js +1 -1
- package/dist/petal-toolkit.cjs36.js +1 -1
- package/dist/petal-toolkit.cjs37.js +1 -1
- package/dist/petal-toolkit.cjs38.js +1 -1
- package/dist/petal-toolkit.cjs4.js +1 -1
- package/dist/petal-toolkit.cjs40.js +1 -1
- package/dist/petal-toolkit.cjs41.js +1 -1
- package/dist/petal-toolkit.cjs42.js +1 -1
- package/dist/petal-toolkit.cjs43.js +1 -1
- package/dist/petal-toolkit.cjs44.js +1 -1
- package/dist/petal-toolkit.cjs45.js +1 -1
- package/dist/petal-toolkit.cjs47.js +1 -1
- package/dist/petal-toolkit.cjs48.js +1 -1
- package/dist/petal-toolkit.cjs5.js +1 -1
- package/dist/petal-toolkit.cjs50.js +1 -1
- package/dist/petal-toolkit.cjs52.js +1 -1
- package/dist/petal-toolkit.cjs6.js +1 -1
- package/dist/petal-toolkit.cjs682.js +1 -1
- package/dist/petal-toolkit.cjs684.js +1 -1
- package/dist/petal-toolkit.cjs7.js +1 -1
- package/dist/petal-toolkit.cjs715.js +1 -1
- package/dist/petal-toolkit.cjs719.js +1 -1
- package/dist/petal-toolkit.cjs721.js +1 -1
- package/dist/petal-toolkit.cjs726.js +1 -1
- package/dist/petal-toolkit.cjs734.js +1 -1
- package/dist/petal-toolkit.cjs752.js +1 -1
- package/dist/petal-toolkit.cjs764.js +1 -1
- package/dist/petal-toolkit.cjs787.js +1 -1
- package/dist/petal-toolkit.cjs8.js +1 -1
- package/dist/petal-toolkit.cjs847.js +1 -1
- package/dist/petal-toolkit.cjs848.js +1 -1
- package/dist/petal-toolkit.cjs850.js +1 -1
- package/dist/petal-toolkit.cjs851.js +1 -1
- package/dist/petal-toolkit.cjs854.js +1 -1
- package/dist/petal-toolkit.cjs859.js +1 -1
- package/dist/petal-toolkit.cjs861.js +1 -1
- package/dist/petal-toolkit.cjs864.js +1 -1
- package/dist/petal-toolkit.cjs866.js +1 -1
- package/dist/petal-toolkit.cjs867.js +1 -1
- package/dist/petal-toolkit.cjs868.js +1 -1
- package/dist/petal-toolkit.cjs870.js +1 -1
- package/dist/petal-toolkit.cjs874.js +1 -1
- package/dist/petal-toolkit.cjs9.js +1 -1
- package/dist/petal-toolkit.es10.js +3 -3
- package/dist/petal-toolkit.es11.js +3 -3
- package/dist/petal-toolkit.es1123.js +1 -1
- package/dist/petal-toolkit.es1125.js +1 -1
- package/dist/petal-toolkit.es1128.js +1 -1
- package/dist/petal-toolkit.es12.js +3 -3
- package/dist/petal-toolkit.es13.js +2 -2
- package/dist/petal-toolkit.es1320.js +2 -34
- package/dist/petal-toolkit.es1320.js.map +1 -1
- package/dist/petal-toolkit.es1321.js +2 -52
- package/dist/petal-toolkit.es1321.js.map +1 -1
- package/dist/petal-toolkit.es1322.js +2 -48
- package/dist/petal-toolkit.es1322.js.map +1 -1
- package/dist/petal-toolkit.es1324.js +2 -2
- package/dist/petal-toolkit.es1325.js +2 -2
- package/dist/petal-toolkit.es1326.js +2 -2
- package/dist/petal-toolkit.es1327.js +2 -2
- package/dist/petal-toolkit.es1328.js +2 -2
- package/dist/petal-toolkit.es1329.js +52 -2
- package/dist/petal-toolkit.es1329.js.map +1 -1
- package/dist/petal-toolkit.es1330.js +95 -2
- package/dist/petal-toolkit.es1330.js.map +1 -1
- package/dist/petal-toolkit.es1331.js +48 -2
- package/dist/petal-toolkit.es1331.js.map +1 -1
- package/dist/petal-toolkit.es1332.js +34 -17
- package/dist/petal-toolkit.es1332.js.map +1 -1
- package/dist/petal-toolkit.es1333.js +2 -95
- package/dist/petal-toolkit.es1333.js.map +1 -1
- package/dist/petal-toolkit.es1334.js +17 -2
- package/dist/petal-toolkit.es1334.js.map +1 -1
- package/dist/petal-toolkit.es1335.js +2 -2
- package/dist/petal-toolkit.es1338.js +2 -2
- package/dist/petal-toolkit.es1339.js +2 -2
- package/dist/petal-toolkit.es1340.js +2 -2
- package/dist/petal-toolkit.es1341.js +2 -2
- package/dist/petal-toolkit.es1343.js +2 -2
- package/dist/petal-toolkit.es1344.js +2 -2
- package/dist/petal-toolkit.es1346.js +2 -2
- package/dist/petal-toolkit.es1347.js +2 -2
- package/dist/petal-toolkit.es1348.js +2 -2
- package/dist/petal-toolkit.es14.js +2 -2
- package/dist/petal-toolkit.es15.js +2 -2
- package/dist/petal-toolkit.es18.js +3 -3
- package/dist/petal-toolkit.es19.js +3 -3
- package/dist/petal-toolkit.es22.js +2 -2
- package/dist/petal-toolkit.es24.js +2 -2
- package/dist/petal-toolkit.es25.js +2 -2
- package/dist/petal-toolkit.es26.js +2 -2
- package/dist/petal-toolkit.es27.js +3 -3
- package/dist/petal-toolkit.es30.js +1 -1
- package/dist/petal-toolkit.es31.js +2 -2
- package/dist/petal-toolkit.es32.js +2 -2
- package/dist/petal-toolkit.es34.js +2 -2
- package/dist/petal-toolkit.es35.js +1 -1
- package/dist/petal-toolkit.es36.js +2 -2
- package/dist/petal-toolkit.es37.js +2 -2
- package/dist/petal-toolkit.es38.js +1 -1
- package/dist/petal-toolkit.es4.js +2 -2
- package/dist/petal-toolkit.es40.js +2 -2
- package/dist/petal-toolkit.es41.js +2 -2
- package/dist/petal-toolkit.es42.js +2 -2
- package/dist/petal-toolkit.es43.js +2 -2
- package/dist/petal-toolkit.es44.js +3 -3
- package/dist/petal-toolkit.es45.js +2 -2
- package/dist/petal-toolkit.es47.js +2 -2
- package/dist/petal-toolkit.es48.js +1 -1
- package/dist/petal-toolkit.es5.js +2 -2
- package/dist/petal-toolkit.es50.js +1 -1
- package/dist/petal-toolkit.es52.js +2 -2
- package/dist/petal-toolkit.es6.js +3 -3
- package/dist/petal-toolkit.es682.js +1 -1
- package/dist/petal-toolkit.es684.js +1 -1
- package/dist/petal-toolkit.es7.js +2 -2
- package/dist/petal-toolkit.es715.js +1 -1
- package/dist/petal-toolkit.es719.js +1 -1
- package/dist/petal-toolkit.es721.js +1 -1
- package/dist/petal-toolkit.es726.js +1 -1
- package/dist/petal-toolkit.es734.js +1 -1
- package/dist/petal-toolkit.es752.js +1 -1
- package/dist/petal-toolkit.es764.js +1 -1
- package/dist/petal-toolkit.es787.js +1 -1
- package/dist/petal-toolkit.es8.js +1 -1
- package/dist/petal-toolkit.es847.js +1 -1
- package/dist/petal-toolkit.es848.js +1 -1
- package/dist/petal-toolkit.es850.js +1 -1
- package/dist/petal-toolkit.es851.js +1 -1
- package/dist/petal-toolkit.es854.js +1 -1
- package/dist/petal-toolkit.es859.js +1 -1
- package/dist/petal-toolkit.es861.js +1 -1
- package/dist/petal-toolkit.es864.js +1 -1
- package/dist/petal-toolkit.es866.js +1 -1
- package/dist/petal-toolkit.es867.js +1 -1
- package/dist/petal-toolkit.es868.js +1 -1
- package/dist/petal-toolkit.es870.js +1 -1
- package/dist/petal-toolkit.es874.js +1 -1
- package/dist/petal-toolkit.es9.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,28 +205,47 @@ petal-toolkit/
|
|
|
205
205
|
|
|
206
206
|
2. Ensure you have access to the `@petal` organization on npm
|
|
207
207
|
|
|
208
|
-
### Publishing
|
|
208
|
+
### Publishing Workflow
|
|
209
|
+
|
|
210
|
+
**ALWAYS commit and push BEFORE publishing to npm.**
|
|
209
211
|
|
|
210
212
|
```bash
|
|
211
|
-
#
|
|
213
|
+
# 1. Make your changes and commit them
|
|
214
|
+
git add .
|
|
215
|
+
git commit -m "Your changes"
|
|
216
|
+
|
|
217
|
+
# 2. Run tests and build
|
|
218
|
+
npm run typecheck
|
|
219
|
+
npm test
|
|
212
220
|
npm run build
|
|
213
221
|
|
|
214
|
-
#
|
|
222
|
+
# 3. Bump version (creates a git commit + tag automatically)
|
|
223
|
+
npm version patch
|
|
224
|
+
# 0.1.0 → 0.1.1 (bug fixes)
|
|
225
|
+
npm version minor
|
|
226
|
+
# 0.1.0 → 0.2.0 (new features)
|
|
227
|
+
npm version major
|
|
228
|
+
# 0.1.0 → 1.0.0 (breaking changes)
|
|
229
|
+
|
|
230
|
+
# 4. Push commits and tags to git
|
|
231
|
+
git push && git push --tags
|
|
232
|
+
|
|
233
|
+
# 5. Preview what will be published
|
|
215
234
|
npm pack --dry-run
|
|
216
235
|
|
|
217
|
-
# Publish
|
|
236
|
+
# 6. Publish to npm
|
|
218
237
|
npm publish
|
|
219
|
-
```
|
|
220
238
|
|
|
221
|
-
|
|
239
|
+
# 7. Optional: Deploy Storybook to Chromatic
|
|
240
|
+
npx chromatic --project-token=YOUR_TOKEN --build-script-name=build:storybook
|
|
241
|
+
```
|
|
222
242
|
|
|
223
|
-
|
|
224
|
-
npm version patch # 0.1.0 → 0.1.1 (bug fixes)
|
|
225
|
-
npm version minor # 0.1.0 → 0.2.0 (new features)
|
|
226
|
-
npm version major # 0.1.0 → 1.0.0 (breaking changes)
|
|
243
|
+
### Why this order?
|
|
227
244
|
|
|
228
|
-
|
|
229
|
-
|
|
245
|
+
- Git becomes the source of truth
|
|
246
|
+
- npm registry matches git tags
|
|
247
|
+
- Rollbacks are easier if something goes wrong
|
|
248
|
+
- CI/CD can verify commits before publish
|
|
230
249
|
|
|
231
250
|
---
|
|
232
251
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),x=require("react"),E=require("./petal-toolkit.cjs59.js"),M=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),x=require("react"),E=require("./petal-toolkit.cjs59.js"),M=require("./petal-toolkit.cjs1329.js"),d=require("./petal-toolkit.cjs55.js"),R=require("./petal-toolkit.cjs1330.js"),q=require("./petal-toolkit.cjs1331.js"),s=require("./petal-toolkit.cjs58.js");function j(p){switch(p){case"light":return{capexColor:"#3b82f6",acquisitionsColor:"#8b5cf6",dividendsColor:"#16a34a",buybacksColor:"#f97316",debtColor:"#dc2626"};case"navy":return{capexColor:"#60a5fa",acquisitionsColor:"#a78bfa",dividendsColor:"#10b981",buybacksColor:"#fb923c",debtColor:"#f43f5e"};case"dark":default:return{capexColor:"#3B82F6",acquisitionsColor:"#A78BFA",dividendsColor:"#00FFB3",buybacksColor:"#FFA502",debtColor:"#FF4757"}}}const w=x.memo(function({data:r,width:A="100%",height:v=400,className:S,themePreset:b="dark",theme:g,showLegend:m=!0,onChartReady:c}){const{containerId:n,containerRef:f,surfaceRef:l,sciChartTheme:y,baseColors:a,containerStyle:k}=M.useFinancialChartSetup({chartName:"capital-allocation",width:A,height:v,themePreset:b,customTheme:g}),t=j(b),h=r.some(i=>i.debtRepayment!==void 0&&i.debtRepayment>0);return x.useEffect(()=>{if(!f.current||r.length===0)return;let i=!1;return(async()=>{try{const u=r.map(e=>e.period),D=r.map((e,V)=>V),{sciChartSurface:o,wasmContext:C}=await E.scichartExports.SciChartSurface.create(n,{theme:y});if(i){o.delete();return}l.current=o,o.xAxes.add(d.createCategoryXAxis(C,{labelColor:a.axisLabelColor,labels:u})),o.yAxes.add(d.createNumericYAxis(C,{labelColor:a.axisLabelColor,gridColor:a.gridColor,labelFormatter:d.labelFormatters.currency}));const F=[{yValues:r.map(e=>e.capex),name:"CapEx",color:t.capexColor},{yValues:r.map(e=>e.acquisitions),name:"Acquisitions",color:t.acquisitionsColor},{yValues:r.map(e=>e.dividends),name:"Dividends",color:t.dividendsColor},{yValues:r.map(e=>e.shareRepurchases),name:"Buybacks",color:t.buybacksColor}];h&&F.push({yValues:r.map(e=>e.debtRepayment??0),name:"Debt Repayment",color:t.debtColor}),o.renderableSeries.add(R.createStackedCollection(C,{xValues:D,groupId:"allocation",series:F})),q.addStandardModifiers(o,{crosshairColor:a.crosshairColor,valueFormatters:{CapEx:s.tooltipFormatters.currency,Acquisitions:s.tooltipFormatters.currency,Dividends:s.tooltipFormatters.currency,Buybacks:s.tooltipFormatters.currency,"Debt Repayment":s.tooltipFormatters.currency}}),m&&q.addLegendModifier(o),c==null||c(o)}catch(u){console.error("Failed to initialize CapitalAllocationChart:",u)}})(),()=>{i=!0,l.current&&(l.current.delete(),l.current=null)}},[r,n,y,a,t,m,h,c]),B.jsx("div",{ref:f,id:n,className:S,style:k})});exports.CapitalAllocationChart=w;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs10.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),h=require("react"),M=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),h=require("react"),M=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.cjs1329.js"),n=require("./petal-toolkit.cjs55.js"),k=require("./petal-toolkit.cjs1330.js"),q=require("./petal-toolkit.cjs1331.js"),y=require("./petal-toolkit.cjs58.js");function P(C){switch(C){case"light":return{equityColor:"#16a34a",liabilitiesColor:"#dc2626"};case"navy":return{equityColor:"#10b981",liabilitiesColor:"#f43f5e"};case"dark":default:return{equityColor:"#00FFB3",liabilitiesColor:"#FF4757"}}}const V=h.memo(function({data:r,width:F="100%",height:S=400,className:x,themePreset:d="dark",theme:g,showLegend:p=!0,onChartReady:o}){const{containerId:l,containerRef:f,surfaceRef:a,sciChartTheme:m,baseColors:i,containerStyle:v}=j.useFinancialChartSetup({chartName:"capital-structure",width:F,height:S,themePreset:d,customTheme:g}),c=P(d);return h.useEffect(()=>{if(!f.current||r.length===0)return;let b=!1;return(async()=>{try{const s=r.map(t=>t.period),A=r.map((t,E)=>E),{sciChartSurface:e,wasmContext:u}=await M.scichartExports.SciChartSurface.create(l,{theme:m});if(b){e.delete();return}a.current=e,e.xAxes.add(n.createCategoryXAxis(u,{labelColor:i.axisLabelColor,labels:s})),e.yAxes.add(n.createNumericYAxis(u,{labelColor:i.axisLabelColor,gridColor:i.gridColor,labelFormatter:n.labelFormatters.percent})),e.renderableSeries.add(k.createStackedCollection(u,{xValues:A,groupId:"capital",dataPointWidth:.7,series:[{yValues:r.map(t=>t.equityPercent),name:"Equity",color:c.equityColor},{yValues:r.map(t=>t.liabilitiesPercent),name:"Liabilities",color:c.liabilitiesColor}]})),q.addStandardModifiers(e,{crosshairColor:i.crosshairColor,valueFormatters:{Equity:y.tooltipFormatters.percent,Liabilities:y.tooltipFormatters.percent}}),p&&q.addLegendModifier(e),o==null||o(e)}catch(s){console.error("Failed to initialize CapitalStructureChart:",s)}})(),()=>{b=!0,a.current&&(a.current.delete(),a.current=null)}},[r,l,m,i,c,p,o]),L.jsx("div",{ref:f,id:l,className:x,style:v})});exports.CapitalStructureChart=V;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs11.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.cjs1357.js");var L;function e(){return L||(L=1,(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.PROPERTY=void 0,(function(O){O.MARKER_COLOR="MARKER_COLOR",O.SHOWS_ROLLOVER="SHOWS_ROLLOVER",O.TOOLTIP_COLOR="TOOLTIP_COLOR",O.TOOLTIP_DATA_TEMPLATE="TOOLTIP_DATA_TEMPLATE",O.TOOLTIP_TEXT_COLOR="TOOLTIP_TEXT_COLOR",O.TOOLTIP_TITLE="TOOLTIP_TITLE",O.TOOLTIP_SHADOW_COLOR="TOOLTIP_SHADOW_COLOR"})(T.PROPERTY||(T.PROPERTY={}))})(_.__exports)),_.__exports}exports.__require=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1123.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.cjs1355.js");var n;function u(){return n||(n=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTY=void 0,(function(e){e.IS_HIDDEN="IS_HIDDEN",e.X1="X1",e.X2="X2",e.Y1="Y1",e.Y2="Y2"})(t.PROPERTY||(t.PROPERTY={}))})(r.__exports)),r.__exports}exports.__require=u;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1125.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.cjs1354.js");var e;function A(){return e||(e=1,(function(E){Object.defineProperty(E,"__esModule",{value:!0}),E.PROPERTY=void 0,(function(L){L.COLOR="COLOR",L.COLOR_LINEAR_GRADIENT="COLOR_LINEAR_GRADIENT",L.DELTA="DELTA",L.IS_SELECTED="IS_SELECTED",L.PERCENTAGE="PERCENTAGE",L.TEXT="TEXT",L.VALUE="VALUE",L.SHIFT="SHIFT",L.LABEL_PROVIDER="LABEL_PROVIDER",L.LABEL_STYLE="LABEL_STYLE",L.LABEL_OFFSET="LABEL_OFFSET",L.RADIUS_ADJUSTMENT="RADIUS_ADJUSTMENT",L.SHOW_LABEL="SHOW_LABEL"})(E.PROPERTY||(E.PROPERTY={}))})(_.__exports)),_.__exports}exports.__require=A;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1128.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),x=require("react"),N=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),x=require("react"),N=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.cjs1329.js"),u=require("./petal-toolkit.cjs55.js"),C=require("./petal-toolkit.cjs1330.js"),S=require("./petal-toolkit.cjs1331.js"),y=require("./petal-toolkit.cjs58.js");function B(f){switch(f){case"light":return{netIncomeColor:"#3b82f6",ocfColor:"#16a34a",ratioColor:"#f97316",referenceColor:"#9ca3af"};case"navy":return{netIncomeColor:"#60a5fa",ocfColor:"#10b981",ratioColor:"#fb923c",referenceColor:"#64748b"};case"dark":default:return{netIncomeColor:"#3B82F6",ocfColor:"#00FFB3",ratioColor:"#FFA502",referenceColor:"#6B7280"}}}const O=x.memo(function({data:r,width:g="100%",height:v=400,className:q,themePreset:m="dark",theme:I,showLegend:d=!0,showRatioLine:w=!1,onChartReady:a}){const{containerId:s,containerRef:h,surfaceRef:n,sciChartTheme:F,baseColors:t,containerStyle:A}=j.useFinancialChartSetup({chartName:"cash-conversion",width:g,height:v,themePreset:m,customTheme:I}),c=B(m);return x.useEffect(()=>{if(!h.current||r.length===0)return;let b=!1;return(async()=>{try{const l=r.map(o=>o.period),p=r.map((o,L)=>L),{sciChartSurface:e,wasmContext:i}=await N.scichartExports.SciChartSurface.create(s,{theme:F});if(b){e.delete();return}n.current=e,e.xAxes.add(u.createCategoryXAxis(i,{labelColor:t.axisLabelColor,labels:l})),e.yAxes.add(u.createNumericYAxis(i,{labelColor:t.axisLabelColor,gridColor:t.gridColor,labelFormatter:u.labelFormatters.currency})),C.addReferenceLine(e,{y:0,color:c.referenceColor}),e.renderableSeries.add(C.createLineSeries(i,{xValues:p,yValues:r.map(o=>o.netIncome),name:"Net Income",color:c.netIncomeColor})),e.renderableSeries.add(C.createLineSeries(i,{xValues:p,yValues:r.map(o=>o.operatingCashFlow),name:"Operating Cash Flow",color:c.ocfColor})),S.addStandardModifiers(e,{crosshairColor:t.crosshairColor,valueFormatters:{"Net Income":y.tooltipFormatters.currency,"Operating Cash Flow":y.tooltipFormatters.currency}}),d&&S.addLegendModifier(e),a==null||a(e)}catch(l){console.error("Failed to initialize CashConversionChart:",l)}})(),()=>{b=!0,n.current&&(n.current.delete(),n.current=null)}},[r,s,F,t,c,d,w,a]),M.jsx("div",{ref:h,id:s,className:q,style:A})});exports.CashConversionChart=O;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs12.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),o=require("./petal-toolkit.cjs59.js"),X=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),b=require("react"),o=require("./petal-toolkit.cjs59.js"),X=require("./petal-toolkit.cjs1329.js"),F=require("./petal-toolkit.cjs55.js"),v=require("./petal-toolkit.cjs1331.js"),S=require("./petal-toolkit.cjs58.js");function j(f){switch(f){case"light":return{cashColor:"#16a34a",shortTermColor:"#3b82f6",longTermColor:"#8b5cf6"};case"navy":return{cashColor:"#10b981",shortTermColor:"#60a5fa",longTermColor:"#a78bfa"};case"dark":default:return{cashColor:"#00FFB3",shortTermColor:"#3B82F6",longTermColor:"#A78BFA"}}}const G=b.memo(function({data:t,width:I="100%",height:y=400,className:q,themePreset:T="dark",theme:E,showLegend:x=!0,onChartReady:l}){const{containerId:u,containerRef:p,surfaceRef:m,sciChartTheme:g,baseColors:n,containerStyle:w}=X.useFinancialChartSetup({chartName:"cash-investments",width:I,height:y,themePreset:T,customTheme:E}),a=j(T),k=t.some(i=>i.longTermInvestments!==void 0&&i.longTermInvestments>0);return b.useEffect(()=>{if(!p.current||t.length===0)return;let i=!1;return(async()=>{try{const h=t.map(e=>e.period),{sciChartSurface:s,wasmContext:r}=await o.scichartExports.SciChartSurface.create(u,{theme:g});if(i){s.delete();return}m.current=s;const A=F.createCategoryXAxis(r,{labelColor:n.axisLabelColor,labels:h});s.xAxes.add(A);const D=F.createNumericYAxis(r,{labelColor:n.axisLabelColor,gridColor:n.gridColor,labelFormatter:e=>e>=1e9?`$${(e/1e9).toFixed(1)}B`:e>=1e6?`$${(e/1e6).toFixed(0)}M`:`$${e.toFixed(0)}`});s.yAxes.add(D);const d=t.map((e,C)=>C),c=new o.scichartExports.StackedColumnCollection(r);c.dataPointWidth=.6;const $=new o.scichartExports.XyDataSeries(r,{xValues:d,yValues:t.map(e=>e.cash),dataSeriesName:"Cash & Equivalents"}),L=new o.scichartExports.StackedColumnRenderableSeries(r,{dataSeries:$,fill:a.cashColor,stroke:a.cashColor,strokeThickness:0,stackedGroupId:"liquid"});c.add(L);const M=new o.scichartExports.XyDataSeries(r,{xValues:d,yValues:t.map(e=>e.shortTermInvestments),dataSeriesName:"Short-Term Investments"}),N=new o.scichartExports.StackedColumnRenderableSeries(r,{dataSeries:M,fill:a.shortTermColor,stroke:a.shortTermColor,strokeThickness:0,stackedGroupId:"liquid"});if(c.add(N),k){const e=new o.scichartExports.XyDataSeries(r,{xValues:d,yValues:t.map(B=>B.longTermInvestments??0),dataSeriesName:"Long-Term Investments"}),C=new o.scichartExports.StackedColumnRenderableSeries(r,{dataSeries:e,fill:a.longTermColor,stroke:a.longTermColor,strokeThickness:0,stackedGroupId:"liquid"});c.add(C)}s.renderableSeries.add(c),v.addStandardModifiers(s,{crosshairColor:n.crosshairColor,valueFormatters:{"Cash & Equivalents":S.tooltipFormatters.currency,"Short-Term Investments":S.tooltipFormatters.currency,"Long-Term Investments":S.tooltipFormatters.currency}}),x&&v.addLegendModifier(s),l==null||l(s)}catch(h){console.error("Failed to initialize CashInvestmentsChart:",h)}})(),()=>{i=!0,m.current&&(m.current.delete(),m.current=null)}},[t,u,g,n,a,x,k,l]),V.jsx("div",{ref:p,id:u,className:q,style:w})});exports.CashInvestmentsChart=G;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs13.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t={};exports.__exports=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1320.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1320.js","sources":[
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1320.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1321.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1321.js","sources":[
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1321.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
2
|
-
<text x="100" y="${x}" font-size="10" font-family="${t.TOOLTIP_STYLE.fontFamily}" fill="${t.TOOLTIP_STYLE.textPrimary}">${O}</text>`}).join(""),w=E+M;return{width:L,height:S,content:w}})});i.chartModifiers.add(new e.scichartExports.ZoomPanModifier,new e.scichartExports.MouseWheelZoomModifier,new e.scichartExports.ZoomExtentsModifier,y)}function P(i,n={}){const{placement:s=e.scichartExports.ELegendPlacement.TopRight,orientation:a=e.scichartExports.ELegendOrientation.Horizontal,showCheckboxes:c=!1,showSeriesMarkers:o=!0}=n;i.chartModifiers.add(new e.scichartExports.LegendModifier({placement:s,orientation:a,showCheckboxes:c,showSeriesMarkers:o}))}exports.addLegendModifier=P;exports.addStandardModifiers=$;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
3
2
|
//# sourceMappingURL=petal-toolkit.cjs1322.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1322.js","sources":[
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1322.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t={};exports.__exports=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1325.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1327.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1328.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),h=require("./petal-toolkit.cjs60.js");function a(e){switch(e){case"light":return{gridColor:"rgba(0, 0, 0, 0.08)",axisLabelColor:"#6b7280",crosshairColor:"#3b82f6"};case"navy":return{gridColor:"rgba(255, 255, 255, 0.08)",axisLabelColor:"#64748b",crosshairColor:"#60a5fa"};case"dark":default:return{gridColor:"rgba(255, 255, 255, 0.06)",axisLabelColor:"#6B7280",crosshairColor:"#3B82F6"}}}function n(e="100%",r=400){return{width:typeof e=="number"?`${e}px`:e,height:typeof r=="number"?`${r}px`:r,position:"relative"}}function d({chartName:e,width:r="100%",height:s=400,themePreset:t="dark",customTheme:c}){const i=o.useId(),l=o.useRef(null),u=o.useRef(null),C=c??h.getThemeFromPreset(t),b=a(t),f=`${e}-${i}`,g=n(r,s);return{containerId:f,containerRef:l,surfaceRef:u,sciChartTheme:C,baseColors:b,containerStyle:g}}exports.getBaseThemeColors=a;exports.getContainerStyle=n;exports.useFinancialChartSetup=d;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1329.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1329.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1329.js","sources":["../src/charts/financials/shared/useFinancialChartSetup.ts"],"sourcesContent":["import { useRef, useId } from 'react';\nimport type { SciChartSurface, IThemeProvider } from 'scichart';\nimport { type SciChartThemePreset, getThemeFromPreset } from '@/scichart/themes';\nimport type { BaseThemeColors, FinancialChartSetup } from './types';\n\n/**\n * Get base theme colors that are shared across all financial charts\n */\nexport function getBaseThemeColors(preset: SciChartThemePreset): BaseThemeColors {\n switch (preset) {\n case 'light':\n return {\n gridColor: 'rgba(0, 0, 0, 0.08)',\n axisLabelColor: '#6b7280',\n crosshairColor: '#3b82f6',\n };\n case 'navy':\n return {\n gridColor: 'rgba(255, 255, 255, 0.08)',\n axisLabelColor: '#64748b',\n crosshairColor: '#60a5fa',\n };\n case 'dark':\n default:\n return {\n gridColor: 'rgba(255, 255, 255, 0.06)',\n axisLabelColor: '#6B7280',\n crosshairColor: '#3B82F6',\n };\n }\n}\n\n/**\n * Calculate container style from width/height props\n */\nexport function getContainerStyle(\n width: string | number = '100%',\n height: string | number = 400\n): React.CSSProperties {\n return {\n width: typeof width === 'number' ? `${width}px` : width,\n height: typeof height === 'number' ? `${height}px` : height,\n position: 'relative',\n };\n}\n\ninterface UseFinancialChartSetupOptions {\n /** Chart name prefix for container ID (e.g., 'margin-analysis') */\n chartName: string;\n /** Width prop */\n width?: string | number;\n /** Height prop */\n height?: string | number;\n /** Theme preset */\n themePreset?: SciChartThemePreset;\n /** Custom theme (overrides preset) */\n customTheme?: IThemeProvider;\n}\n\n/**\n * Hook that handles common financial chart setup:\n * - Container ref and ID generation\n * - Surface ref for cleanup\n * - Theme resolution\n * - Base theme colors\n * - Container style calculation\n */\nexport function useFinancialChartSetup({\n chartName,\n width = '100%',\n height = 400,\n themePreset = 'dark',\n customTheme,\n}: UseFinancialChartSetupOptions): FinancialChartSetup {\n const chartId = useId();\n const containerRef = useRef<HTMLDivElement>(null);\n const surfaceRef = useRef<SciChartSurface | null>(null);\n\n const sciChartTheme = customTheme ?? getThemeFromPreset(themePreset);\n const baseColors = getBaseThemeColors(themePreset);\n const containerId = `${chartName}-${chartId}`;\n const containerStyle = getContainerStyle(width, height);\n\n return {\n containerId,\n containerRef,\n surfaceRef,\n sciChartTheme,\n baseColors,\n containerStyle,\n };\n}\n"],"names":["getBaseThemeColors","preset","getContainerStyle","width","height","useFinancialChartSetup","chartName","themePreset","customTheme","chartId","useId","containerRef","useRef","surfaceRef","sciChartTheme","getThemeFromPreset","baseColors","containerId","containerStyle"],"mappings":"+IAQO,SAASA,EAAmBC,EAA8C,CAC/E,OAAQA,EAAA,CACN,IAAK,QACH,MAAO,CACL,UAAW,sBACX,eAAgB,UAChB,eAAgB,SAAA,EAEpB,IAAK,OACH,MAAO,CACL,UAAW,4BACX,eAAgB,UAChB,eAAgB,SAAA,EAEpB,IAAK,OACL,QACE,MAAO,CACL,UAAW,4BACX,eAAgB,UAChB,eAAgB,SAAA,CAClB,CAEN,CAKO,SAASC,EACdC,EAAyB,OACzBC,EAA0B,IACL,CACrB,MAAO,CACL,MAAO,OAAOD,GAAU,SAAW,GAAGA,CAAK,KAAOA,EAClD,OAAQ,OAAOC,GAAW,SAAW,GAAGA,CAAM,KAAOA,EACrD,SAAU,UAAA,CAEd,CAuBO,SAASC,EAAuB,CACrC,UAAAC,EACA,MAAAH,EAAQ,OACR,OAAAC,EAAS,IACT,YAAAG,EAAc,OACd,YAAAC,CACF,EAAuD,CACrD,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAeC,EAAAA,OAAuB,IAAI,EAC1CC,EAAaD,EAAAA,OAA+B,IAAI,EAEhDE,EAAgBN,GAAeO,EAAAA,mBAAmBR,CAAW,EAC7DS,EAAahB,EAAmBO,CAAW,EAC3CU,EAAc,GAAGX,CAAS,IAAIG,CAAO,GACrCS,EAAiBhB,EAAkBC,EAAOC,CAAM,EAEtD,MAAO,CACL,YAAAa,EACA,aAAAN,EACA,WAAAE,EACA,cAAAC,EACA,WAAAE,EACA,eAAAE,CAAA,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./petal-toolkit.cjs59.js");function u(e,i){const{xValues:n,yValues:c,name:a,color:r,strokeThickness:s=3,pointMarker:o={}}=i,{size:l=8,strokeColor:d="#FFFFFF",strokeThickness:k=2}=o,h=new t.scichartExports.XyDataSeries(e,{xValues:n,yValues:c,dataSeriesName:a});return new t.scichartExports.FastLineRenderableSeries(e,{dataSeries:h,stroke:r,strokeThickness:s,pointMarker:new t.scichartExports.EllipsePointMarker(e,{width:l,height:l,fill:r,stroke:d,strokeThickness:k})})}function S(e,i){const{xValues:n,yValues:c,name:a,color:r,dataPointWidth:s=.6,opacity:o=.8}=i,l=Math.round(o*255).toString(16).padStart(2,"0").toUpperCase(),d=new t.scichartExports.XyDataSeries(e,{xValues:n,yValues:c,dataSeriesName:a});return new t.scichartExports.FastColumnRenderableSeries(e,{dataSeries:d,fill:r+l,stroke:r,strokeThickness:0,dataPointWidth:s})}function p(e,i){const{xValues:n,series:c,groupId:a,dataPointWidth:r=.6}=i,s=new t.scichartExports.StackedColumnCollection(e);s.dataPointWidth=r;for(const o of c){const l=new t.scichartExports.XyDataSeries(e,{xValues:n,yValues:o.yValues,dataSeriesName:o.name}),d=new t.scichartExports.StackedColumnRenderableSeries(e,{dataSeries:l,fill:o.color,stroke:o.color,strokeThickness:0,stackedGroupId:a});s.add(d)}return s}function y(e,i){const{y:n,color:c,label:a,strokeThickness:r=1,dashed:s=!0}=i;e.annotations.add(new t.scichartExports.HorizontalLineAnnotation({y1:n,stroke:c,strokeThickness:r,strokeDashArray:s?[5,5]:void 0,annotationLayer:t.scichartExports.EAnnotationLayer.BelowChart,showLabel:!!a,labelValue:a}))}exports.addReferenceLine=y;exports.createBarSeries=S;exports.createLineSeries=u;exports.createStackedCollection=p;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1330.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1330.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1330.js","sources":["../src/charts/financials/shared/seriesFactory.ts"],"sourcesContent":["/**\n * Series Factory Functions\n *\n * Reusable factory functions for creating common SciChart series types.\n * These reduce boilerplate in financial chart components.\n */\n\nimport {\n XyDataSeries,\n FastLineRenderableSeries,\n FastColumnRenderableSeries,\n StackedColumnRenderableSeries,\n StackedColumnCollection,\n EllipsePointMarker,\n HorizontalLineAnnotation,\n EAnnotationLayer,\n type TSciChart,\n type SciChartSurface,\n} from 'scichart';\n\n/** Options for creating a line series */\nexport interface LineSeriesOptions {\n xValues: number[];\n yValues: number[];\n name: string;\n color: string;\n strokeThickness?: number;\n pointMarker?: {\n size?: number;\n strokeColor?: string;\n strokeThickness?: number;\n };\n}\n\n/** Options for creating a bar/column series */\nexport interface BarSeriesOptions {\n xValues: number[];\n yValues: number[];\n name: string;\n color: string;\n dataPointWidth?: number;\n opacity?: number; // 0-1, will be converted to hex\n}\n\n/** Options for creating a stacked series within a collection */\nexport interface StackedSeriesConfig {\n yValues: number[];\n name: string;\n color: string;\n}\n\n/** Options for creating a stacked column collection */\nexport interface StackedCollectionOptions {\n xValues: number[];\n series: StackedSeriesConfig[];\n groupId: string;\n dataPointWidth?: number;\n}\n\n/** Options for creating a horizontal reference line */\nexport interface ReferenceLineOptions {\n y: number;\n color: string;\n label?: string;\n strokeThickness?: number;\n dashed?: boolean;\n}\n\n/**\n * Create a line series with point markers\n */\nexport function createLineSeries(\n wasmContext: TSciChart,\n options: LineSeriesOptions\n): FastLineRenderableSeries {\n const {\n xValues,\n yValues,\n name,\n color,\n strokeThickness = 3,\n pointMarker = {},\n } = options;\n\n const {\n size = 8,\n strokeColor = '#FFFFFF',\n strokeThickness: markerStrokeThickness = 2,\n } = pointMarker;\n\n const dataSeries = new XyDataSeries(wasmContext, {\n xValues,\n yValues,\n dataSeriesName: name,\n });\n\n return new FastLineRenderableSeries(wasmContext, {\n dataSeries,\n stroke: color,\n strokeThickness,\n pointMarker: new EllipsePointMarker(wasmContext, {\n width: size,\n height: size,\n fill: color,\n stroke: strokeColor,\n strokeThickness: markerStrokeThickness,\n }),\n });\n}\n\n/**\n * Create a column/bar series\n */\nexport function createBarSeries(\n wasmContext: TSciChart,\n options: BarSeriesOptions\n): FastColumnRenderableSeries {\n const {\n xValues,\n yValues,\n name,\n color,\n dataPointWidth = 0.6,\n opacity = 0.8,\n } = options;\n\n // Convert opacity to hex (0.8 -> CC)\n const opacityHex = Math.round(opacity * 255).toString(16).padStart(2, '0').toUpperCase();\n\n const dataSeries = new XyDataSeries(wasmContext, {\n xValues,\n yValues,\n dataSeriesName: name,\n });\n\n return new FastColumnRenderableSeries(wasmContext, {\n dataSeries,\n fill: color + opacityHex,\n stroke: color,\n strokeThickness: 0,\n dataPointWidth,\n });\n}\n\n/**\n * Create a stacked column collection with multiple series\n */\nexport function createStackedCollection(\n wasmContext: TSciChart,\n options: StackedCollectionOptions\n): StackedColumnCollection {\n const { xValues, series, groupId, dataPointWidth = 0.6 } = options;\n\n const collection = new StackedColumnCollection(wasmContext);\n collection.dataPointWidth = dataPointWidth;\n\n for (const seriesConfig of series) {\n const dataSeries = new XyDataSeries(wasmContext, {\n xValues,\n yValues: seriesConfig.yValues,\n dataSeriesName: seriesConfig.name,\n });\n\n const stackedSeries = new StackedColumnRenderableSeries(wasmContext, {\n dataSeries,\n fill: seriesConfig.color,\n stroke: seriesConfig.color,\n strokeThickness: 0,\n stackedGroupId: groupId,\n });\n\n collection.add(stackedSeries);\n }\n\n return collection;\n}\n\n/**\n * Add a horizontal reference line annotation\n */\nexport function addReferenceLine(\n surface: SciChartSurface,\n options: ReferenceLineOptions\n): void {\n const {\n y,\n color,\n label,\n strokeThickness = 1,\n dashed = true,\n } = options;\n\n surface.annotations.add(\n new HorizontalLineAnnotation({\n y1: y,\n stroke: color,\n strokeThickness,\n strokeDashArray: dashed ? [5, 5] : undefined,\n annotationLayer: EAnnotationLayer.BelowChart,\n showLabel: !!label,\n labelValue: label,\n })\n );\n}\n"],"names":["createLineSeries","wasmContext","options","xValues","yValues","name","color","strokeThickness","pointMarker","size","strokeColor","markerStrokeThickness","dataSeries","XyDataSeries","FastLineRenderableSeries","EllipsePointMarker","createBarSeries","dataPointWidth","opacity","opacityHex","FastColumnRenderableSeries","createStackedCollection","series","groupId","collection","StackedColumnCollection","seriesConfig","stackedSeries","StackedColumnRenderableSeries","addReferenceLine","surface","y","label","dashed","HorizontalLineAnnotation","EAnnotationLayer"],"mappings":"4HAuEO,SAASA,EACdC,EACAC,EAC0B,CAC1B,KAAM,CACJ,QAAAC,EACA,QAAAC,EACA,KAAAC,EACA,MAAAC,EACA,gBAAAC,EAAkB,EAClB,YAAAC,EAAc,CAAA,CAAC,EACbN,EAEE,CACJ,KAAAO,EAAO,EACP,YAAAC,EAAc,UACd,gBAAiBC,EAAwB,CAAA,EACvCH,EAEEI,EAAa,IAAIC,EAAAA,gBAAAA,aAAaZ,EAAa,CAC/C,QAAAE,EACA,QAAAC,EACA,eAAgBC,CAAA,CACjB,EAED,OAAO,IAAIS,EAAAA,gBAAAA,yBAAyBb,EAAa,CAC/C,WAAAW,EACA,OAAQN,EACR,gBAAAC,EACA,YAAa,IAAIQ,EAAAA,gBAAAA,mBAAmBd,EAAa,CAC/C,MAAOQ,EACP,OAAQA,EACR,KAAMH,EACN,OAAQI,EACR,gBAAiBC,CAAA,CAClB,CAAA,CACF,CACH,CAKO,SAASK,EACdf,EACAC,EAC4B,CAC5B,KAAM,CACJ,QAAAC,EACA,QAAAC,EACA,KAAAC,EACA,MAAAC,EACA,eAAAW,EAAiB,GACjB,QAAAC,EAAU,EAAA,EACRhB,EAGEiB,EAAa,KAAK,MAAMD,EAAU,GAAG,EAAE,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,EAAE,YAAA,EAErEN,EAAa,IAAIC,EAAAA,gBAAAA,aAAaZ,EAAa,CAC/C,QAAAE,EACA,QAAAC,EACA,eAAgBC,CAAA,CACjB,EAED,OAAO,IAAIe,EAAAA,gBAAAA,2BAA2BnB,EAAa,CACjD,WAAAW,EACA,KAAMN,EAAQa,EACd,OAAQb,EACR,gBAAiB,EACjB,eAAAW,CAAA,CACD,CACH,CAKO,SAASI,EACdpB,EACAC,EACyB,CACzB,KAAM,CAAE,QAAAC,EAAS,OAAAmB,EAAQ,QAAAC,EAAS,eAAAN,EAAiB,IAAQf,EAErDsB,EAAa,IAAIC,EAAAA,gBAAAA,wBAAwBxB,CAAW,EAC1DuB,EAAW,eAAiBP,EAE5B,UAAWS,KAAgBJ,EAAQ,CACjC,MAAMV,EAAa,IAAIC,EAAAA,gBAAAA,aAAaZ,EAAa,CAC/C,QAAAE,EACA,QAASuB,EAAa,QACtB,eAAgBA,EAAa,IAAA,CAC9B,EAEKC,EAAgB,IAAIC,EAAAA,gBAAAA,8BAA8B3B,EAAa,CACnE,WAAAW,EACA,KAAMc,EAAa,MACnB,OAAQA,EAAa,MACrB,gBAAiB,EACjB,eAAgBH,CAAA,CACjB,EAEDC,EAAW,IAAIG,CAAa,CAC9B,CAEA,OAAOH,CACT,CAKO,SAASK,EACdC,EACA5B,EACM,CACN,KAAM,CACJ,EAAA6B,EACA,MAAAzB,EACA,MAAA0B,EACA,gBAAAzB,EAAkB,EAClB,OAAA0B,EAAS,EAAA,EACP/B,EAEJ4B,EAAQ,YAAY,IAClB,IAAII,2CAAyB,CAC3B,GAAIH,EACJ,OAAQzB,EACR,gBAAAC,EACA,gBAAiB0B,EAAS,CAAC,EAAG,CAAC,EAAI,OACnC,gBAAiBE,EAAAA,gBAAAA,iBAAiB,WAClC,UAAW,CAAC,CAACH,EACb,WAAYA,CAAA,CACb,CAAA,CAEL"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.cjs59.js"),t=require("./petal-toolkit.cjs54.js");function $(i,n){const{crosshairColor:s,showTooltip:a=!0,showAxisLabels:c=!0,valueFormatters:o}=n,y=new e.scichartExports.CursorModifier({showTooltip:a,showAxisLabels:c,crosshairStroke:s,tooltipSvgTemplate:t.createCursorTooltip(r=>{if(r.length===0)return{width:0,height:0,content:""};const L=180,l=30,f=20,S=l+r.length*f,g=r[0],p=new Date((g.xValue??0)*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),E=`<text x="12" y="20" font-size="11" font-weight="600" font-family="${t.TOOLTIP_STYLE.fontFamily}" fill="${t.TOOLTIP_STYLE.textPrimary}">${p}</text>`,M=r.map((d,h)=>{var u;const x=l+h*f+10,T=d.seriesName||`Series ${h+1}`,m=o==null?void 0:o[T],O=m?m(d.yValue??0):`${((u=d.yValue)==null?void 0:u.toFixed(2))??"-"}`;return`<text x="12" y="${x}" font-size="10" font-family="${t.TOOLTIP_STYLE.fontFamily}" fill="${t.TOOLTIP_STYLE.textSecondary}">${T}:</text>
|
|
2
|
+
<text x="100" y="${x}" font-size="10" font-family="${t.TOOLTIP_STYLE.fontFamily}" fill="${t.TOOLTIP_STYLE.textPrimary}">${O}</text>`}).join(""),w=E+M;return{width:L,height:S,content:w}})});i.chartModifiers.add(new e.scichartExports.ZoomPanModifier,new e.scichartExports.MouseWheelZoomModifier,new e.scichartExports.ZoomExtentsModifier,y)}function P(i,n={}){const{placement:s=e.scichartExports.ELegendPlacement.TopRight,orientation:a=e.scichartExports.ELegendOrientation.Horizontal,showCheckboxes:c=!1,showSeriesMarkers:o=!0}=n;i.chartModifiers.add(new e.scichartExports.LegendModifier({placement:s,orientation:a,showCheckboxes:c,showSeriesMarkers:o}))}exports.addLegendModifier=P;exports.addStandardModifiers=$;
|
|
2
3
|
//# sourceMappingURL=petal-toolkit.cjs1331.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1331.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1331.js","sources":["../src/charts/financials/shared/chartModifiers.ts"],"sourcesContent":["import {\n SciChartSurface,\n ZoomPanModifier,\n MouseWheelZoomModifier,\n ZoomExtentsModifier,\n CursorModifier,\n LegendModifier,\n ELegendPlacement,\n ELegendOrientation,\n} from 'scichart';\nimport { createCursorTooltip, TOOLTIP_STYLE } from '@/scichart/modifiers/tooltipTemplates';\n\ninterface StandardModifiersOptions {\n /** Crosshair/cursor stroke color */\n crosshairColor: string;\n /** Whether to show tooltips on cursor (default: true) */\n showTooltip?: boolean;\n /** Whether to show axis labels on cursor (default: true) */\n showAxisLabels?: boolean;\n /** Formatter functions per series (by series name) */\n valueFormatters?: {\n [seriesName: string]: (value: number) => string;\n };\n}\n\n/**\n * Add standard chart modifiers: ZoomPan, MouseWheelZoom, ZoomExtents, Cursor with styled tooltip\n */\nexport function addStandardModifiers(\n surface: SciChartSurface,\n options: StandardModifiersOptions\n): void {\n const { crosshairColor, showTooltip = true, showAxisLabels = true, valueFormatters } = options;\n\n const cursorModifier = new CursorModifier({\n showTooltip,\n showAxisLabels,\n crosshairStroke: crosshairColor,\n tooltipSvgTemplate: createCursorTooltip((seriesInfos) => {\n // Default multi-series tooltip formatting with dark background\n if (seriesInfos.length === 0) {\n return { width: 0, height: 0, content: '' };\n }\n\n const width = 180;\n const baseHeight = 30;\n const rowHeight = 20;\n const height = baseHeight + (seriesInfos.length * rowHeight);\n\n // Date from first series\n const firstInfo = seriesInfos[0];\n const date = new Date((firstInfo.xValue ?? 0) * 1000);\n const dateStr = date.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n });\n\n const dateContent = `<text x=\"12\" y=\"20\" font-size=\"11\" font-weight=\"600\" font-family=\"${TOOLTIP_STYLE.fontFamily}\" fill=\"${TOOLTIP_STYLE.textPrimary}\">${dateStr}</text>`;\n\n const seriesContent = seriesInfos.map((info, i) => {\n const yPos = baseHeight + (i * rowHeight) + 10;\n const seriesName = info.seriesName || `Series ${i + 1}`;\n\n // Apply formatter if provided, otherwise use default\n const formatter = valueFormatters?.[seriesName];\n const value = formatter\n ? formatter(info.yValue ?? 0)\n : `${info.yValue?.toFixed(2) ?? '-'}`;\n\n return `<text x=\"12\" y=\"${yPos}\" font-size=\"10\" font-family=\"${TOOLTIP_STYLE.fontFamily}\" fill=\"${TOOLTIP_STYLE.textSecondary}\">${seriesName}:</text>\n <text x=\"100\" y=\"${yPos}\" font-size=\"10\" font-family=\"${TOOLTIP_STYLE.fontFamily}\" fill=\"${TOOLTIP_STYLE.textPrimary}\">${value}</text>`;\n }).join('');\n\n const content = dateContent + seriesContent;\n\n return { width, height, content };\n }),\n });\n\n surface.chartModifiers.add(\n new ZoomPanModifier(),\n new MouseWheelZoomModifier(),\n new ZoomExtentsModifier(),\n cursorModifier\n );\n}\n\ninterface LegendModifierOptions {\n /** Placement of the legend (default: TopRight). Use ELegendPlacement enum values. */\n placement?: ELegendPlacement | number;\n /** Orientation of the legend (default: Horizontal). Use ELegendOrientation enum values. */\n orientation?: ELegendOrientation | number;\n /** Show checkboxes for toggling series (default: false) */\n showCheckboxes?: boolean;\n /** Show series markers in legend (default: true) */\n showSeriesMarkers?: boolean;\n}\n\n/**\n * Add a legend modifier to the chart\n */\nexport function addLegendModifier(\n surface: SciChartSurface,\n options: LegendModifierOptions = {}\n): void {\n const {\n placement = ELegendPlacement.TopRight,\n orientation = ELegendOrientation.Horizontal,\n showCheckboxes = false,\n showSeriesMarkers = true,\n } = options;\n\n surface.chartModifiers.add(\n new LegendModifier({\n placement: placement as ELegendPlacement,\n orientation: orientation as ELegendOrientation,\n showCheckboxes,\n showSeriesMarkers,\n })\n );\n}\n\n/**\n * Add both standard modifiers and legend in one call\n */\nexport function addStandardModifiersWithLegend(\n surface: SciChartSurface,\n options: StandardModifiersOptions & { legendOptions?: LegendModifierOptions }\n): void {\n addStandardModifiers(surface, options);\n addLegendModifier(surface, options.legendOptions);\n}\n"],"names":["addStandardModifiers","surface","options","crosshairColor","showTooltip","showAxisLabels","valueFormatters","cursorModifier","CursorModifier","createCursorTooltip","seriesInfos","width","baseHeight","rowHeight","height","firstInfo","dateStr","dateContent","TOOLTIP_STYLE","seriesContent","info","i","yPos","seriesName","formatter","value","_a","content","ZoomPanModifier","MouseWheelZoomModifier","ZoomExtentsModifier","addLegendModifier","placement","ELegendPlacement","orientation","ELegendOrientation","showCheckboxes","showSeriesMarkers","LegendModifier"],"mappings":"kKA4BO,SAASA,EACdC,EACAC,EACM,CACN,KAAM,CAAE,eAAAC,EAAgB,YAAAC,EAAc,GAAM,eAAAC,EAAiB,GAAM,gBAAAC,GAAoBJ,EAEjFK,EAAiB,IAAIC,iCAAe,CACxC,YAAAJ,EACA,eAAAC,EACA,gBAAiBF,EACjB,mBAAoBM,EAAAA,oBAAqBC,GAAgB,CAEvD,GAAIA,EAAY,SAAW,EACzB,MAAO,CAAE,MAAO,EAAG,OAAQ,EAAG,QAAS,EAAA,EAGzC,MAAMC,EAAQ,IACRC,EAAa,GACbC,EAAY,GACZC,EAASF,EAAcF,EAAY,OAASG,EAG5CE,EAAYL,EAAY,CAAC,EAEzBM,EADO,IAAI,MAAMD,EAAU,QAAU,GAAK,GAAI,EAC/B,mBAAmB,QAAS,CAC/C,MAAO,QACP,IAAK,UACL,KAAM,SAAA,CACP,EAEKE,EAAc,qEAAqEC,EAAAA,cAAc,UAAU,WAAWA,EAAAA,cAAc,WAAW,KAAKF,CAAO,UAE3JG,EAAgBT,EAAY,IAAI,CAACU,EAAMC,IAAM,OACjD,MAAMC,EAAOV,EAAcS,EAAIR,EAAa,GACtCU,EAAaH,EAAK,YAAc,UAAUC,EAAI,CAAC,GAG/CG,EAAYlB,GAAA,YAAAA,EAAkBiB,GAC9BE,EAAQD,EACVA,EAAUJ,EAAK,QAAU,CAAC,EAC1B,KAAGM,EAAAN,EAAK,SAAL,YAAAM,EAAa,QAAQ,KAAM,GAAG,GAErC,MAAO,mBAAmBJ,CAAI,iCAAiCJ,EAAAA,cAAc,UAAU,WAAWA,EAAAA,cAAc,aAAa,KAAKK,CAAU;AAAA,mCACjHD,CAAI,iCAAiCJ,EAAAA,cAAc,UAAU,WAAWA,EAAAA,cAAc,WAAW,KAAKO,CAAK,SACxI,CAAC,EAAE,KAAK,EAAE,EAEJE,EAAUV,EAAcE,EAE9B,MAAO,CAAE,MAAAR,EAAO,OAAAG,EAAQ,QAAAa,CAAA,CAC1B,CAAC,CAAA,CACF,EAED1B,EAAQ,eAAe,IACrB,IAAI2B,kCACJ,IAAIC,yCACJ,IAAIC,sCACJvB,CAAA,CAEJ,CAgBO,SAASwB,EACd9B,EACAC,EAAiC,GAC3B,CACN,KAAM,CACJ,UAAA8B,EAAYC,EAAAA,gBAAAA,iBAAiB,SAC7B,YAAAC,EAAcC,EAAAA,gBAAAA,mBAAmB,WACjC,eAAAC,EAAiB,GACjB,kBAAAC,EAAoB,EAAA,EAClBnC,EAEJD,EAAQ,eAAe,IACrB,IAAIqC,iCAAe,CACjB,UAAAN,EACA,YAAAE,EACA,eAAAE,EACA,kBAAAC,CAAA,CACD,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(e){return typeof e=="number"?e>1e12?Math.floor(e/1e3):e:Math.floor(e.getTime()/1e3)}function i(e){return e>1e12?new Date(e):new Date(e*1e3)}function c(e,r){const n=i(e);if(r){const[o,u]=r,t=(u-o)/3600;if(t<1)return n.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit"});if(t<24)return n.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});if(t<168)return n.toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}return n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}exports.formatAxisLabel=c;exports.fromUnixTimestamp=i;exports.toUnixTimestamp=m;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1332.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1332.js","sources":["../src/utils/
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1332.js","sources":["../src/utils/dateUtils.ts"],"sourcesContent":["/**\n * Shared Date Utilities\n *\n * Common date utilities used across charts.\n * Import from here instead of duplicating in each component.\n */\n\n/**\n * Convert a Date object or millisecond timestamp to Unix timestamp (seconds)\n *\n * SciChart uses Unix timestamps (seconds since epoch) for date axes.\n * This handles both Date objects and millisecond timestamps.\n *\n * @example\n * toUnixTimestamp(new Date('2024-01-15')) // 1705276800\n * toUnixTimestamp(1705276800000) // 1705276800 (already in ms, converts to seconds)\n * toUnixTimestamp(1705276800) // 1705276800 (already in seconds, returns as-is)\n */\nexport function toUnixTimestamp(date: Date | number): number {\n if (typeof date === 'number') {\n // If it's already a Unix timestamp (seconds), return as-is\n // If it's a millisecond timestamp (> year 2001 in seconds), convert\n if (date > 1_000_000_000_000) {\n return Math.floor(date / 1000);\n }\n return date;\n }\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Convert Unix timestamp (seconds) back to Date object\n *\n * @example\n * fromUnixTimestamp(1705276800) // Date('2024-01-15')\n */\nexport function fromUnixTimestamp(timestamp: number): Date {\n // Handle both seconds and milliseconds\n if (timestamp > 1_000_000_000_000) {\n return new Date(timestamp);\n }\n return new Date(timestamp * 1000);\n}\n\n/**\n * Format a date for display on chart axes\n *\n * @example\n * formatChartDate(new Date('2024-01-15')) // 'Jan 15'\n */\nexport function formatChartDate(date: Date | number): string {\n const d = typeof date === 'number' ? fromUnixTimestamp(date) : date;\n return d.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n });\n}\n\n/**\n * Format a date with full precision\n *\n * @example\n * formatChartDateFull(new Date('2024-01-15')) // 'Jan 15, 2024'\n */\nexport function formatChartDateFull(date: Date | number): string {\n const d = typeof date === 'number' ? fromUnixTimestamp(date) : date;\n return d.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\n/**\n * Format a date with time\n *\n * @example\n * formatChartDateTime(new Date('2024-01-15T14:30:00')) // 'Jan 15, 2:30 PM'\n */\nexport function formatChartDateTime(date: Date | number): string {\n const d = typeof date === 'number' ? fromUnixTimestamp(date) : date;\n return d.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n });\n}\n\n/**\n * Get the start of a day (midnight) for a given date\n */\nexport function startOfDay(date: Date): Date {\n const d = new Date(date);\n d.setHours(0, 0, 0, 0);\n return d;\n}\n\n/**\n * Get the end of a day (23:59:59.999) for a given date\n */\nexport function endOfDay(date: Date): Date {\n const d = new Date(date);\n d.setHours(23, 59, 59, 999);\n return d;\n}\n\n/**\n * Smart format for chart axis labels - auto-detects granularity from data range\n *\n * Determines the appropriate format based on the time span of the data:\n * - Sub-hour range: show time with seconds (e.g., \"2:30:45 PM\")\n * - 1-24 hours: show time only (e.g., \"2:30 PM\")\n * - 1-7 days: show date + time (e.g., \"Jan 15, 2:30 PM\")\n * - > 7 days: show date only (e.g., \"Jan 15\")\n *\n * @param timestamp - Unix timestamp (seconds)\n * @param dataRange - Optional: [minTimestamp, maxTimestamp] to help detect granularity\n *\n * @example\n * // With daily data range\n * formatAxisLabel(1705276800, [1704672000, 1705881600]) // \"Jan 15\"\n *\n * // With intraday range (few hours)\n * formatAxisLabel(1705276800, [1705273200, 1705284000]) // \"2:30 PM\"\n *\n * // With sub-hour range (seconds precision)\n * formatAxisLabel(1705276845, [1705276800, 1705278000]) // \"2:30:45 PM\"\n */\nexport function formatAxisLabel(timestamp: number, dataRange?: [number, number]): string {\n const d = fromUnixTimestamp(timestamp);\n\n // If we have a data range, use it to detect granularity\n if (dataRange) {\n const [min, max] = dataRange;\n const rangeSeconds = max - min;\n const rangeHours = rangeSeconds / 3600;\n\n if (rangeHours < 1) {\n // Sub-hour range: show time with seconds\n return d.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit',\n });\n } else if (rangeHours < 24) {\n // Intraday: show time only\n return d.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n });\n } else if (rangeHours < 24 * 7) {\n // Multi-day but < 1 week: show date + time\n return d.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n });\n }\n }\n\n // Default: date only (for daily+ data or when range unknown)\n return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });\n}\n"],"names":["toUnixTimestamp","date","fromUnixTimestamp","timestamp","formatAxisLabel","dataRange","d","min","max","rangeHours"],"mappings":"gFAkBO,SAASA,EAAgBC,EAA6B,CAC3D,OAAI,OAAOA,GAAS,SAGdA,EAAO,KACF,KAAK,MAAMA,EAAO,GAAI,EAExBA,EAEF,KAAK,MAAMA,EAAK,QAAA,EAAY,GAAI,CACzC,CAQO,SAASC,EAAkBC,EAAyB,CAEzD,OAAIA,EAAY,KACP,IAAI,KAAKA,CAAS,EAEpB,IAAI,KAAKA,EAAY,GAAI,CAClC,CAuFO,SAASC,EAAgBD,EAAmBE,EAAsC,CACvF,MAAMC,EAAIJ,EAAkBC,CAAS,EAGrC,GAAIE,EAAW,CACb,KAAM,CAACE,EAAKC,CAAG,EAAIH,EAEbI,GADeD,EAAMD,GACO,KAElC,GAAIE,EAAa,EAEf,OAAOH,EAAE,mBAAmB,QAAS,CACnC,KAAM,UACN,OAAQ,UACR,OAAQ,SAAA,CACT,EACH,GAAWG,EAAa,GAEtB,OAAOH,EAAE,mBAAmB,QAAS,CACnC,KAAM,UACN,OAAQ,SAAA,CACT,EACH,GAAWG,EAAa,IAEtB,OAAOH,EAAE,mBAAmB,QAAS,CACnC,MAAO,QACP,IAAK,UACL,KAAM,UACN,OAAQ,SAAA,CACT,CAEL,CAGA,OAAOA,EAAE,mBAAmB,QAAS,CAAE,MAAO,QAAS,IAAK,UAAW,CACzE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1333.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1333.js","sources":[
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1333.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=t=>{const r=Math.abs(t),e=t<0?"-":t>0?"+":"";return r>=1e9?`${e}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${e}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${e}$${(r/1e3).toFixed(1)}K`:`${e}$${r.toFixed(2)}`},i=t=>(t>=0?"+":"")+new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Math.abs(t)),c=t=>`${t>=0?"+":""}${t.toFixed(2)}%`,s=t=>{if(t===0)return 0;const r=Math.abs(t),e=Math.pow(10,Math.floor(Math.log10(r))),n=Math.ceil(r/e)*e;return t<0?-n:n};exports.formatCurrency=o;exports.formatCurrencyFull=i;exports.formatPercent=c;exports.roundToNice=s;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1334.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"petal-toolkit.cjs1334.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"petal-toolkit.cjs1334.js","sources":["../src/utils/formatters.ts"],"sourcesContent":["/**\n * Shared Formatting Utilities\n *\n * Common number/currency/percent formatters used across charts.\n * Import from here instead of duplicating in each component.\n */\n\n/**\n * Format currency value with abbreviated suffixes (K, M, B)\n * Includes sign prefix for gains/losses\n *\n * @example\n * formatCurrency(1234567) // '+$1.23M'\n * formatCurrency(-5000) // '-$5.0K'\n * formatCurrency(50) // '+$50.00'\n */\nexport const formatCurrency = (val: number): string => {\n const absValue = Math.abs(val);\n const sign = val < 0 ? '-' : val > 0 ? '+' : '';\n\n if (absValue >= 1_000_000_000) {\n return `${sign}$${(absValue / 1_000_000_000).toFixed(2)}B`;\n }\n if (absValue >= 1_000_000) {\n return `${sign}$${(absValue / 1_000_000).toFixed(2)}M`;\n }\n if (absValue >= 1_000) {\n return `${sign}$${(absValue / 1_000).toFixed(1)}K`;\n }\n return `${sign}$${absValue.toFixed(2)}`;\n};\n\n/**\n * Format currency value without sign prefix\n * Uses abbreviated suffixes (K, M, B)\n *\n * @example\n * formatCurrencyNoSign(1234567) // '$1.23M'\n * formatCurrencyNoSign(-5000) // '-$5.0K'\n */\nexport const formatCurrencyNoSign = (val: number): string => {\n const absValue = Math.abs(val);\n const sign = val < 0 ? '-' : '';\n\n if (absValue >= 1_000_000_000) {\n return `${sign}$${(absValue / 1_000_000_000).toFixed(2)}B`;\n }\n if (absValue >= 1_000_000) {\n return `${sign}$${(absValue / 1_000_000).toFixed(2)}M`;\n }\n if (absValue >= 1_000) {\n return `${sign}$${(absValue / 1_000).toFixed(1)}K`;\n }\n return `${sign}$${absValue.toFixed(2)}`;\n};\n\n/**\n * Format currency with full precision using Intl.NumberFormat\n * Includes sign prefix for gains/losses\n *\n * @example\n * formatCurrencyFull(1234.56) // '+$1,234.56'\n * formatCurrencyFull(-567.89) // '-$567.89'\n */\nexport const formatCurrencyFull = (val: number): string => {\n const sign = val >= 0 ? '+' : '';\n return sign + new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n }).format(Math.abs(val));\n};\n\n/**\n * Format currency with full precision, no sign prefix\n *\n * @example\n * formatCurrencyFullNoSign(1234.56) // '$1,234.56'\n * formatCurrencyFullNoSign(-567.89) // '-$567.89'\n */\nexport const formatCurrencyFullNoSign = (val: number): string => {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n }).format(val);\n};\n\n/**\n * Format percentage with sign prefix\n *\n * @example\n * formatPercent(12.34) // '+12.34%'\n * formatPercent(-5.67) // '-5.67%'\n */\nexport const formatPercent = (val: number): string => {\n const sign = val >= 0 ? '+' : '';\n return `${sign}${val.toFixed(2)}%`;\n};\n\n/**\n * Format percentage without sign prefix\n *\n * @example\n * formatPercentNoSign(12.34) // '12.34%'\n * formatPercentNoSign(-5.67) // '-5.67%'\n */\nexport const formatPercentNoSign = (val: number): string => {\n return `${val.toFixed(2)}%`;\n};\n\n/**\n * Format volume with abbreviated suffixes (K, M, B)\n *\n * @example\n * formatVolume(1500000) // '1.50M'\n * formatVolume(75000) // '75.0K'\n * formatVolume(500) // '500'\n */\nexport const formatVolume = (val: number): string => {\n const absValue = Math.abs(val);\n\n if (absValue >= 1_000_000_000) {\n return `${(val / 1_000_000_000).toFixed(2)}B`;\n }\n if (absValue >= 1_000_000) {\n return `${(val / 1_000_000).toFixed(2)}M`;\n }\n if (absValue >= 1_000) {\n return `${(val / 1_000).toFixed(1)}K`;\n }\n return val.toFixed(0);\n};\n\n/**\n * Format number with abbreviated suffixes (K, M, B)\n * Generic version without currency symbol\n *\n * @example\n * formatNumber(1234567) // '1.23M'\n * formatNumber(5000) // '5.0K'\n */\nexport const formatNumber = (val: number): string => {\n const absValue = Math.abs(val);\n const sign = val < 0 ? '-' : '';\n\n if (absValue >= 1_000_000_000) {\n return `${sign}${(absValue / 1_000_000_000).toFixed(2)}B`;\n }\n if (absValue >= 1_000_000) {\n return `${sign}${(absValue / 1_000_000).toFixed(2)}M`;\n }\n if (absValue >= 1_000) {\n return `${sign}${(absValue / 1_000).toFixed(1)}K`;\n }\n return `${sign}${absValue.toFixed(2)}`;\n};\n\n/**\n * Format number with full precision using Intl.NumberFormat\n *\n * @example\n * formatNumberFull(1234567) // '1,234,567'\n */\nexport const formatNumberFull = (val: number, decimals: number = 0): string => {\n return new Intl.NumberFormat('en-US', {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(val);\n};\n\n/**\n * Round to a \"nice\" number for display (caps, axis ranges, etc)\n *\n * @example\n * roundToNice(123) // 200\n * roundToNice(4567) // 5000\n */\nexport const roundToNice = (value: number): number => {\n if (value === 0) return 0;\n const absValue = Math.abs(value);\n const magnitude = Math.pow(10, Math.floor(Math.log10(absValue)));\n const rounded = Math.ceil(absValue / magnitude) * magnitude;\n return value < 0 ? -rounded : rounded;\n};"],"names":["formatCurrency","val","absValue","sign","formatCurrencyFull","formatPercent","roundToNice","value","magnitude","rounded"],"mappings":"gFAgBO,MAAMA,EAAkBC,GAAwB,CACrD,MAAMC,EAAW,KAAK,IAAID,CAAG,EACvBE,EAAOF,EAAM,EAAI,IAAMA,EAAM,EAAI,IAAM,GAE7C,OAAIC,GAAY,IACP,GAAGC,CAAI,KAAKD,EAAW,KAAe,QAAQ,CAAC,CAAC,IAErDA,GAAY,IACP,GAAGC,CAAI,KAAKD,EAAW,KAAW,QAAQ,CAAC,CAAC,IAEjDA,GAAY,IACP,GAAGC,CAAI,KAAKD,EAAW,KAAO,QAAQ,CAAC,CAAC,IAE1C,GAAGC,CAAI,IAAID,EAAS,QAAQ,CAAC,CAAC,EACvC,EAkCaE,EAAsBH,IACpBA,GAAO,EAAI,IAAM,IAChB,IAAI,KAAK,aAAa,QAAS,CAC3C,MAAO,WACP,SAAU,MACV,sBAAuB,EACvB,sBAAuB,CAAA,CACxB,EAAE,OAAO,KAAK,IAAIA,CAAG,CAAC,EA0BZI,EAAiBJ,GAErB,GADMA,GAAO,EAAI,IAAM,EAChB,GAAGA,EAAI,QAAQ,CAAC,CAAC,IAiFpBK,EAAeC,GAA0B,CACpD,GAAIA,IAAU,EAAG,MAAO,GACxB,MAAML,EAAW,KAAK,IAAIK,CAAK,EACzBC,EAAY,KAAK,IAAI,GAAI,KAAK,MAAM,KAAK,MAAMN,CAAQ,CAAC,CAAC,EACzDO,EAAU,KAAK,KAAKP,EAAWM,CAAS,EAAIA,EAClD,OAAOD,EAAQ,EAAI,CAACE,EAAUA,CAChC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1335.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1346.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1347.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t={};exports.__exports=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs1348.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),k=require("react"),m=require("./petal-toolkit.cjs59.js"),V=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),k=require("react"),m=require("./petal-toolkit.cjs59.js"),V=require("./petal-toolkit.cjs1329.js"),q=require("./petal-toolkit.cjs55.js"),A=require("./petal-toolkit.cjs1331.js"),t=require("./petal-toolkit.cjs58.js");function D(h){switch(h){case"light":return{cogsColor:"#ef4444",opexColor:"#f97316",interestColor:"#eab308",taxesColor:"#84cc16",netIncomeColor:"#22c55e"};case"navy":return{cogsColor:"#f43f5e",opexColor:"#fb923c",interestColor:"#fbbf24",taxesColor:"#a3e635",netIncomeColor:"#10b981"};case"dark":default:return{cogsColor:"#FF4757",opexColor:"#FFA502",interestColor:"#FFEAA7",taxesColor:"#A3CB38",netIncomeColor:"#00FFB3"}}}const L=k.memo(function({data:r,width:O="100%",height:$=400,className:N,themePreset:g="dark",theme:T,showLegend:b=!0,showAsPercentage:C=!1,onChartReady:p}){const{containerId:d,containerRef:E,surfaceRef:x,sciChartTheme:y,baseColors:c,containerStyle:M}=V.useFinancialChartSetup({chartName:"cost-structure",width:O,height:$,themePreset:g,customTheme:T}),n=D(g);return k.useEffect(()=>{if(!E.current||r.length===0)return;let I=!1;return(async()=>{try{const f=r.map(e=>e.period),{sciChartSurface:o,wasmContext:i}=await m.scichartExports.SciChartSurface.create(d,{theme:y});if(I){o.delete();return}x.current=o;const B=q.createCategoryXAxis(i,{labelColor:c.axisLabelColor,labels:f});o.xAxes.add(B);const G=q.createNumericYAxis(i,{labelColor:c.axisLabelColor,gridColor:c.gridColor,growBy:[0,.1],labelFormatter:C?e=>`${e.toFixed(0)}%`:e=>e>=1e9?`$${(e/1e9).toFixed(1)}B`:e>=1e6?`$${(e/1e6).toFixed(0)}M`:`$${e.toFixed(0)}`});o.yAxes.add(G);const s=new m.scichartExports.StackedColumnCollection(i);s.dataPointWidth=.6;const a=(e,F,u)=>{const S=new m.scichartExports.XyDataSeries(i,{xValues:r.map((v,j)=>j),yValues:e,dataSeriesName:F});return new m.scichartExports.StackedColumnRenderableSeries(i,{dataSeries:S,fill:u,stroke:u,strokeThickness:0,stackedGroupId:"costs"})},l=(e,F)=>{const u=e[F];if(C){const S=e.cogs+e.operatingExpenses+e.interestExpense+e.taxes+e.netIncome;return u/S*100}return u};s.add(a(r.map(e=>l(e,"cogs")),"COGS",n.cogsColor)),s.add(a(r.map(e=>l(e,"operatingExpenses")),"Operating Expenses",n.opexColor)),s.add(a(r.map(e=>l(e,"interestExpense")),"Interest Expense",n.interestColor)),s.add(a(r.map(e=>l(e,"taxes")),"Taxes",n.taxesColor)),s.add(a(r.map(e=>l(e,"netIncome")),"Net Income",n.netIncomeColor)),o.renderableSeries.add(s),A.addStandardModifiers(o,{crosshairColor:c.crosshairColor,valueFormatters:C?{COGS:t.tooltipFormatters.percent,"Operating Expenses":t.tooltipFormatters.percent,"Interest Expense":t.tooltipFormatters.percent,Taxes:t.tooltipFormatters.percent,"Net Income":t.tooltipFormatters.percent}:{COGS:t.tooltipFormatters.currency,"Operating Expenses":t.tooltipFormatters.currency,"Interest Expense":t.tooltipFormatters.currency,Taxes:t.tooltipFormatters.currency,"Net Income":t.tooltipFormatters.currency}}),b&&A.addLegendModifier(o),p==null||p(o)}catch(f){console.error("Failed to initialize CostStructureChart:",f)}})(),()=>{I=!0,x.current&&(x.current.delete(),x.current=null)}},[r,d,y,c,n,b,C,p]),w.jsx("div",{ref:E,id:d,className:N,style:M})});exports.CostStructureChart=L;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs14.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),q=require("react"),e=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react/jsx-runtime"),q=require("react"),e=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.cjs1329.js"),y=require("./petal-toolkit.cjs55.js"),E=require("./petal-toolkit.cjs1331.js"),w=require("./petal-toolkit.cjs58.js");function X(d){switch(d){case"light":return{currentColor:"#16a34a",quickColor:"#3b82f6",referenceColor:"#9ca3af"};case"navy":return{currentColor:"#10b981",quickColor:"#60a5fa",referenceColor:"#64748b"};case"dark":default:return{currentColor:"#00FFB3",quickColor:"#3B82F6",referenceColor:"#6B7280"}}}const z=q.memo(function({data:i,width:g="100%",height:R=400,className:A,themePreset:k="dark",theme:M,showLegend:f=!0,showQuickRatio:p=!0,showReferenceLine:F=!0,onChartReady:n}){const{containerId:u,containerRef:x,surfaceRef:c,sciChartTheme:m,baseColors:s,containerStyle:L}=j.useFinancialChartSetup({chartName:"current-ratio",width:g,height:R,themePreset:k,customTheme:M}),a=X(k),S=i.some(l=>l.quickRatio!==void 0);return q.useEffect(()=>{if(!x.current||i.length===0)return;let l=!1;return(async()=>{try{const C=i.map(o=>o.period),{sciChartSurface:r,wasmContext:t}=await e.scichartExports.SciChartSurface.create(u,{theme:m});if(l){r.delete();return}c.current=r;const T=y.createCategoryXAxis(t,{labelColor:s.axisLabelColor,labels:C});r.xAxes.add(T);const D=y.createNumericYAxis(t,{labelColor:s.axisLabelColor,gridColor:s.gridColor,labelFormatter:o=>o.toFixed(2)});r.yAxes.add(D),F&&r.annotations.add(new e.scichartExports.HorizontalLineAnnotation({y1:1,stroke:a.referenceColor,strokeThickness:1,strokeDashArray:[5,5],annotationLayer:e.scichartExports.EAnnotationLayer.BelowChart,showLabel:!0,labelValue:"1.0"}));const b=i.map((o,h)=>h),v=new e.scichartExports.XyDataSeries(t,{xValues:b,yValues:i.map(o=>o.currentRatio),dataSeriesName:"Current Ratio"}),B=new e.scichartExports.FastLineRenderableSeries(t,{dataSeries:v,stroke:a.currentColor,strokeThickness:3,pointMarker:new e.scichartExports.EllipsePointMarker(t,{width:8,height:8,fill:a.currentColor,stroke:"#FFFFFF",strokeThickness:2})});if(r.renderableSeries.add(B),p&&S){const o=new e.scichartExports.XyDataSeries(t,{xValues:b,yValues:i.map(N=>N.quickRatio??0),dataSeriesName:"Quick Ratio"}),h=new e.scichartExports.FastLineRenderableSeries(t,{dataSeries:o,stroke:a.quickColor,strokeThickness:2,pointMarker:new e.scichartExports.EllipsePointMarker(t,{width:6,height:6,fill:a.quickColor,stroke:"#FFFFFF",strokeThickness:1})});r.renderableSeries.add(h)}E.addStandardModifiers(r,{crosshairColor:s.crosshairColor,valueFormatters:{"Current Ratio":w.tooltipFormatters.multiplier,"Quick Ratio":w.tooltipFormatters.multiplier}}),f&&E.addLegendModifier(r),n==null||n(r)}catch(C){console.error("Failed to initialize CurrentRatioChart:",C)}})(),()=>{l=!0,c.current&&(c.current.delete(),c.current=null)}},[i,u,m,s,a,f,p,F,S,n]),V.jsx("div",{ref:x,id:u,className:A,style:L})});exports.CurrentRatioChart=z;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs15.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),S=require("react"),L=require("./petal-toolkit.cjs59.js"),M=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),S=require("react"),L=require("./petal-toolkit.cjs59.js"),M=require("./petal-toolkit.cjs1329.js"),u=require("./petal-toolkit.cjs55.js"),j=require("./petal-toolkit.cjs1330.js"),g=require("./petal-toolkit.cjs1331.js"),T=require("./petal-toolkit.cjs58.js");function k(m){switch(m){case"light":return{shortTermColor:"#f97316",longTermColor:"#dc2626"};case"navy":return{shortTermColor:"#fb923c",longTermColor:"#f43f5e"};case"dark":default:return{shortTermColor:"#FFA502",longTermColor:"#FF4757"}}}const V=S.memo(function({data:e,width:F="100%",height:p=400,className:x,themePreset:C="dark",theme:y,showLegend:d=!0,onChartReady:c}){const{containerId:a,containerRef:h,surfaceRef:s,sciChartTheme:b,baseColors:o,containerStyle:D}=M.useFinancialChartSetup({chartName:"debt-structure",width:F,height:p,themePreset:C,customTheme:y}),i=k(C);return S.useEffect(()=>{if(!h.current||e.length===0)return;let f=!1;return(async()=>{try{const l=e.map(t=>t.period),q=e.map((t,A)=>A),{sciChartSurface:r,wasmContext:n}=await L.scichartExports.SciChartSurface.create(a,{theme:b});if(f){r.delete();return}s.current=r,r.xAxes.add(u.createCategoryXAxis(n,{labelColor:o.axisLabelColor,labels:l})),r.yAxes.add(u.createNumericYAxis(n,{labelColor:o.axisLabelColor,gridColor:o.gridColor,labelFormatter:u.labelFormatters.currency})),r.renderableSeries.add(j.createStackedCollection(n,{xValues:q,groupId:"debt",series:[{yValues:e.map(t=>t.shortTermDebt),name:"Short-Term Debt",color:i.shortTermColor},{yValues:e.map(t=>t.longTermDebt),name:"Long-Term Debt",color:i.longTermColor}]})),g.addStandardModifiers(r,{crosshairColor:o.crosshairColor,valueFormatters:{"Short-Term Debt":T.tooltipFormatters.currency,"Long-Term Debt":T.tooltipFormatters.currency}}),d&&g.addLegendModifier(r),c==null||c(r)}catch(l){console.error("Failed to initialize DebtStructureChart:",l)}})(),()=>{f=!0,s.current&&(s.current.delete(),s.current=null)}},[e,a,b,o,i,d,c]),v.jsx("div",{ref:h,id:a,className:x,style:D})});exports.DebtStructureChart=V;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs18.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),x=require("react"),M=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),x=require("react"),M=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.cjs1329.js"),q=require("./petal-toolkit.cjs55.js"),y=require("./petal-toolkit.cjs1330.js"),p=require("./petal-toolkit.cjs1331.js"),L=require("./petal-toolkit.cjs58.js");function k(u){switch(u){case"light":return{lineColor:"#f97316",referenceColor:"#9ca3af"};case"navy":return{lineColor:"#fb923c",referenceColor:"#64748b"};case"dark":default:return{lineColor:"#FFA502",referenceColor:"#6B7280"}}}const N=x.memo(function({data:t,width:F="100%",height:S=400,className:E,themePreset:d="dark",theme:g,showLegend:f=!0,showReferenceLine:C=!0,onChartReady:i}){const{containerId:c,containerRef:b,surfaceRef:a,sciChartTheme:m,baseColors:o,containerStyle:D}=j.useFinancialChartSetup({chartName:"debt-to-equity",width:F,height:S,themePreset:d,customTheme:g}),l=k(d);return x.useEffect(()=>{if(!b.current||t.length===0)return;let h=!1;return(async()=>{try{const s=t.map(r=>r.period),T=t.map((r,A)=>A),{sciChartSurface:e,wasmContext:n}=await M.scichartExports.SciChartSurface.create(c,{theme:m});if(h){e.delete();return}a.current=e,e.xAxes.add(q.createCategoryXAxis(n,{labelColor:o.axisLabelColor,labels:s})),e.yAxes.add(q.createNumericYAxis(n,{labelColor:o.axisLabelColor,gridColor:o.gridColor,labelFormatter:r=>`${r.toFixed(2)}x`})),C&&y.addReferenceLine(e,{y:1,color:l.referenceColor,label:"1.0x"}),e.renderableSeries.add(y.createLineSeries(n,{xValues:T,yValues:t.map(r=>r.debtToEquityRatio),name:"Debt-to-Equity Ratio",color:l.lineColor})),p.addStandardModifiers(e,{crosshairColor:o.crosshairColor,valueFormatters:{"Debt-to-Equity Ratio":L.tooltipFormatters.multiplier}}),f&&p.addLegendModifier(e),i==null||i(e)}catch(s){console.error("Failed to initialize DebtToEquityChart:",s)}})(),()=>{h=!0,a.current&&(a.current.delete(),a.current=null)}},[t,c,m,o,l,f,C,i]),v.jsx("div",{ref:b,id:c,className:E,style:D})});exports.DebtToEquityChart=N;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs19.js.map
|