@chartts/core 0.1.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/dist/area-type-B3CtuIIP.d.cts +9 -0
- package/dist/area-type-DmB6fTVf.d.ts +9 -0
- package/dist/area.cjs +34 -0
- package/dist/area.cjs.map +1 -0
- package/dist/area.d.cts +8 -0
- package/dist/area.d.ts +8 -0
- package/dist/area.js +13 -0
- package/dist/area.js.map +1 -0
- package/dist/bar-type-Bne_khsO.d.ts +5 -0
- package/dist/bar-type-CkI-kkrC.d.cts +5 -0
- package/dist/bar.cjs +34 -0
- package/dist/bar.cjs.map +1 -0
- package/dist/bar.d.cts +8 -0
- package/dist/bar.d.ts +8 -0
- package/dist/bar.js +13 -0
- package/dist/bar.js.map +1 -0
- package/dist/baseline-type-B1O4XHT3.d.ts +25 -0
- package/dist/baseline-type-BAPrZJ5W.d.cts +25 -0
- package/dist/baseline.cjs +32 -0
- package/dist/baseline.cjs.map +1 -0
- package/dist/baseline.d.cts +8 -0
- package/dist/baseline.d.ts +8 -0
- package/dist/baseline.js +11 -0
- package/dist/baseline.js.map +1 -0
- package/dist/boxplot-type-CEWf7p5X.d.ts +5 -0
- package/dist/boxplot-type-Da8_smoe.d.cts +5 -0
- package/dist/boxplot.cjs +33 -0
- package/dist/boxplot.cjs.map +1 -0
- package/dist/boxplot.d.cts +8 -0
- package/dist/boxplot.d.ts +8 -0
- package/dist/boxplot.js +12 -0
- package/dist/boxplot.js.map +1 -0
- package/dist/bubble-type-Dxb2JCKv.d.cts +9 -0
- package/dist/bubble-type-pru5MgB7.d.ts +9 -0
- package/dist/bubble.cjs +32 -0
- package/dist/bubble.cjs.map +1 -0
- package/dist/bubble.d.cts +8 -0
- package/dist/bubble.d.ts +8 -0
- package/dist/bubble.js +11 -0
- package/dist/bubble.js.map +1 -0
- package/dist/bullet-type-CPEYkEvt.d.ts +15 -0
- package/dist/bullet-type-khCmwFqH.d.cts +15 -0
- package/dist/bullet.cjs +33 -0
- package/dist/bullet.cjs.map +1 -0
- package/dist/bullet.d.cts +8 -0
- package/dist/bullet.d.ts +8 -0
- package/dist/bullet.js +12 -0
- package/dist/bullet.js.map +1 -0
- package/dist/calendar-type-Br5mpdea.d.cts +15 -0
- package/dist/calendar-type-yJWPY6qT.d.ts +15 -0
- package/dist/calendar.cjs +33 -0
- package/dist/calendar.cjs.map +1 -0
- package/dist/calendar.d.cts +8 -0
- package/dist/calendar.d.ts +8 -0
- package/dist/calendar.js +12 -0
- package/dist/calendar.js.map +1 -0
- package/dist/candlestick-type-CazXUb77.d.cts +22 -0
- package/dist/candlestick-type-CtLZy_uC.d.ts +22 -0
- package/dist/candlestick.cjs +33 -0
- package/dist/candlestick.cjs.map +1 -0
- package/dist/candlestick.d.cts +8 -0
- package/dist/candlestick.d.ts +8 -0
- package/dist/candlestick.js +12 -0
- package/dist/candlestick.js.map +1 -0
- package/dist/chord-type-ChIZaOZd.d.cts +5 -0
- package/dist/chord-type-ruvHboZl.d.ts +5 -0
- package/dist/chord.cjs +33 -0
- package/dist/chord.cjs.map +1 -0
- package/dist/chord.d.cts +8 -0
- package/dist/chord.d.ts +8 -0
- package/dist/chord.js +12 -0
- package/dist/chord.js.map +1 -0
- package/dist/chunk-22LR6CFM.js +176 -0
- package/dist/chunk-22LR6CFM.js.map +1 -0
- package/dist/chunk-2TWYS3BT.cjs +199 -0
- package/dist/chunk-2TWYS3BT.cjs.map +1 -0
- package/dist/chunk-3BRQGYDX.js +4859 -0
- package/dist/chunk-3BRQGYDX.js.map +1 -0
- package/dist/chunk-3TTTELGB.cjs +146 -0
- package/dist/chunk-3TTTELGB.cjs.map +1 -0
- package/dist/chunk-3XVGEBR4.js +17 -0
- package/dist/chunk-3XVGEBR4.js.map +1 -0
- package/dist/chunk-4HK4RM3X.cjs +128 -0
- package/dist/chunk-4HK4RM3X.cjs.map +1 -0
- package/dist/chunk-4VG47RLS.js +130 -0
- package/dist/chunk-4VG47RLS.js.map +1 -0
- package/dist/chunk-4YJPBUX2.cjs +68 -0
- package/dist/chunk-4YJPBUX2.cjs.map +1 -0
- package/dist/chunk-5QOQR5FE.cjs +19 -0
- package/dist/chunk-5QOQR5FE.cjs.map +1 -0
- package/dist/chunk-66HSJRRH.js +112 -0
- package/dist/chunk-66HSJRRH.js.map +1 -0
- package/dist/chunk-6KNBJ4CE.js +144 -0
- package/dist/chunk-6KNBJ4CE.js.map +1 -0
- package/dist/chunk-6LKN3HRX.js +79 -0
- package/dist/chunk-6LKN3HRX.js.map +1 -0
- package/dist/chunk-6N66T7VQ.js +103 -0
- package/dist/chunk-6N66T7VQ.js.map +1 -0
- package/dist/chunk-6YKFTEX4.js +336 -0
- package/dist/chunk-6YKFTEX4.js.map +1 -0
- package/dist/chunk-7CGXK7KT.js +124 -0
- package/dist/chunk-7CGXK7KT.js.map +1 -0
- package/dist/chunk-7HDAYWK3.cjs +358 -0
- package/dist/chunk-7HDAYWK3.cjs.map +1 -0
- package/dist/chunk-7SEHTEMR.js +91 -0
- package/dist/chunk-7SEHTEMR.js.map +1 -0
- package/dist/chunk-7YV56WPE.js +157 -0
- package/dist/chunk-7YV56WPE.js.map +1 -0
- package/dist/chunk-B54L2CPW.cjs +165 -0
- package/dist/chunk-B54L2CPW.cjs.map +1 -0
- package/dist/chunk-BC6KW2OG.js +197 -0
- package/dist/chunk-BC6KW2OG.js.map +1 -0
- package/dist/chunk-BEYG2HQ4.cjs +178 -0
- package/dist/chunk-BEYG2HQ4.cjs.map +1 -0
- package/dist/chunk-BR3KTAGW.js +113 -0
- package/dist/chunk-BR3KTAGW.js.map +1 -0
- package/dist/chunk-BRSHEDTZ.js +30 -0
- package/dist/chunk-BRSHEDTZ.js.map +1 -0
- package/dist/chunk-BXX2EPFE.cjs +160 -0
- package/dist/chunk-BXX2EPFE.cjs.map +1 -0
- package/dist/chunk-BYXRFTEI.cjs +114 -0
- package/dist/chunk-BYXRFTEI.cjs.map +1 -0
- package/dist/chunk-CMEXNS5V.js +158 -0
- package/dist/chunk-CMEXNS5V.js.map +1 -0
- package/dist/chunk-D2SV6YT3.js +47 -0
- package/dist/chunk-D2SV6YT3.js.map +1 -0
- package/dist/chunk-DL7P72FA.cjs +273 -0
- package/dist/chunk-DL7P72FA.cjs.map +1 -0
- package/dist/chunk-DNQ6N3VG.js +208 -0
- package/dist/chunk-DNQ6N3VG.js.map +1 -0
- package/dist/chunk-E2S7RAT2.js +126 -0
- package/dist/chunk-E2S7RAT2.js.map +1 -0
- package/dist/chunk-E6PR75X7.js +15 -0
- package/dist/chunk-E6PR75X7.js.map +1 -0
- package/dist/chunk-EGQ4JCFU.cjs +109 -0
- package/dist/chunk-EGQ4JCFU.cjs.map +1 -0
- package/dist/chunk-ETPZGEL7.cjs +105 -0
- package/dist/chunk-ETPZGEL7.cjs.map +1 -0
- package/dist/chunk-FFJ6BVEY.cjs +132 -0
- package/dist/chunk-FFJ6BVEY.cjs.map +1 -0
- package/dist/chunk-FKYNRMPX.js +133 -0
- package/dist/chunk-FKYNRMPX.js.map +1 -0
- package/dist/chunk-FRWC6GUR.cjs +126 -0
- package/dist/chunk-FRWC6GUR.cjs.map +1 -0
- package/dist/chunk-FUZFNUCJ.js +104 -0
- package/dist/chunk-FUZFNUCJ.js.map +1 -0
- package/dist/chunk-GM3ZO5WV.js +13 -0
- package/dist/chunk-GM3ZO5WV.js.map +1 -0
- package/dist/chunk-GNRRK7TZ.cjs +149 -0
- package/dist/chunk-GNRRK7TZ.cjs.map +1 -0
- package/dist/chunk-H2AE7JMU.js +128 -0
- package/dist/chunk-H2AE7JMU.js.map +1 -0
- package/dist/chunk-H4RNJ7FK.cjs +115 -0
- package/dist/chunk-H4RNJ7FK.cjs.map +1 -0
- package/dist/chunk-HB4EGHJ7.cjs +153 -0
- package/dist/chunk-HB4EGHJ7.cjs.map +1 -0
- package/dist/chunk-HDWWUEPD.js +122 -0
- package/dist/chunk-HDWWUEPD.js.map +1 -0
- package/dist/chunk-HOOOCSU4.js +216 -0
- package/dist/chunk-HOOOCSU4.js.map +1 -0
- package/dist/chunk-J6NPRKT4.cjs +49 -0
- package/dist/chunk-J6NPRKT4.cjs.map +1 -0
- package/dist/chunk-JO6U4YR4.js +355 -0
- package/dist/chunk-JO6U4YR4.js.map +1 -0
- package/dist/chunk-KE7ILTM4.cjs +162 -0
- package/dist/chunk-KE7ILTM4.cjs.map +1 -0
- package/dist/chunk-KSRROKYC.cjs +135 -0
- package/dist/chunk-KSRROKYC.cjs.map +1 -0
- package/dist/chunk-KVI6DN3R.js +147 -0
- package/dist/chunk-KVI6DN3R.js.map +1 -0
- package/dist/chunk-L54BZYAI.cjs +111 -0
- package/dist/chunk-L54BZYAI.cjs.map +1 -0
- package/dist/chunk-LB4MV5CG.js +109 -0
- package/dist/chunk-LB4MV5CG.js.map +1 -0
- package/dist/chunk-LEJGLR2P.cjs +106 -0
- package/dist/chunk-LEJGLR2P.cjs.map +1 -0
- package/dist/chunk-LU35QDPN.cjs +30 -0
- package/dist/chunk-LU35QDPN.cjs.map +1 -0
- package/dist/chunk-LUTU4WW3.js +151 -0
- package/dist/chunk-LUTU4WW3.js.map +1 -0
- package/dist/chunk-M4AQD6WX.cjs +220 -0
- package/dist/chunk-M4AQD6WX.cjs.map +1 -0
- package/dist/chunk-M4UST3UU.cjs +159 -0
- package/dist/chunk-M4UST3UU.cjs.map +1 -0
- package/dist/chunk-MLD5ZIDO.cjs +359 -0
- package/dist/chunk-MLD5ZIDO.cjs.map +1 -0
- package/dist/chunk-MLX3EO2C.js +107 -0
- package/dist/chunk-MLX3EO2C.js.map +1 -0
- package/dist/chunk-MVWERW4G.cjs +28 -0
- package/dist/chunk-MVWERW4G.cjs.map +1 -0
- package/dist/chunk-MYPCA25Y.cjs +115 -0
- package/dist/chunk-MYPCA25Y.cjs.map +1 -0
- package/dist/chunk-N6IVODRJ.js +114 -0
- package/dist/chunk-N6IVODRJ.js.map +1 -0
- package/dist/chunk-NFD6VAVM.js +155 -0
- package/dist/chunk-NFD6VAVM.js.map +1 -0
- package/dist/chunk-NHGKZMD7.cjs +18 -0
- package/dist/chunk-NHGKZMD7.cjs.map +1 -0
- package/dist/chunk-NMLDPXOL.js +167 -0
- package/dist/chunk-NMLDPXOL.js.map +1 -0
- package/dist/chunk-NONU7KUN.cjs +32 -0
- package/dist/chunk-NONU7KUN.cjs.map +1 -0
- package/dist/chunk-NQSC7CKN.js +130 -0
- package/dist/chunk-NQSC7CKN.js.map +1 -0
- package/dist/chunk-NYVFC2SF.js +87 -0
- package/dist/chunk-NYVFC2SF.js.map +1 -0
- package/dist/chunk-O5KGKQSU.js +218 -0
- package/dist/chunk-O5KGKQSU.js.map +1 -0
- package/dist/chunk-OGSZO22B.js +26 -0
- package/dist/chunk-OGSZO22B.js.map +1 -0
- package/dist/chunk-Q2BDB5ZA.cjs +218 -0
- package/dist/chunk-Q2BDB5ZA.cjs.map +1 -0
- package/dist/chunk-Q6U5D2ZB.cjs +210 -0
- package/dist/chunk-Q6U5D2ZB.cjs.map +1 -0
- package/dist/chunk-QAYX6XN3.js +26 -0
- package/dist/chunk-QAYX6XN3.js.map +1 -0
- package/dist/chunk-QHJHYV3H.cjs +15 -0
- package/dist/chunk-QHJHYV3H.cjs.map +1 -0
- package/dist/chunk-QIJZZOX7.js +249 -0
- package/dist/chunk-QIJZZOX7.js.map +1 -0
- package/dist/chunk-QLRK46YY.cjs +93 -0
- package/dist/chunk-QLRK46YY.cjs.map +1 -0
- package/dist/chunk-QZ4ZYTP6.js +124 -0
- package/dist/chunk-QZ4ZYTP6.js.map +1 -0
- package/dist/chunk-RCVRZCCC.cjs +156 -0
- package/dist/chunk-RCVRZCCC.cjs.map +1 -0
- package/dist/chunk-ROYZ7W4M.cjs +81 -0
- package/dist/chunk-ROYZ7W4M.cjs.map +1 -0
- package/dist/chunk-SJS4ISBA.js +163 -0
- package/dist/chunk-SJS4ISBA.js.map +1 -0
- package/dist/chunk-SKVCPG5R.cjs +124 -0
- package/dist/chunk-SKVCPG5R.cjs.map +1 -0
- package/dist/chunk-SQJAKZ4W.js +113 -0
- package/dist/chunk-SQJAKZ4W.js.map +1 -0
- package/dist/chunk-SUNC3CPV.js +79 -0
- package/dist/chunk-SUNC3CPV.js.map +1 -0
- package/dist/chunk-SWYCVF46.js +145 -0
- package/dist/chunk-SWYCVF46.js.map +1 -0
- package/dist/chunk-SZVK6RRQ.js +98 -0
- package/dist/chunk-SZVK6RRQ.js.map +1 -0
- package/dist/chunk-TOS2RYHQ.js +154 -0
- package/dist/chunk-TOS2RYHQ.js.map +1 -0
- package/dist/chunk-TTOX27BZ.cjs +116 -0
- package/dist/chunk-TTOX27BZ.cjs.map +1 -0
- package/dist/chunk-TW6KPQIS.js +160 -0
- package/dist/chunk-TW6KPQIS.js.map +1 -0
- package/dist/chunk-UN7K3YQG.cjs +81 -0
- package/dist/chunk-UN7K3YQG.cjs.map +1 -0
- package/dist/chunk-UQBDGCS6.cjs +89 -0
- package/dist/chunk-UQBDGCS6.cjs.map +1 -0
- package/dist/chunk-VPI7UGB3.cjs +130 -0
- package/dist/chunk-VPI7UGB3.cjs.map +1 -0
- package/dist/chunk-X2JNB5UN.js +271 -0
- package/dist/chunk-X2JNB5UN.js.map +1 -0
- package/dist/chunk-XBIM73HV.cjs +126 -0
- package/dist/chunk-XBIM73HV.cjs.map +1 -0
- package/dist/chunk-XHQWWR5M.cjs +4892 -0
- package/dist/chunk-XHQWWR5M.cjs.map +1 -0
- package/dist/chunk-Y2JZHX3P.cjs +169 -0
- package/dist/chunk-Y2JZHX3P.cjs.map +1 -0
- package/dist/chunk-Y4P4VY7A.cjs +251 -0
- package/dist/chunk-Y4P4VY7A.cjs.map +1 -0
- package/dist/chunk-Y54XVNXB.cjs +157 -0
- package/dist/chunk-Y54XVNXB.cjs.map +1 -0
- package/dist/chunk-Z6E3XVP2.cjs +132 -0
- package/dist/chunk-Z6E3XVP2.cjs.map +1 -0
- package/dist/chunk-ZDYCIP6N.cjs +100 -0
- package/dist/chunk-ZDYCIP6N.cjs.map +1 -0
- package/dist/chunk-ZDZQG3GH.cjs +148 -0
- package/dist/chunk-ZDZQG3GH.cjs.map +1 -0
- package/dist/chunk-ZL25X5WW.js +66 -0
- package/dist/chunk-ZL25X5WW.js.map +1 -0
- package/dist/combo-type-BdSohVyy.d.ts +16 -0
- package/dist/combo-type-wodyLq1f.d.cts +16 -0
- package/dist/combo.cjs +34 -0
- package/dist/combo.cjs.map +1 -0
- package/dist/combo.d.cts +8 -0
- package/dist/combo.d.ts +8 -0
- package/dist/combo.js +13 -0
- package/dist/combo.js.map +1 -0
- package/dist/custom-type-B6w1n5Ua.d.cts +23 -0
- package/dist/custom-type-XFjuPwCr.d.ts +23 -0
- package/dist/custom.cjs +33 -0
- package/dist/custom.cjs.map +1 -0
- package/dist/custom.d.cts +8 -0
- package/dist/custom.d.ts +8 -0
- package/dist/custom.js +12 -0
- package/dist/custom.js.map +1 -0
- package/dist/donut.cjs +33 -0
- package/dist/donut.cjs.map +1 -0
- package/dist/donut.d.cts +8 -0
- package/dist/donut.d.ts +8 -0
- package/dist/donut.js +12 -0
- package/dist/donut.js.map +1 -0
- package/dist/dumbbell-type-DPSE0OTg.d.ts +12 -0
- package/dist/dumbbell-type-w424KzI2.d.cts +12 -0
- package/dist/dumbbell.cjs +34 -0
- package/dist/dumbbell.cjs.map +1 -0
- package/dist/dumbbell.d.cts +8 -0
- package/dist/dumbbell.d.ts +8 -0
- package/dist/dumbbell.js +13 -0
- package/dist/dumbbell.js.map +1 -0
- package/dist/engine-CNukbv7k.d.cts +426 -0
- package/dist/engine-CNukbv7k.d.ts +426 -0
- package/dist/factory-dbngWV4d.d.cts +8 -0
- package/dist/factory-jRzNNxwj.d.ts +8 -0
- package/dist/finance.cjs +92 -0
- package/dist/finance.cjs.map +1 -0
- package/dist/finance.d.cts +192 -0
- package/dist/finance.d.ts +192 -0
- package/dist/finance.js +3 -0
- package/dist/finance.js.map +1 -0
- package/dist/funnel-type-BeVl3ohX.d.cts +9 -0
- package/dist/funnel-type-CMXGQq4T.d.ts +9 -0
- package/dist/funnel.cjs +33 -0
- package/dist/funnel.cjs.map +1 -0
- package/dist/funnel.d.cts +8 -0
- package/dist/funnel.d.ts +8 -0
- package/dist/funnel.js +12 -0
- package/dist/funnel.js.map +1 -0
- package/dist/gauge-type-BpDBwCeD.d.ts +11 -0
- package/dist/gauge-type-DmjDdfsY.d.cts +11 -0
- package/dist/gauge.cjs +33 -0
- package/dist/gauge.cjs.map +1 -0
- package/dist/gauge.d.cts +8 -0
- package/dist/gauge.d.ts +8 -0
- package/dist/gauge.js +12 -0
- package/dist/gauge.js.map +1 -0
- package/dist/geo.cjs +41 -0
- package/dist/geo.cjs.map +1 -0
- package/dist/geo.d.cts +8 -0
- package/dist/geo.d.ts +8 -0
- package/dist/geo.js +12 -0
- package/dist/geo.js.map +1 -0
- package/dist/graph-type-DkdAB6Vc.d.cts +5 -0
- package/dist/graph-type-ul9xwdf5.d.ts +5 -0
- package/dist/graph.cjs +33 -0
- package/dist/graph.cjs.map +1 -0
- package/dist/graph.d.cts +8 -0
- package/dist/graph.d.ts +8 -0
- package/dist/graph.js +12 -0
- package/dist/graph.js.map +1 -0
- package/dist/heatmap-type-D0shkxK7.d.cts +12 -0
- package/dist/heatmap-type-q6nNhVTr.d.ts +12 -0
- package/dist/heatmap.cjs +33 -0
- package/dist/heatmap.cjs.map +1 -0
- package/dist/heatmap.d.cts +8 -0
- package/dist/heatmap.d.ts +8 -0
- package/dist/heatmap.js +12 -0
- package/dist/heatmap.js.map +1 -0
- package/dist/histogram-type-BWil-Rb7.d.cts +13 -0
- package/dist/histogram-type-CF593WSp.d.ts +13 -0
- package/dist/histogram.cjs +33 -0
- package/dist/histogram.cjs.map +1 -0
- package/dist/histogram.d.cts +8 -0
- package/dist/histogram.d.ts +8 -0
- package/dist/histogram.js +12 -0
- package/dist/histogram.js.map +1 -0
- package/dist/horizontal-bar-type-0mqnyMUR.d.cts +11 -0
- package/dist/horizontal-bar-type-DAlrxY0h.d.ts +11 -0
- package/dist/horizontal-bar.cjs +34 -0
- package/dist/horizontal-bar.cjs.map +1 -0
- package/dist/horizontal-bar.d.cts +8 -0
- package/dist/horizontal-bar.d.ts +8 -0
- package/dist/horizontal-bar.js +13 -0
- package/dist/horizontal-bar.js.map +1 -0
- package/dist/index.cjs +1604 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +594 -0
- package/dist/index.d.ts +594 -0
- package/dist/index.js +1201 -0
- package/dist/index.js.map +1 -0
- package/dist/kagi-type-Y5XUVm3h.d.ts +26 -0
- package/dist/kagi-type-aG-Q1bWk.d.cts +26 -0
- package/dist/kagi.cjs +33 -0
- package/dist/kagi.cjs.map +1 -0
- package/dist/kagi.d.cts +8 -0
- package/dist/kagi.d.ts +8 -0
- package/dist/kagi.js +12 -0
- package/dist/kagi.js.map +1 -0
- package/dist/line-type-B8lgTFjb.d.cts +5 -0
- package/dist/line-type-Diw0nXj7.d.ts +5 -0
- package/dist/line.cjs +33 -0
- package/dist/line.cjs.map +1 -0
- package/dist/line.d.cts +8 -0
- package/dist/line.d.ts +8 -0
- package/dist/line.js +12 -0
- package/dist/line.js.map +1 -0
- package/dist/lines-type-CGrg_mDi.d.cts +31 -0
- package/dist/lines-type-V-seVNZ4.d.ts +31 -0
- package/dist/lines.cjs +33 -0
- package/dist/lines.cjs.map +1 -0
- package/dist/lines.d.cts +8 -0
- package/dist/lines.d.ts +8 -0
- package/dist/lines.js +12 -0
- package/dist/lines.js.map +1 -0
- package/dist/lollipop-type-CoTzKLSu.d.cts +11 -0
- package/dist/lollipop-type-Ygc4rRql.d.ts +11 -0
- package/dist/lollipop.cjs +33 -0
- package/dist/lollipop.cjs.map +1 -0
- package/dist/lollipop.d.cts +8 -0
- package/dist/lollipop.d.ts +8 -0
- package/dist/lollipop.js +12 -0
- package/dist/lollipop.js.map +1 -0
- package/dist/matrix-type-Crb_NwUJ.d.cts +26 -0
- package/dist/matrix-type-Dag1VLCY.d.ts +26 -0
- package/dist/matrix.cjs +33 -0
- package/dist/matrix.cjs.map +1 -0
- package/dist/matrix.d.cts +8 -0
- package/dist/matrix.d.ts +8 -0
- package/dist/matrix.js +12 -0
- package/dist/matrix.js.map +1 -0
- package/dist/ohlc-type-BQBHvVJO.d.cts +28 -0
- package/dist/ohlc-type-CGR-vRGL.d.ts +28 -0
- package/dist/ohlc.cjs +33 -0
- package/dist/ohlc.cjs.map +1 -0
- package/dist/ohlc.d.cts +8 -0
- package/dist/ohlc.d.ts +8 -0
- package/dist/ohlc.js +12 -0
- package/dist/ohlc.js.map +1 -0
- package/dist/parallel-type-6t6xyHMg.d.ts +14 -0
- package/dist/parallel-type-D-S-EqeC.d.cts +14 -0
- package/dist/parallel.cjs +33 -0
- package/dist/parallel.cjs.map +1 -0
- package/dist/parallel.d.cts +8 -0
- package/dist/parallel.d.ts +8 -0
- package/dist/parallel.js +12 -0
- package/dist/parallel.js.map +1 -0
- package/dist/pictorialbar-type-A-8mTX1N.d.ts +5 -0
- package/dist/pictorialbar-type-CnJEH9GZ.d.cts +5 -0
- package/dist/pictorialbar.cjs +33 -0
- package/dist/pictorialbar.cjs.map +1 -0
- package/dist/pictorialbar.d.cts +8 -0
- package/dist/pictorialbar.d.ts +8 -0
- package/dist/pictorialbar.js +12 -0
- package/dist/pictorialbar.js.map +1 -0
- package/dist/pie-type-S7kUKGRS.d.ts +7 -0
- package/dist/pie-type-duX5xkfQ.d.cts +7 -0
- package/dist/pie.cjs +33 -0
- package/dist/pie.cjs.map +1 -0
- package/dist/pie.d.cts +8 -0
- package/dist/pie.d.ts +8 -0
- package/dist/pie.js +12 -0
- package/dist/pie.js.map +1 -0
- package/dist/polar-type-CI6-I8Yg.d.cts +11 -0
- package/dist/polar-type-Dj21GIc9.d.ts +11 -0
- package/dist/polar.cjs +33 -0
- package/dist/polar.cjs.map +1 -0
- package/dist/polar.d.cts +8 -0
- package/dist/polar.d.ts +8 -0
- package/dist/polar.js +12 -0
- package/dist/polar.js.map +1 -0
- package/dist/radar-type-CYjZHuKm.d.ts +9 -0
- package/dist/radar-type-Dgyr13Zd.d.cts +9 -0
- package/dist/radar.cjs +33 -0
- package/dist/radar.cjs.map +1 -0
- package/dist/radar.d.cts +8 -0
- package/dist/radar.d.ts +8 -0
- package/dist/radar.js +12 -0
- package/dist/radar.js.map +1 -0
- package/dist/radialbar-type-CLZ8XgST.d.ts +11 -0
- package/dist/radialbar-type-C_SBXoaa.d.cts +11 -0
- package/dist/radialbar.cjs +33 -0
- package/dist/radialbar.cjs.map +1 -0
- package/dist/radialbar.d.cts +8 -0
- package/dist/radialbar.d.ts +8 -0
- package/dist/radialbar.js +12 -0
- package/dist/radialbar.js.map +1 -0
- package/dist/range-type-CkriEnLm.d.cts +26 -0
- package/dist/range-type-_LbMV4tl.d.ts +26 -0
- package/dist/range.cjs +32 -0
- package/dist/range.cjs.map +1 -0
- package/dist/range.d.cts +8 -0
- package/dist/range.d.ts +8 -0
- package/dist/range.js +11 -0
- package/dist/range.js.map +1 -0
- package/dist/renko-type-43OXCtZ3.d.cts +24 -0
- package/dist/renko-type-ejoXt2ro.d.ts +24 -0
- package/dist/renko.cjs +33 -0
- package/dist/renko.cjs.map +1 -0
- package/dist/renko.d.cts +8 -0
- package/dist/renko.d.ts +8 -0
- package/dist/renko.js +12 -0
- package/dist/renko.js.map +1 -0
- package/dist/sankey-type-CN7PL5MQ.d.ts +5 -0
- package/dist/sankey-type-DfkTUnXB.d.cts +5 -0
- package/dist/sankey.cjs +33 -0
- package/dist/sankey.cjs.map +1 -0
- package/dist/sankey.d.cts +8 -0
- package/dist/sankey.d.ts +8 -0
- package/dist/sankey.js +12 -0
- package/dist/sankey.js.map +1 -0
- package/dist/scatter-type-CD7X1pZb.d.cts +5 -0
- package/dist/scatter-type-D3HdPkZ6.d.ts +5 -0
- package/dist/scatter.cjs +32 -0
- package/dist/scatter.cjs.map +1 -0
- package/dist/scatter.d.cts +8 -0
- package/dist/scatter.d.ts +8 -0
- package/dist/scatter.js +11 -0
- package/dist/scatter.js.map +1 -0
- package/dist/sparkline-type-COW3izgF.d.ts +9 -0
- package/dist/sparkline-type-qt3yoLs7.d.cts +9 -0
- package/dist/sparkline.cjs +33 -0
- package/dist/sparkline.cjs.map +1 -0
- package/dist/sparkline.d.cts +8 -0
- package/dist/sparkline.d.ts +8 -0
- package/dist/sparkline.js +12 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/stacked-bar-type-C-5pmb-D.d.ts +8 -0
- package/dist/stacked-bar-type-Ct6HK2A0.d.cts +8 -0
- package/dist/stacked-bar.cjs +34 -0
- package/dist/stacked-bar.cjs.map +1 -0
- package/dist/stacked-bar.d.cts +8 -0
- package/dist/stacked-bar.d.ts +8 -0
- package/dist/stacked-bar.js +13 -0
- package/dist/stacked-bar.js.map +1 -0
- package/dist/step-type-BSL-CUny.d.cts +11 -0
- package/dist/step-type-Cleoshov.d.ts +11 -0
- package/dist/step.cjs +34 -0
- package/dist/step.cjs.map +1 -0
- package/dist/step.d.cts +8 -0
- package/dist/step.d.ts +8 -0
- package/dist/step.js +13 -0
- package/dist/step.js.map +1 -0
- package/dist/sunburst-type-BOztb_Px.d.cts +5 -0
- package/dist/sunburst-type-ZFw2w6m8.d.ts +5 -0
- package/dist/sunburst.cjs +33 -0
- package/dist/sunburst.cjs.map +1 -0
- package/dist/sunburst.d.cts +8 -0
- package/dist/sunburst.d.ts +8 -0
- package/dist/sunburst.js +12 -0
- package/dist/sunburst.js.map +1 -0
- package/dist/themeriver-type-B5PYChcC.d.ts +15 -0
- package/dist/themeriver-type-BnRSsyal.d.cts +15 -0
- package/dist/themeriver.cjs +33 -0
- package/dist/themeriver.cjs.map +1 -0
- package/dist/themeriver.d.cts +8 -0
- package/dist/themeriver.d.ts +8 -0
- package/dist/themeriver.js +12 -0
- package/dist/themeriver.js.map +1 -0
- package/dist/tree-type-B-bOSg0l.d.ts +5 -0
- package/dist/tree-type-Cz84wHnR.d.cts +5 -0
- package/dist/tree.cjs +33 -0
- package/dist/tree.cjs.map +1 -0
- package/dist/tree.d.cts +8 -0
- package/dist/tree.d.ts +8 -0
- package/dist/tree.js +12 -0
- package/dist/tree.js.map +1 -0
- package/dist/treemap-type-DYDj-rWv.d.ts +11 -0
- package/dist/treemap-type-OBCGexiK.d.cts +11 -0
- package/dist/treemap.cjs +33 -0
- package/dist/treemap.cjs.map +1 -0
- package/dist/treemap.d.cts +8 -0
- package/dist/treemap.d.ts +8 -0
- package/dist/treemap.js +12 -0
- package/dist/treemap.js.map +1 -0
- package/dist/volume-type-C9wRmKR6.d.ts +21 -0
- package/dist/volume-type-CfERBN5g.d.cts +21 -0
- package/dist/volume.cjs +33 -0
- package/dist/volume.cjs.map +1 -0
- package/dist/volume.d.cts +8 -0
- package/dist/volume.d.ts +8 -0
- package/dist/volume.js +12 -0
- package/dist/volume.js.map +1 -0
- package/dist/waterfall-type-CpdVtBi_.d.ts +10 -0
- package/dist/waterfall-type-hm5ylGgW.d.cts +10 -0
- package/dist/waterfall.cjs +33 -0
- package/dist/waterfall.cjs.map +1 -0
- package/dist/waterfall.d.cts +8 -0
- package/dist/waterfall.d.ts +8 -0
- package/dist/waterfall.js +12 -0
- package/dist/waterfall.js.map +1 -0
- package/dist/world-regions-Cfvxpbx0.d.ts +50 -0
- package/dist/world-regions-cMulhqDW.d.cts +50 -0
- package/package.json +262 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1201 @@
|
|
|
1
|
+
import { stepChartType } from './chunk-QAYX6XN3.js';
|
|
2
|
+
export { stepChartType } from './chunk-QAYX6XN3.js';
|
|
3
|
+
import { volumeChartType } from './chunk-SUNC3CPV.js';
|
|
4
|
+
export { volumeChartType } from './chunk-SUNC3CPV.js';
|
|
5
|
+
import { rangeChartType } from './chunk-NFD6VAVM.js';
|
|
6
|
+
export { rangeChartType } from './chunk-NFD6VAVM.js';
|
|
7
|
+
import { baselineChartType } from './chunk-SJS4ISBA.js';
|
|
8
|
+
export { baselineChartType } from './chunk-SJS4ISBA.js';
|
|
9
|
+
import { kagiChartType } from './chunk-TOS2RYHQ.js';
|
|
10
|
+
export { kagiChartType } from './chunk-TOS2RYHQ.js';
|
|
11
|
+
import { renkoChartType } from './chunk-N6IVODRJ.js';
|
|
12
|
+
export { renkoChartType } from './chunk-N6IVODRJ.js';
|
|
13
|
+
export { atr, bollingerBands, cumulativeReturns, drawdown, ema, logReturns, macd, maxDrawdown, obv, rsi, sharpeRatio, simpleReturns, sma, stochastic, toBollingerData, toMACDData, toOHLC, volatility, volumeDirections, vwap, wma } from './chunk-6YKFTEX4.js';
|
|
14
|
+
import { themeRiverChartType } from './chunk-NMLDPXOL.js';
|
|
15
|
+
export { themeRiverChartType } from './chunk-NMLDPXOL.js';
|
|
16
|
+
import { pictorialBarChartType } from './chunk-4VG47RLS.js';
|
|
17
|
+
export { pictorialBarChartType } from './chunk-4VG47RLS.js';
|
|
18
|
+
import { chordChartType } from './chunk-O5KGKQSU.js';
|
|
19
|
+
export { chordChartType } from './chunk-O5KGKQSU.js';
|
|
20
|
+
import { geoChartType } from './chunk-JO6U4YR4.js';
|
|
21
|
+
export { WORLD_REGIONS, WORLD_SIMPLE, geoChartType } from './chunk-JO6U4YR4.js';
|
|
22
|
+
import { linesChartType } from './chunk-22LR6CFM.js';
|
|
23
|
+
export { linesChartType } from './chunk-22LR6CFM.js';
|
|
24
|
+
import { matrixChartType } from './chunk-7YV56WPE.js';
|
|
25
|
+
export { matrixChartType } from './chunk-7YV56WPE.js';
|
|
26
|
+
import { customChartType } from './chunk-D2SV6YT3.js';
|
|
27
|
+
export { customChartType } from './chunk-D2SV6YT3.js';
|
|
28
|
+
import { ohlcChartType } from './chunk-FUZFNUCJ.js';
|
|
29
|
+
export { ohlcChartType } from './chunk-FUZFNUCJ.js';
|
|
30
|
+
import { dumbbellChartType } from './chunk-SQJAKZ4W.js';
|
|
31
|
+
export { dumbbellChartType } from './chunk-SQJAKZ4W.js';
|
|
32
|
+
import { calendarChartType } from './chunk-BR3KTAGW.js';
|
|
33
|
+
export { calendarChartType } from './chunk-BR3KTAGW.js';
|
|
34
|
+
import { comboChartType } from './chunk-TW6KPQIS.js';
|
|
35
|
+
export { comboChartType } from './chunk-TW6KPQIS.js';
|
|
36
|
+
import { sankeyChartType } from './chunk-QIJZZOX7.js';
|
|
37
|
+
export { sankeyChartType } from './chunk-QIJZZOX7.js';
|
|
38
|
+
import { sunburstChartType } from './chunk-HOOOCSU4.js';
|
|
39
|
+
export { sunburstChartType } from './chunk-HOOOCSU4.js';
|
|
40
|
+
import { treeChartType } from './chunk-X2JNB5UN.js';
|
|
41
|
+
export { treeChartType } from './chunk-X2JNB5UN.js';
|
|
42
|
+
import { graphChartType } from './chunk-DNQ6N3VG.js';
|
|
43
|
+
export { graphChartType } from './chunk-DNQ6N3VG.js';
|
|
44
|
+
import { parallelChartType } from './chunk-KVI6DN3R.js';
|
|
45
|
+
export { parallelChartType } from './chunk-KVI6DN3R.js';
|
|
46
|
+
import { heatmapChartType } from './chunk-QZ4ZYTP6.js';
|
|
47
|
+
export { heatmapChartType } from './chunk-QZ4ZYTP6.js';
|
|
48
|
+
import { boxplotChartType } from './chunk-NQSC7CKN.js';
|
|
49
|
+
export { boxplotChartType } from './chunk-NQSC7CKN.js';
|
|
50
|
+
import { histogramChartType } from './chunk-6LKN3HRX.js';
|
|
51
|
+
export { histogramChartType } from './chunk-6LKN3HRX.js';
|
|
52
|
+
import { treemapChartType } from './chunk-LUTU4WW3.js';
|
|
53
|
+
export { treemapChartType } from './chunk-LUTU4WW3.js';
|
|
54
|
+
import { polarChartType } from './chunk-FKYNRMPX.js';
|
|
55
|
+
export { polarChartType } from './chunk-FKYNRMPX.js';
|
|
56
|
+
import { radialBarChartType } from './chunk-HDWWUEPD.js';
|
|
57
|
+
export { radialBarChartType } from './chunk-HDWWUEPD.js';
|
|
58
|
+
import { lollipopChartType } from './chunk-NYVFC2SF.js';
|
|
59
|
+
export { lollipopChartType } from './chunk-NYVFC2SF.js';
|
|
60
|
+
import { bulletChartType } from './chunk-66HSJRRH.js';
|
|
61
|
+
export { bulletChartType } from './chunk-66HSJRRH.js';
|
|
62
|
+
import { sparklineChartType } from './chunk-7SEHTEMR.js';
|
|
63
|
+
export { sparklineChartType } from './chunk-7SEHTEMR.js';
|
|
64
|
+
import { areaChartType } from './chunk-BRSHEDTZ.js';
|
|
65
|
+
export { areaChartType } from './chunk-BRSHEDTZ.js';
|
|
66
|
+
import { radarChartType } from './chunk-CMEXNS5V.js';
|
|
67
|
+
export { radarChartType } from './chunk-CMEXNS5V.js';
|
|
68
|
+
import { bubbleChartType } from './chunk-6N66T7VQ.js';
|
|
69
|
+
export { bubbleChartType } from './chunk-6N66T7VQ.js';
|
|
70
|
+
import { candlestickChartType } from './chunk-LB4MV5CG.js';
|
|
71
|
+
export { candlestickChartType } from './chunk-LB4MV5CG.js';
|
|
72
|
+
import { gaugeChartType } from './chunk-6KNBJ4CE.js';
|
|
73
|
+
export { gaugeChartType } from './chunk-6KNBJ4CE.js';
|
|
74
|
+
import { waterfallChartType } from './chunk-7CGXK7KT.js';
|
|
75
|
+
export { waterfallChartType } from './chunk-7CGXK7KT.js';
|
|
76
|
+
import { funnelChartType } from './chunk-SZVK6RRQ.js';
|
|
77
|
+
export { funnelChartType } from './chunk-SZVK6RRQ.js';
|
|
78
|
+
import { lineChartType } from './chunk-BC6KW2OG.js';
|
|
79
|
+
export { lineChartType } from './chunk-BC6KW2OG.js';
|
|
80
|
+
import { barChartType } from './chunk-MLX3EO2C.js';
|
|
81
|
+
export { barChartType } from './chunk-MLX3EO2C.js';
|
|
82
|
+
import { stackedBarChartType } from './chunk-E2S7RAT2.js';
|
|
83
|
+
export { stackedBarChartType } from './chunk-E2S7RAT2.js';
|
|
84
|
+
import { horizontalBarChartType } from './chunk-H2AE7JMU.js';
|
|
85
|
+
export { horizontalBarChartType } from './chunk-H2AE7JMU.js';
|
|
86
|
+
import './chunk-E6PR75X7.js';
|
|
87
|
+
export { formatPercent, formatValue } from './chunk-OGSZO22B.js';
|
|
88
|
+
import { pieChartType, donutChartType } from './chunk-SWYCVF46.js';
|
|
89
|
+
export { donutChartType, pieChartType } from './chunk-SWYCVF46.js';
|
|
90
|
+
import './chunk-3XVGEBR4.js';
|
|
91
|
+
import { scatterChartType } from './chunk-ZL25X5WW.js';
|
|
92
|
+
export { scatterChartType } from './chunk-ZL25X5WW.js';
|
|
93
|
+
import { createChart, rect, PathBuilder, path, text, group, line, circle } from './chunk-3BRQGYDX.js';
|
|
94
|
+
export { CORPORATE_THEME, CSS_PREFIX, DARK_THEME, EDITORIAL_THEME, LIGHT_THEME, OCEAN_THEME, PALETTE, SAAS_THEME, STARTUP_THEME, THEME_PRESETS, applyTheme, createBrush, createCanvasRenderer, createCategoricalScale, createChart, createDebugPanel, createEventBus, createLinearScale, createSVGRenderer, createWebGLRenderer, createZoomPan, decimateData, renderToString, resolveTheme } from './chunk-3BRQGYDX.js';
|
|
95
|
+
|
|
96
|
+
// src/api/convenience.ts
|
|
97
|
+
function Line(target, config) {
|
|
98
|
+
const { data, ...options } = config;
|
|
99
|
+
return createChart(target, lineChartType, data, options);
|
|
100
|
+
}
|
|
101
|
+
function Bar(target, config) {
|
|
102
|
+
const { data, ...options } = config;
|
|
103
|
+
return createChart(target, barChartType, data, options);
|
|
104
|
+
}
|
|
105
|
+
function StackedBar(target, config) {
|
|
106
|
+
const { data, ...options } = config;
|
|
107
|
+
return createChart(target, stackedBarChartType, data, options);
|
|
108
|
+
}
|
|
109
|
+
function HorizontalBar(target, config) {
|
|
110
|
+
const { data, ...options } = config;
|
|
111
|
+
return createChart(target, horizontalBarChartType, data, options);
|
|
112
|
+
}
|
|
113
|
+
function Pie(target, config) {
|
|
114
|
+
const { data, ...options } = config;
|
|
115
|
+
return createChart(target, pieChartType, data, options);
|
|
116
|
+
}
|
|
117
|
+
function Donut(target, config) {
|
|
118
|
+
const { data, ...options } = config;
|
|
119
|
+
return createChart(target, donutChartType, data, options);
|
|
120
|
+
}
|
|
121
|
+
function Scatter(target, config) {
|
|
122
|
+
const { data, ...options } = config;
|
|
123
|
+
return createChart(target, scatterChartType, data, options);
|
|
124
|
+
}
|
|
125
|
+
function Sparkline(target, config) {
|
|
126
|
+
const { data, ...options } = config;
|
|
127
|
+
return createChart(target, sparklineChartType, data, options);
|
|
128
|
+
}
|
|
129
|
+
function Area(target, config) {
|
|
130
|
+
const { data, ...options } = config;
|
|
131
|
+
return createChart(target, areaChartType, data, options);
|
|
132
|
+
}
|
|
133
|
+
function Radar(target, config) {
|
|
134
|
+
const { data, ...options } = config;
|
|
135
|
+
return createChart(target, radarChartType, data, options);
|
|
136
|
+
}
|
|
137
|
+
function Bubble(target, config) {
|
|
138
|
+
const { data, ...options } = config;
|
|
139
|
+
return createChart(target, bubbleChartType, data, options);
|
|
140
|
+
}
|
|
141
|
+
function Candlestick(target, config) {
|
|
142
|
+
const { data, ...options } = config;
|
|
143
|
+
return createChart(target, candlestickChartType, data, options);
|
|
144
|
+
}
|
|
145
|
+
function Gauge(target, config) {
|
|
146
|
+
const { data, ...options } = config;
|
|
147
|
+
return createChart(target, gaugeChartType, data, options);
|
|
148
|
+
}
|
|
149
|
+
function Waterfall(target, config) {
|
|
150
|
+
const { data, ...options } = config;
|
|
151
|
+
return createChart(target, waterfallChartType, data, options);
|
|
152
|
+
}
|
|
153
|
+
function Funnel(target, config) {
|
|
154
|
+
const { data, ...options } = config;
|
|
155
|
+
return createChart(target, funnelChartType, data, options);
|
|
156
|
+
}
|
|
157
|
+
function Heatmap(target, config) {
|
|
158
|
+
const { data, ...options } = config;
|
|
159
|
+
return createChart(target, heatmapChartType, data, options);
|
|
160
|
+
}
|
|
161
|
+
function Boxplot(target, config) {
|
|
162
|
+
const { data, ...options } = config;
|
|
163
|
+
return createChart(target, boxplotChartType, data, options);
|
|
164
|
+
}
|
|
165
|
+
function Histogram(target, config) {
|
|
166
|
+
const { data, ...options } = config;
|
|
167
|
+
return createChart(target, histogramChartType, data, options);
|
|
168
|
+
}
|
|
169
|
+
function Treemap(target, config) {
|
|
170
|
+
const { data, ...options } = config;
|
|
171
|
+
return createChart(target, treemapChartType, data, options);
|
|
172
|
+
}
|
|
173
|
+
function Polar(target, config) {
|
|
174
|
+
const { data, ...options } = config;
|
|
175
|
+
return createChart(target, polarChartType, data, options);
|
|
176
|
+
}
|
|
177
|
+
function RadialBar(target, config) {
|
|
178
|
+
const { data, ...options } = config;
|
|
179
|
+
return createChart(target, radialBarChartType, data, options);
|
|
180
|
+
}
|
|
181
|
+
function Lollipop(target, config) {
|
|
182
|
+
const { data, ...options } = config;
|
|
183
|
+
return createChart(target, lollipopChartType, data, options);
|
|
184
|
+
}
|
|
185
|
+
function Bullet(target, config) {
|
|
186
|
+
const { data, ...options } = config;
|
|
187
|
+
return createChart(target, bulletChartType, data, options);
|
|
188
|
+
}
|
|
189
|
+
function Dumbbell(target, config) {
|
|
190
|
+
const { data, ...options } = config;
|
|
191
|
+
return createChart(target, dumbbellChartType, data, options);
|
|
192
|
+
}
|
|
193
|
+
function Calendar(target, config) {
|
|
194
|
+
const { data, ...options } = config;
|
|
195
|
+
return createChart(target, calendarChartType, data, options);
|
|
196
|
+
}
|
|
197
|
+
function Combo(target, config) {
|
|
198
|
+
const { data, ...options } = config;
|
|
199
|
+
return createChart(target, comboChartType, data, options);
|
|
200
|
+
}
|
|
201
|
+
function Sankey(target, config) {
|
|
202
|
+
const { data, ...options } = config;
|
|
203
|
+
return createChart(target, sankeyChartType, data, options);
|
|
204
|
+
}
|
|
205
|
+
function Sunburst(target, config) {
|
|
206
|
+
const { data, ...options } = config;
|
|
207
|
+
return createChart(target, sunburstChartType, data, options);
|
|
208
|
+
}
|
|
209
|
+
function Tree(target, config) {
|
|
210
|
+
const { data, ...options } = config;
|
|
211
|
+
return createChart(target, treeChartType, data, options);
|
|
212
|
+
}
|
|
213
|
+
function Graph(target, config) {
|
|
214
|
+
const { data, ...options } = config;
|
|
215
|
+
return createChart(target, graphChartType, data, options);
|
|
216
|
+
}
|
|
217
|
+
function Parallel(target, config) {
|
|
218
|
+
const { data, ...options } = config;
|
|
219
|
+
return createChart(target, parallelChartType, data, options);
|
|
220
|
+
}
|
|
221
|
+
function ThemeRiver(target, config) {
|
|
222
|
+
const { data, ...options } = config;
|
|
223
|
+
return createChart(target, themeRiverChartType, data, options);
|
|
224
|
+
}
|
|
225
|
+
function PictorialBar(target, config) {
|
|
226
|
+
const { data, ...options } = config;
|
|
227
|
+
return createChart(target, pictorialBarChartType, data, options);
|
|
228
|
+
}
|
|
229
|
+
function Chord(target, config) {
|
|
230
|
+
const { data, ...options } = config;
|
|
231
|
+
return createChart(target, chordChartType, data, options);
|
|
232
|
+
}
|
|
233
|
+
function Geo(target, config) {
|
|
234
|
+
const { data, ...options } = config;
|
|
235
|
+
return createChart(target, geoChartType, data, options);
|
|
236
|
+
}
|
|
237
|
+
function Lines(target, config) {
|
|
238
|
+
const { data, ...options } = config;
|
|
239
|
+
return createChart(target, linesChartType, data, options);
|
|
240
|
+
}
|
|
241
|
+
function Matrix(target, config) {
|
|
242
|
+
const { data, ...options } = config;
|
|
243
|
+
return createChart(target, matrixChartType, data, options);
|
|
244
|
+
}
|
|
245
|
+
function Custom(target, config) {
|
|
246
|
+
const { data, ...options } = config;
|
|
247
|
+
return createChart(target, customChartType, data, options);
|
|
248
|
+
}
|
|
249
|
+
function OHLC(target, config) {
|
|
250
|
+
const { data, ...options } = config;
|
|
251
|
+
return createChart(target, ohlcChartType, data, options);
|
|
252
|
+
}
|
|
253
|
+
function Step(target, config) {
|
|
254
|
+
const { data, ...options } = config;
|
|
255
|
+
return createChart(target, stepChartType, data, options);
|
|
256
|
+
}
|
|
257
|
+
function Volume(target, config) {
|
|
258
|
+
const { data, ...options } = config;
|
|
259
|
+
return createChart(target, volumeChartType, data, options);
|
|
260
|
+
}
|
|
261
|
+
function Range(target, config) {
|
|
262
|
+
const { data, ...options } = config;
|
|
263
|
+
return createChart(target, rangeChartType, data, options);
|
|
264
|
+
}
|
|
265
|
+
function Baseline(target, config) {
|
|
266
|
+
const { data, ...options } = config;
|
|
267
|
+
return createChart(target, baselineChartType, data, options);
|
|
268
|
+
}
|
|
269
|
+
function Kagi(target, config) {
|
|
270
|
+
const { data, ...options } = config;
|
|
271
|
+
return createChart(target, kagiChartType, data, options);
|
|
272
|
+
}
|
|
273
|
+
function Renko(target, config) {
|
|
274
|
+
const { data, ...options } = config;
|
|
275
|
+
return createChart(target, renkoChartType, data, options);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// src/interaction/link.ts
|
|
279
|
+
function linkCharts(...charts2) {
|
|
280
|
+
if (charts2.length < 2) return () => {
|
|
281
|
+
};
|
|
282
|
+
let broadcasting = false;
|
|
283
|
+
const unsubs = [];
|
|
284
|
+
for (const chart of charts2) {
|
|
285
|
+
const unsub = chart.on("crosshair:move", (payload) => {
|
|
286
|
+
if (broadcasting) return;
|
|
287
|
+
broadcasting = true;
|
|
288
|
+
const { x, label } = payload;
|
|
289
|
+
for (const other of charts2) {
|
|
290
|
+
if (other === chart) continue;
|
|
291
|
+
other._bus.emit("crosshair:move", { x, label });
|
|
292
|
+
}
|
|
293
|
+
broadcasting = false;
|
|
294
|
+
});
|
|
295
|
+
unsubs.push(unsub);
|
|
296
|
+
const unsubHide = chart.on("crosshair:hide", () => {
|
|
297
|
+
if (broadcasting) return;
|
|
298
|
+
broadcasting = true;
|
|
299
|
+
for (const other of charts2) {
|
|
300
|
+
if (other === chart) continue;
|
|
301
|
+
other._bus.emit("crosshair:hide", void 0);
|
|
302
|
+
}
|
|
303
|
+
broadcasting = false;
|
|
304
|
+
});
|
|
305
|
+
unsubs.push(unsubHide);
|
|
306
|
+
}
|
|
307
|
+
return () => {
|
|
308
|
+
for (const unsub of unsubs) unsub();
|
|
309
|
+
unsubs.length = 0;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// src/data/streaming.ts
|
|
314
|
+
function createStreamingChart(chart, config = {}) {
|
|
315
|
+
const windowSize = config.windowSize ?? 100;
|
|
316
|
+
const seriesCount = config.seriesCount ?? 1;
|
|
317
|
+
const maxBuffer = config.maxBufferSize ?? windowSize * 10;
|
|
318
|
+
const throttleMs = config.throttleMs ?? 0;
|
|
319
|
+
const names = config.seriesNames ?? Array.from({ length: seriesCount }, (_, i) => `Series ${i + 1}`);
|
|
320
|
+
const colors = config.seriesColors ?? [];
|
|
321
|
+
const buffers = Array.from({ length: seriesCount }, () => []);
|
|
322
|
+
const labels = [];
|
|
323
|
+
let totalPushed = 0;
|
|
324
|
+
let paused = false;
|
|
325
|
+
let dirty = false;
|
|
326
|
+
let rafId = null;
|
|
327
|
+
let throttleTimer = null;
|
|
328
|
+
function scheduleUpdate() {
|
|
329
|
+
if (paused) {
|
|
330
|
+
dirty = true;
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (throttleMs > 0) {
|
|
334
|
+
if (throttleTimer !== null) return;
|
|
335
|
+
throttleTimer = setTimeout(() => {
|
|
336
|
+
throttleTimer = null;
|
|
337
|
+
flush();
|
|
338
|
+
}, throttleMs);
|
|
339
|
+
} else {
|
|
340
|
+
if (rafId !== null) return;
|
|
341
|
+
rafId = requestAnimationFrame(() => {
|
|
342
|
+
rafId = null;
|
|
343
|
+
flush();
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function flush() {
|
|
348
|
+
dirty = false;
|
|
349
|
+
const start = Math.max(0, labels.length - windowSize);
|
|
350
|
+
const windowLabels = labels.slice(start);
|
|
351
|
+
const series = buffers.map((buf, i) => ({
|
|
352
|
+
name: names[i] ?? `Series ${i + 1}`,
|
|
353
|
+
values: buf.slice(start),
|
|
354
|
+
...colors[i] ? { color: colors[i] } : {}
|
|
355
|
+
}));
|
|
356
|
+
const data = {
|
|
357
|
+
labels: windowLabels,
|
|
358
|
+
series
|
|
359
|
+
};
|
|
360
|
+
chart.setData(data);
|
|
361
|
+
}
|
|
362
|
+
function trimBuffer() {
|
|
363
|
+
if (labels.length <= maxBuffer) return;
|
|
364
|
+
const excess = labels.length - maxBuffer;
|
|
365
|
+
labels.splice(0, excess);
|
|
366
|
+
for (const buf of buffers) {
|
|
367
|
+
buf.splice(0, excess);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
push(values, label) {
|
|
372
|
+
totalPushed++;
|
|
373
|
+
const lbl = label ?? totalPushed;
|
|
374
|
+
labels.push(lbl);
|
|
375
|
+
for (let i = 0; i < seriesCount; i++) {
|
|
376
|
+
buffers[i].push(values[i] ?? 0);
|
|
377
|
+
}
|
|
378
|
+
trimBuffer();
|
|
379
|
+
scheduleUpdate();
|
|
380
|
+
},
|
|
381
|
+
pushBatch(points) {
|
|
382
|
+
for (const pt of points) {
|
|
383
|
+
totalPushed++;
|
|
384
|
+
const lbl = pt.label ?? totalPushed;
|
|
385
|
+
labels.push(lbl);
|
|
386
|
+
for (let i = 0; i < seriesCount; i++) {
|
|
387
|
+
buffers[i].push(pt.values[i] ?? 0);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
trimBuffer();
|
|
391
|
+
scheduleUpdate();
|
|
392
|
+
},
|
|
393
|
+
pause() {
|
|
394
|
+
paused = true;
|
|
395
|
+
},
|
|
396
|
+
resume() {
|
|
397
|
+
paused = false;
|
|
398
|
+
if (dirty) scheduleUpdate();
|
|
399
|
+
},
|
|
400
|
+
clear() {
|
|
401
|
+
labels.length = 0;
|
|
402
|
+
for (const buf of buffers) buf.length = 0;
|
|
403
|
+
totalPushed = 0;
|
|
404
|
+
dirty = false;
|
|
405
|
+
},
|
|
406
|
+
getBufferSize() {
|
|
407
|
+
return labels.length;
|
|
408
|
+
},
|
|
409
|
+
destroy() {
|
|
410
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
411
|
+
if (throttleTimer !== null) clearTimeout(throttleTimer);
|
|
412
|
+
labels.length = 0;
|
|
413
|
+
for (const buf of buffers) buf.length = 0;
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// src/features/dataset.ts
|
|
419
|
+
function getLabels(data) {
|
|
420
|
+
return data.labels ?? [];
|
|
421
|
+
}
|
|
422
|
+
function filterData(data, predicate) {
|
|
423
|
+
const labels = getLabels(data);
|
|
424
|
+
const keepIndices = labels.map(
|
|
425
|
+
(_, i) => data.series.some((s, si) => predicate(s.values[i] ?? 0, i, si)) ? i : -1
|
|
426
|
+
).filter((i) => i >= 0);
|
|
427
|
+
return {
|
|
428
|
+
...data,
|
|
429
|
+
series: data.series.map((s, si) => ({
|
|
430
|
+
...s,
|
|
431
|
+
values: s.values.filter((v, i) => predicate(v, i, si))
|
|
432
|
+
})),
|
|
433
|
+
labels: keepIndices.map((i) => labels[i])
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function filterSeries(data, keep) {
|
|
437
|
+
return {
|
|
438
|
+
...data,
|
|
439
|
+
series: data.series.filter(
|
|
440
|
+
(s, i) => keep.includes(s.name) || keep.includes(i)
|
|
441
|
+
)
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
function filterLabels(data, keep) {
|
|
445
|
+
const labels = getLabels(data);
|
|
446
|
+
const keepSet = new Set(keep.map(String));
|
|
447
|
+
const indices = labels.map((l, i) => keepSet.has(String(l)) ? i : -1).filter((i) => i >= 0);
|
|
448
|
+
return {
|
|
449
|
+
...data,
|
|
450
|
+
labels: indices.map((i) => labels[i]),
|
|
451
|
+
series: data.series.map((s) => ({
|
|
452
|
+
...s,
|
|
453
|
+
values: indices.map((i) => s.values[i] ?? 0)
|
|
454
|
+
}))
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
function sortData(data, by, direction = "asc") {
|
|
458
|
+
const labels = getLabels(data);
|
|
459
|
+
const indices = labels.map((_, i) => i);
|
|
460
|
+
const dir = direction === "asc" ? 1 : -1;
|
|
461
|
+
if (by === "label") {
|
|
462
|
+
indices.sort((a, b) => dir * String(labels[a]).localeCompare(String(labels[b])));
|
|
463
|
+
} else {
|
|
464
|
+
const series = data.series[by];
|
|
465
|
+
if (series) {
|
|
466
|
+
indices.sort((a, b) => dir * ((series.values[a] ?? 0) - (series.values[b] ?? 0)));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
...data,
|
|
471
|
+
labels: indices.map((i) => labels[i]),
|
|
472
|
+
series: data.series.map((s) => ({
|
|
473
|
+
...s,
|
|
474
|
+
values: indices.map((i) => s.values[i] ?? 0)
|
|
475
|
+
}))
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function aggregateData(data, fn = "sum") {
|
|
479
|
+
const labels = getLabels(data);
|
|
480
|
+
const agg = getAggFn(fn);
|
|
481
|
+
const values = labels.map((_, i) => {
|
|
482
|
+
const vals = data.series.map((s) => s.values[i] ?? 0);
|
|
483
|
+
return agg(vals);
|
|
484
|
+
});
|
|
485
|
+
return {
|
|
486
|
+
...data,
|
|
487
|
+
series: [{ name: fn, values }]
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
function getAggFn(fn) {
|
|
491
|
+
switch (fn) {
|
|
492
|
+
case "sum":
|
|
493
|
+
return (vals) => vals.reduce((a, b) => a + b, 0);
|
|
494
|
+
case "avg":
|
|
495
|
+
return (vals) => vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
|
|
496
|
+
case "min":
|
|
497
|
+
return (vals) => Math.min(...vals);
|
|
498
|
+
case "max":
|
|
499
|
+
return (vals) => Math.max(...vals);
|
|
500
|
+
case "count":
|
|
501
|
+
return (vals) => vals.filter((v) => v !== 0).length;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function transformData(data, ...transforms) {
|
|
505
|
+
return transforms.reduce((d, fn) => fn(d), data);
|
|
506
|
+
}
|
|
507
|
+
function pivotData(data) {
|
|
508
|
+
const labels = getLabels(data);
|
|
509
|
+
const newLabels = data.series.map((s) => s.name);
|
|
510
|
+
const newSeries = labels.map((label, i) => ({
|
|
511
|
+
name: String(label),
|
|
512
|
+
values: data.series.map((s) => s.values[i] ?? 0)
|
|
513
|
+
}));
|
|
514
|
+
return { labels: newLabels, series: newSeries };
|
|
515
|
+
}
|
|
516
|
+
function sliceData(data, start, end) {
|
|
517
|
+
const labels = getLabels(data);
|
|
518
|
+
return {
|
|
519
|
+
...data,
|
|
520
|
+
labels: labels.slice(start, end),
|
|
521
|
+
series: data.series.map((s) => ({
|
|
522
|
+
...s,
|
|
523
|
+
values: s.values.slice(start, end)
|
|
524
|
+
}))
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// src/features/datazoom.ts
|
|
529
|
+
function createDataZoomState(initial, onChange) {
|
|
530
|
+
const range = {
|
|
531
|
+
start: initial?.start ?? 0,
|
|
532
|
+
end: initial?.end ?? 1
|
|
533
|
+
};
|
|
534
|
+
function clamp() {
|
|
535
|
+
range.start = Math.max(0, Math.min(range.start, 1));
|
|
536
|
+
range.end = Math.max(range.start + 0.01, Math.min(range.end, 1));
|
|
537
|
+
onChange?.(range);
|
|
538
|
+
}
|
|
539
|
+
return {
|
|
540
|
+
range,
|
|
541
|
+
setRange(start, end) {
|
|
542
|
+
range.start = start;
|
|
543
|
+
range.end = end;
|
|
544
|
+
clamp();
|
|
545
|
+
},
|
|
546
|
+
reset() {
|
|
547
|
+
range.start = 0;
|
|
548
|
+
range.end = 1;
|
|
549
|
+
onChange?.(range);
|
|
550
|
+
},
|
|
551
|
+
zoomIn(factor = 0.1) {
|
|
552
|
+
const center = (range.start + range.end) / 2;
|
|
553
|
+
const halfSpan = (range.end - range.start) / 2 * (1 - factor);
|
|
554
|
+
range.start = center - halfSpan;
|
|
555
|
+
range.end = center + halfSpan;
|
|
556
|
+
clamp();
|
|
557
|
+
},
|
|
558
|
+
zoomOut(factor = 0.1) {
|
|
559
|
+
const center = (range.start + range.end) / 2;
|
|
560
|
+
const halfSpan = (range.end - range.start) / 2 * (1 + factor);
|
|
561
|
+
range.start = center - halfSpan;
|
|
562
|
+
range.end = center + halfSpan;
|
|
563
|
+
clamp();
|
|
564
|
+
},
|
|
565
|
+
panLeft(amount = 0.05) {
|
|
566
|
+
const span = range.end - range.start;
|
|
567
|
+
range.start = Math.max(0, range.start - amount);
|
|
568
|
+
range.end = range.start + span;
|
|
569
|
+
clamp();
|
|
570
|
+
},
|
|
571
|
+
panRight(amount = 0.05) {
|
|
572
|
+
const span = range.end - range.start;
|
|
573
|
+
range.end = Math.min(1, range.end + amount);
|
|
574
|
+
range.start = range.end - span;
|
|
575
|
+
clamp();
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function applyDataZoom(data, range) {
|
|
580
|
+
const labels = data.labels ?? [];
|
|
581
|
+
const total = labels.length;
|
|
582
|
+
if (total === 0) return data;
|
|
583
|
+
const startIdx = Math.floor(range.start * total);
|
|
584
|
+
const endIdx = Math.ceil(range.end * total);
|
|
585
|
+
return {
|
|
586
|
+
...data,
|
|
587
|
+
labels: labels.slice(startIdx, endIdx),
|
|
588
|
+
series: data.series.map((s) => ({
|
|
589
|
+
...s,
|
|
590
|
+
values: s.values.slice(startIdx, endIdx)
|
|
591
|
+
}))
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
function renderDataZoomSlider(data, range, opts) {
|
|
595
|
+
const nodes = [];
|
|
596
|
+
const h = opts.height ?? 30;
|
|
597
|
+
const trackColor = opts.trackColor ?? "#e5e7eb";
|
|
598
|
+
const handleColor = opts.handleColor ?? "#6b7280";
|
|
599
|
+
const selectedColor = opts.selectedColor ?? "rgba(59,130,246,0.2)";
|
|
600
|
+
nodes.push(rect(opts.x, opts.y, opts.width, h, {
|
|
601
|
+
class: "chartts-datazoom-track",
|
|
602
|
+
fill: trackColor,
|
|
603
|
+
rx: 4,
|
|
604
|
+
ry: 4
|
|
605
|
+
}));
|
|
606
|
+
if (opts.showMinimap !== false && data.series[0]) {
|
|
607
|
+
const values = data.series[0].values;
|
|
608
|
+
const max = Math.max(...values.map(Math.abs), 1);
|
|
609
|
+
const pb = new PathBuilder();
|
|
610
|
+
for (let i = 0; i < values.length; i++) {
|
|
611
|
+
const x = opts.x + i / Math.max(values.length - 1, 1) * opts.width;
|
|
612
|
+
const y = opts.y + h - Math.abs(values[i]) / max * (h - 4) - 2;
|
|
613
|
+
if (i === 0) pb.moveTo(x, y);
|
|
614
|
+
else pb.lineTo(x, y);
|
|
615
|
+
}
|
|
616
|
+
nodes.push(path(pb.build(), {
|
|
617
|
+
class: "chartts-datazoom-minimap",
|
|
618
|
+
fill: "none",
|
|
619
|
+
stroke: handleColor,
|
|
620
|
+
strokeWidth: 1,
|
|
621
|
+
strokeOpacity: 0.4
|
|
622
|
+
}));
|
|
623
|
+
}
|
|
624
|
+
const selX = opts.x + range.start * opts.width;
|
|
625
|
+
const selW = (range.end - range.start) * opts.width;
|
|
626
|
+
nodes.push(rect(selX, opts.y, selW, h, {
|
|
627
|
+
class: "chartts-datazoom-selected",
|
|
628
|
+
fill: selectedColor,
|
|
629
|
+
rx: 2,
|
|
630
|
+
ry: 2
|
|
631
|
+
}));
|
|
632
|
+
nodes.push(rect(selX - 3, opts.y + 4, 6, h - 8, {
|
|
633
|
+
class: "chartts-datazoom-handle chartts-datazoom-handle-left",
|
|
634
|
+
fill: handleColor,
|
|
635
|
+
rx: 3,
|
|
636
|
+
ry: 3,
|
|
637
|
+
cursor: "ew-resize"
|
|
638
|
+
}));
|
|
639
|
+
nodes.push(rect(selX + selW - 3, opts.y + 4, 6, h - 8, {
|
|
640
|
+
class: "chartts-datazoom-handle chartts-datazoom-handle-right",
|
|
641
|
+
fill: handleColor,
|
|
642
|
+
rx: 3,
|
|
643
|
+
ry: 3,
|
|
644
|
+
cursor: "ew-resize"
|
|
645
|
+
}));
|
|
646
|
+
const dlabels = data.labels ?? [];
|
|
647
|
+
const total = dlabels.length;
|
|
648
|
+
const startIdx = Math.floor(range.start * total);
|
|
649
|
+
const endIdx = Math.min(Math.ceil(range.end * total) - 1, total - 1);
|
|
650
|
+
if (total > 0) {
|
|
651
|
+
nodes.push(text(selX, opts.y + h + 12, String(dlabels[startIdx] ?? ""), {
|
|
652
|
+
class: "chartts-datazoom-label",
|
|
653
|
+
fill: handleColor,
|
|
654
|
+
textAnchor: "start",
|
|
655
|
+
fontSize: 9
|
|
656
|
+
}));
|
|
657
|
+
nodes.push(text(selX + selW, opts.y + h + 12, String(dlabels[endIdx] ?? ""), {
|
|
658
|
+
class: "chartts-datazoom-label",
|
|
659
|
+
fill: handleColor,
|
|
660
|
+
textAnchor: "end",
|
|
661
|
+
fontSize: 9
|
|
662
|
+
}));
|
|
663
|
+
}
|
|
664
|
+
return nodes;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// src/features/datazoom-widget.ts
|
|
668
|
+
function createDataZoomWidget(options) {
|
|
669
|
+
const h = options.height ?? 40;
|
|
670
|
+
const trackColor = options.trackColor ?? "#e5e7eb";
|
|
671
|
+
const handleColor = options.handleColor ?? "#6b7280";
|
|
672
|
+
const selectedColor = options.selectedColor ?? "rgba(59,130,246,0.25)";
|
|
673
|
+
const minimapColor = options.minimapColor ?? "#9ca3af";
|
|
674
|
+
let currentData = options.data;
|
|
675
|
+
const state = createDataZoomState(
|
|
676
|
+
options.initialRange,
|
|
677
|
+
(range) => {
|
|
678
|
+
updateLayout();
|
|
679
|
+
options.onChange?.(range);
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
const root = document.createElement("div");
|
|
683
|
+
root.className = "chartts-datazoom-widget";
|
|
684
|
+
root.style.cssText = `position:relative;height:${h}px;width:100%;user-select:none;touch-action:none;`;
|
|
685
|
+
const track = document.createElement("div");
|
|
686
|
+
track.className = "chartts-datazoom-track";
|
|
687
|
+
track.style.cssText = `position:absolute;inset:0;background:${trackColor};border-radius:4px;overflow:hidden;`;
|
|
688
|
+
root.appendChild(track);
|
|
689
|
+
const minimap = document.createElement("canvas");
|
|
690
|
+
minimap.className = "chartts-datazoom-minimap";
|
|
691
|
+
minimap.style.cssText = "position:absolute;inset:0;width:100%;height:100%;";
|
|
692
|
+
track.appendChild(minimap);
|
|
693
|
+
const maskLeft = document.createElement("div");
|
|
694
|
+
maskLeft.style.cssText = `position:absolute;top:0;left:0;height:100%;background:rgba(0,0,0,0.15);border-radius:4px 0 0 4px;pointer-events:none;`;
|
|
695
|
+
root.appendChild(maskLeft);
|
|
696
|
+
const maskRight = document.createElement("div");
|
|
697
|
+
maskRight.style.cssText = `position:absolute;top:0;right:0;height:100%;background:rgba(0,0,0,0.15);border-radius:0 4px 4px 0;pointer-events:none;`;
|
|
698
|
+
root.appendChild(maskRight);
|
|
699
|
+
const selected = document.createElement("div");
|
|
700
|
+
selected.className = "chartts-datazoom-selected";
|
|
701
|
+
selected.style.cssText = `position:absolute;top:0;height:100%;background:${selectedColor};cursor:grab;border-top:2px solid ${handleColor};border-bottom:2px solid ${handleColor};`;
|
|
702
|
+
root.appendChild(selected);
|
|
703
|
+
const handleLeft = document.createElement("div");
|
|
704
|
+
handleLeft.className = "chartts-datazoom-handle-left";
|
|
705
|
+
handleLeft.style.cssText = `position:absolute;top:2px;width:8px;height:${h - 4}px;background:${handleColor};border-radius:4px;cursor:ew-resize;z-index:2;transform:translateX(-50%);`;
|
|
706
|
+
root.appendChild(handleLeft);
|
|
707
|
+
const handleRight = document.createElement("div");
|
|
708
|
+
handleRight.className = "chartts-datazoom-handle-right";
|
|
709
|
+
handleRight.style.cssText = `position:absolute;top:2px;width:8px;height:${h - 4}px;background:${handleColor};border-radius:4px;cursor:ew-resize;z-index:2;transform:translateX(-50%);`;
|
|
710
|
+
root.appendChild(handleRight);
|
|
711
|
+
function updateLayout() {
|
|
712
|
+
const w = root.clientWidth || root.offsetWidth || 300;
|
|
713
|
+
const { start, end } = state.range;
|
|
714
|
+
const leftPx = start * w;
|
|
715
|
+
const rightPx = end * w;
|
|
716
|
+
const selWidth = rightPx - leftPx;
|
|
717
|
+
maskLeft.style.width = `${leftPx}px`;
|
|
718
|
+
maskRight.style.width = `${w - rightPx}px`;
|
|
719
|
+
selected.style.left = `${leftPx}px`;
|
|
720
|
+
selected.style.width = `${selWidth}px`;
|
|
721
|
+
handleLeft.style.left = `${leftPx}px`;
|
|
722
|
+
handleRight.style.left = `${rightPx}px`;
|
|
723
|
+
}
|
|
724
|
+
function drawMinimap() {
|
|
725
|
+
const w = root.clientWidth || root.offsetWidth || 300;
|
|
726
|
+
const dpr = window.devicePixelRatio || 1;
|
|
727
|
+
minimap.width = Math.round(w * dpr);
|
|
728
|
+
minimap.height = Math.round(h * dpr);
|
|
729
|
+
minimap.style.width = `${w}px`;
|
|
730
|
+
minimap.style.height = `${h}px`;
|
|
731
|
+
const ctx = minimap.getContext("2d");
|
|
732
|
+
if (!ctx) return;
|
|
733
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
734
|
+
ctx.clearRect(0, 0, w, h);
|
|
735
|
+
const series = currentData.series[0];
|
|
736
|
+
if (!series || series.values.length === 0) return;
|
|
737
|
+
const values = series.values.filter((v) => !isNaN(v));
|
|
738
|
+
if (values.length === 0) return;
|
|
739
|
+
const max = Math.max(...values);
|
|
740
|
+
const min = Math.min(...values);
|
|
741
|
+
const range = max - min || 1;
|
|
742
|
+
const pad2 = 4;
|
|
743
|
+
ctx.beginPath();
|
|
744
|
+
ctx.strokeStyle = minimapColor;
|
|
745
|
+
ctx.lineWidth = 1;
|
|
746
|
+
ctx.globalAlpha = 0.5;
|
|
747
|
+
let started = false;
|
|
748
|
+
for (let i = 0; i < series.values.length; i++) {
|
|
749
|
+
const v = series.values[i];
|
|
750
|
+
if (isNaN(v)) continue;
|
|
751
|
+
const x = i / Math.max(series.values.length - 1, 1) * w;
|
|
752
|
+
const y = h - pad2 - (v - min) / range * (h - pad2 * 2);
|
|
753
|
+
if (!started) {
|
|
754
|
+
ctx.moveTo(x, y);
|
|
755
|
+
started = true;
|
|
756
|
+
} else ctx.lineTo(x, y);
|
|
757
|
+
}
|
|
758
|
+
ctx.stroke();
|
|
759
|
+
if (started) {
|
|
760
|
+
ctx.lineTo(w, h);
|
|
761
|
+
ctx.lineTo(0, h);
|
|
762
|
+
ctx.closePath();
|
|
763
|
+
ctx.fillStyle = minimapColor;
|
|
764
|
+
ctx.globalAlpha = 0.08;
|
|
765
|
+
ctx.fill();
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
let dragMode = null;
|
|
769
|
+
let dragStartX = 0;
|
|
770
|
+
let dragStartRange = { start: 0, end: 1 };
|
|
771
|
+
function toNormalized(clientX) {
|
|
772
|
+
const r = root.getBoundingClientRect();
|
|
773
|
+
return Math.max(0, Math.min(1, (clientX - r.left) / r.width));
|
|
774
|
+
}
|
|
775
|
+
function onPointerDown(e) {
|
|
776
|
+
const target = e.target;
|
|
777
|
+
if (target === handleLeft || target.closest(".chartts-datazoom-handle-left")) {
|
|
778
|
+
dragMode = "left";
|
|
779
|
+
} else if (target === handleRight || target.closest(".chartts-datazoom-handle-right")) {
|
|
780
|
+
dragMode = "right";
|
|
781
|
+
} else if (target === selected || target.closest(".chartts-datazoom-selected")) {
|
|
782
|
+
dragMode = "pan";
|
|
783
|
+
selected.style.cursor = "grabbing";
|
|
784
|
+
} else {
|
|
785
|
+
const pos = toNormalized(e.clientX);
|
|
786
|
+
const span = state.range.end - state.range.start;
|
|
787
|
+
state.setRange(pos - span / 2, pos + span / 2);
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
dragStartX = e.clientX;
|
|
791
|
+
dragStartRange = { ...state.range };
|
|
792
|
+
root.setPointerCapture(e.pointerId);
|
|
793
|
+
e.preventDefault();
|
|
794
|
+
}
|
|
795
|
+
function onPointerMove(e) {
|
|
796
|
+
if (!dragMode) return;
|
|
797
|
+
const dx = e.clientX - dragStartX;
|
|
798
|
+
const w = root.clientWidth || root.offsetWidth || 300;
|
|
799
|
+
const delta = dx / w;
|
|
800
|
+
if (dragMode === "left") {
|
|
801
|
+
state.setRange(
|
|
802
|
+
Math.min(dragStartRange.start + delta, state.range.end - 0.02),
|
|
803
|
+
state.range.end
|
|
804
|
+
);
|
|
805
|
+
} else if (dragMode === "right") {
|
|
806
|
+
state.setRange(
|
|
807
|
+
state.range.start,
|
|
808
|
+
Math.max(dragStartRange.end + delta, state.range.start + 0.02)
|
|
809
|
+
);
|
|
810
|
+
} else if (dragMode === "pan") {
|
|
811
|
+
const span = dragStartRange.end - dragStartRange.start;
|
|
812
|
+
let newStart = dragStartRange.start + delta;
|
|
813
|
+
let newEnd = dragStartRange.end + delta;
|
|
814
|
+
if (newStart < 0) {
|
|
815
|
+
newStart = 0;
|
|
816
|
+
newEnd = span;
|
|
817
|
+
}
|
|
818
|
+
if (newEnd > 1) {
|
|
819
|
+
newEnd = 1;
|
|
820
|
+
newStart = 1 - span;
|
|
821
|
+
}
|
|
822
|
+
state.setRange(newStart, newEnd);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
function onPointerUp(_e) {
|
|
826
|
+
dragMode = null;
|
|
827
|
+
selected.style.cursor = "grab";
|
|
828
|
+
}
|
|
829
|
+
function onDblClick() {
|
|
830
|
+
state.reset();
|
|
831
|
+
}
|
|
832
|
+
root.addEventListener("pointerdown", onPointerDown);
|
|
833
|
+
root.addEventListener("pointermove", onPointerMove);
|
|
834
|
+
root.addEventListener("pointerup", onPointerUp);
|
|
835
|
+
root.addEventListener("dblclick", onDblClick);
|
|
836
|
+
let resizeObserver = null;
|
|
837
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
838
|
+
resizeObserver = new ResizeObserver(() => {
|
|
839
|
+
updateLayout();
|
|
840
|
+
drawMinimap();
|
|
841
|
+
});
|
|
842
|
+
resizeObserver.observe(root);
|
|
843
|
+
}
|
|
844
|
+
requestAnimationFrame(() => {
|
|
845
|
+
updateLayout();
|
|
846
|
+
drawMinimap();
|
|
847
|
+
});
|
|
848
|
+
return {
|
|
849
|
+
element: root,
|
|
850
|
+
state,
|
|
851
|
+
setData(data) {
|
|
852
|
+
currentData = data;
|
|
853
|
+
drawMinimap();
|
|
854
|
+
},
|
|
855
|
+
destroy() {
|
|
856
|
+
resizeObserver?.disconnect();
|
|
857
|
+
root.removeEventListener("pointerdown", onPointerDown);
|
|
858
|
+
root.removeEventListener("pointermove", onPointerMove);
|
|
859
|
+
root.removeEventListener("pointerup", onPointerUp);
|
|
860
|
+
root.removeEventListener("dblclick", onDblClick);
|
|
861
|
+
root.remove();
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// src/features/graphic.ts
|
|
867
|
+
function createGraphicElements(elements, area) {
|
|
868
|
+
return elements.map((el) => resolveElement(el, area)).filter(Boolean);
|
|
869
|
+
}
|
|
870
|
+
function resolveElement(el, area) {
|
|
871
|
+
const resolve = (v, dim) => {
|
|
872
|
+
if (v === void 0) return 0;
|
|
873
|
+
if (el.position === "relative" && area) {
|
|
874
|
+
return dim === "x" ? area.x + v * area.width : area.y + v * area.height;
|
|
875
|
+
}
|
|
876
|
+
return v;
|
|
877
|
+
};
|
|
878
|
+
const resolveSize = (v, dim) => {
|
|
879
|
+
if (v === void 0) return 0;
|
|
880
|
+
if (el.position === "relative" && area) {
|
|
881
|
+
return dim === "w" ? v * area.width : v * area.height;
|
|
882
|
+
}
|
|
883
|
+
return v;
|
|
884
|
+
};
|
|
885
|
+
const attrs = {
|
|
886
|
+
class: "chartts-graphic",
|
|
887
|
+
...el.attrs
|
|
888
|
+
};
|
|
889
|
+
switch (el.type) {
|
|
890
|
+
case "rect":
|
|
891
|
+
return rect(
|
|
892
|
+
resolve(el.x, "x"),
|
|
893
|
+
resolve(el.y, "y"),
|
|
894
|
+
resolveSize(el.width, "w"),
|
|
895
|
+
resolveSize(el.height, "h"),
|
|
896
|
+
attrs
|
|
897
|
+
);
|
|
898
|
+
case "circle":
|
|
899
|
+
return circle(
|
|
900
|
+
resolve(el.x, "x"),
|
|
901
|
+
resolve(el.y, "y"),
|
|
902
|
+
el.r ?? 10,
|
|
903
|
+
attrs
|
|
904
|
+
);
|
|
905
|
+
case "path":
|
|
906
|
+
return el.d ? path(el.d, attrs) : null;
|
|
907
|
+
case "text":
|
|
908
|
+
return text(
|
|
909
|
+
resolve(el.x, "x"),
|
|
910
|
+
resolve(el.y, "y"),
|
|
911
|
+
el.content ?? "",
|
|
912
|
+
attrs
|
|
913
|
+
);
|
|
914
|
+
case "line":
|
|
915
|
+
return line(
|
|
916
|
+
resolve(el.x, "x"),
|
|
917
|
+
resolve(el.y, "y"),
|
|
918
|
+
resolve(el.x2, "x"),
|
|
919
|
+
resolve(el.y2, "y"),
|
|
920
|
+
attrs
|
|
921
|
+
);
|
|
922
|
+
case "group": {
|
|
923
|
+
const children = (el.children ?? []).map((c) => resolveElement(c, area)).filter(Boolean);
|
|
924
|
+
return group(children, attrs);
|
|
925
|
+
}
|
|
926
|
+
case "image":
|
|
927
|
+
return {
|
|
928
|
+
type: "image",
|
|
929
|
+
attrs: {
|
|
930
|
+
...attrs,
|
|
931
|
+
href: el.src ?? "",
|
|
932
|
+
x: resolve(el.x, "x"),
|
|
933
|
+
y: resolve(el.y, "y"),
|
|
934
|
+
width: resolveSize(el.width, "w"),
|
|
935
|
+
height: resolveSize(el.height, "h")
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
default:
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
function horizontalLine(y, area, attrs) {
|
|
943
|
+
return line(area.x, y, area.x + area.width, y, {
|
|
944
|
+
class: "chartts-graphic-guideline",
|
|
945
|
+
stroke: "#6b7280",
|
|
946
|
+
strokeWidth: 1,
|
|
947
|
+
strokeDasharray: "4,3",
|
|
948
|
+
...attrs
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
function verticalLine(x, area, attrs) {
|
|
952
|
+
return line(x, area.y, x, area.y + area.height, {
|
|
953
|
+
class: "chartts-graphic-guideline",
|
|
954
|
+
stroke: "#6b7280",
|
|
955
|
+
strokeWidth: 1,
|
|
956
|
+
strokeDasharray: "4,3",
|
|
957
|
+
...attrs
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
function annotation(x, y, content, attrs) {
|
|
961
|
+
return text(x, y, content, {
|
|
962
|
+
class: "chartts-graphic-annotation",
|
|
963
|
+
fill: "#374151",
|
|
964
|
+
fontSize: 11,
|
|
965
|
+
textAnchor: "middle",
|
|
966
|
+
dominantBaseline: "auto",
|
|
967
|
+
...attrs
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
// src/features/richtext.ts
|
|
972
|
+
function parseRichText(input, options = {}) {
|
|
973
|
+
const spans = parse(input, options.defaults ?? {}, options.styles ?? {});
|
|
974
|
+
const tspans = spans.map((span) => ({
|
|
975
|
+
type: "tspan",
|
|
976
|
+
attrs: {
|
|
977
|
+
...span.style.fontWeight ? { fontWeight: span.style.fontWeight } : {},
|
|
978
|
+
...span.style.fontStyle ? { fontStyle: span.style.fontStyle } : {},
|
|
979
|
+
...span.style.fill ? { fill: span.style.fill } : {},
|
|
980
|
+
...span.style.fontSize ? { fontSize: span.style.fontSize } : {},
|
|
981
|
+
...span.style.fontFamily ? { fontFamily: span.style.fontFamily } : {},
|
|
982
|
+
...span.style.textDecoration ? { textDecoration: span.style.textDecoration } : {}
|
|
983
|
+
},
|
|
984
|
+
children: [],
|
|
985
|
+
text: span.text
|
|
986
|
+
}));
|
|
987
|
+
return {
|
|
988
|
+
type: "text",
|
|
989
|
+
x: options.x ?? 0,
|
|
990
|
+
y: options.y ?? 0,
|
|
991
|
+
text: "",
|
|
992
|
+
attrs: {
|
|
993
|
+
class: "chartts-richtext",
|
|
994
|
+
...options.attrs
|
|
995
|
+
},
|
|
996
|
+
children: tspans
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
function richLabel(label, value, opts) {
|
|
1000
|
+
const color = opts?.valueColor ?? "#3b82f6";
|
|
1001
|
+
const weight = opts?.valueWeight ?? "";
|
|
1002
|
+
const valueStr = typeof value === "number" ? formatNum(value) : value;
|
|
1003
|
+
const weightTag = weight ? `{b}${valueStr}{/b}` : valueStr;
|
|
1004
|
+
return `{b}${label}{/b}: {color:${color}}${weightTag}{/color}`;
|
|
1005
|
+
}
|
|
1006
|
+
function parse(input, defaults, namedStyles) {
|
|
1007
|
+
const spans = [];
|
|
1008
|
+
const styleStack = [{ ...defaults }];
|
|
1009
|
+
const regex = /\{(b|\/b|i|\/i|color:([^}]+)|\/color|size:([^}]+)|\/size|style:([^}]+)|\/style)\}|\*\*(.+?)\*\*|\*(.+?)\*/g;
|
|
1010
|
+
let lastIndex = 0;
|
|
1011
|
+
let match;
|
|
1012
|
+
while ((match = regex.exec(input)) !== null) {
|
|
1013
|
+
if (match.index > lastIndex) {
|
|
1014
|
+
spans.push({ text: input.slice(lastIndex, match.index), style: currentStyle(styleStack) });
|
|
1015
|
+
}
|
|
1016
|
+
const tag = match[1];
|
|
1017
|
+
const boldShorthand = match[5];
|
|
1018
|
+
const italicShorthand = match[6];
|
|
1019
|
+
if (boldShorthand) {
|
|
1020
|
+
spans.push({ text: boldShorthand, style: { ...currentStyle(styleStack), fontWeight: 700 } });
|
|
1021
|
+
} else if (italicShorthand) {
|
|
1022
|
+
spans.push({ text: italicShorthand, style: { ...currentStyle(styleStack), fontStyle: "italic" } });
|
|
1023
|
+
} else if (tag === "b") {
|
|
1024
|
+
styleStack.push({ ...currentStyle(styleStack), fontWeight: 700 });
|
|
1025
|
+
} else if (tag === "/b") {
|
|
1026
|
+
popStyle(styleStack);
|
|
1027
|
+
} else if (tag === "i") {
|
|
1028
|
+
styleStack.push({ ...currentStyle(styleStack), fontStyle: "italic" });
|
|
1029
|
+
} else if (tag === "/i") {
|
|
1030
|
+
popStyle(styleStack);
|
|
1031
|
+
} else if (tag?.startsWith("color:")) {
|
|
1032
|
+
styleStack.push({ ...currentStyle(styleStack), fill: match[2] });
|
|
1033
|
+
} else if (tag === "/color") {
|
|
1034
|
+
popStyle(styleStack);
|
|
1035
|
+
} else if (tag?.startsWith("size:")) {
|
|
1036
|
+
styleStack.push({ ...currentStyle(styleStack), fontSize: parseFloat(match[3]) || 12 });
|
|
1037
|
+
} else if (tag === "/size") {
|
|
1038
|
+
popStyle(styleStack);
|
|
1039
|
+
} else if (tag?.startsWith("style:")) {
|
|
1040
|
+
const named = namedStyles[match[4]];
|
|
1041
|
+
if (named) {
|
|
1042
|
+
styleStack.push({ ...currentStyle(styleStack), ...named });
|
|
1043
|
+
}
|
|
1044
|
+
} else if (tag === "/style") {
|
|
1045
|
+
popStyle(styleStack);
|
|
1046
|
+
}
|
|
1047
|
+
lastIndex = match.index + match[0].length;
|
|
1048
|
+
}
|
|
1049
|
+
if (lastIndex < input.length) {
|
|
1050
|
+
spans.push({ text: input.slice(lastIndex), style: currentStyle(styleStack) });
|
|
1051
|
+
}
|
|
1052
|
+
return spans;
|
|
1053
|
+
}
|
|
1054
|
+
function currentStyle(stack) {
|
|
1055
|
+
return { ...stack[stack.length - 1] };
|
|
1056
|
+
}
|
|
1057
|
+
function popStyle(stack) {
|
|
1058
|
+
if (stack.length > 1) stack.pop();
|
|
1059
|
+
}
|
|
1060
|
+
function formatNum(n) {
|
|
1061
|
+
return n.toLocaleString();
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// src/registry/registry.ts
|
|
1065
|
+
var charts = /* @__PURE__ */ new Map();
|
|
1066
|
+
var scales = /* @__PURE__ */ new Map();
|
|
1067
|
+
function registerChart(plugin) {
|
|
1068
|
+
if (charts.has(plugin.type)) {
|
|
1069
|
+
throw new Error(`[chartts] Chart type "${plugin.type}" already registered.`);
|
|
1070
|
+
}
|
|
1071
|
+
charts.set(plugin.type, plugin);
|
|
1072
|
+
}
|
|
1073
|
+
function getChart(type) {
|
|
1074
|
+
const plugin = charts.get(type);
|
|
1075
|
+
if (!plugin) {
|
|
1076
|
+
const available = Array.from(charts.keys()).join(", ") || "none";
|
|
1077
|
+
throw new Error(`[chartts] Unknown chart type "${type}". Registered: ${available}`);
|
|
1078
|
+
}
|
|
1079
|
+
return plugin;
|
|
1080
|
+
}
|
|
1081
|
+
function registerScale(type, factory) {
|
|
1082
|
+
scales.set(type, factory);
|
|
1083
|
+
}
|
|
1084
|
+
function getScaleFactory(type) {
|
|
1085
|
+
const factory = scales.get(type);
|
|
1086
|
+
if (!factory) {
|
|
1087
|
+
throw new Error(`[chartts] Unknown scale type "${type}".`);
|
|
1088
|
+
}
|
|
1089
|
+
return factory;
|
|
1090
|
+
}
|
|
1091
|
+
function clearRegistry() {
|
|
1092
|
+
charts.clear();
|
|
1093
|
+
scales.clear();
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// src/scales/time.ts
|
|
1097
|
+
var S = 1e3;
|
|
1098
|
+
var M = 60 * S;
|
|
1099
|
+
var H = 60 * M;
|
|
1100
|
+
var D = 24 * H;
|
|
1101
|
+
var W = 7 * D;
|
|
1102
|
+
var MO = 30 * D;
|
|
1103
|
+
var Y = 365 * D;
|
|
1104
|
+
var INTERVALS = [
|
|
1105
|
+
{ ms: S, fmt: fmtTime },
|
|
1106
|
+
{ ms: 5 * S, fmt: fmtTime },
|
|
1107
|
+
{ ms: 15 * S, fmt: fmtTime },
|
|
1108
|
+
{ ms: 30 * S, fmt: fmtTime },
|
|
1109
|
+
{ ms: M, fmt: fmtTime },
|
|
1110
|
+
{ ms: 5 * M, fmt: fmtTime },
|
|
1111
|
+
{ ms: 15 * M, fmt: fmtTime },
|
|
1112
|
+
{ ms: H, fmt: fmtTime },
|
|
1113
|
+
{ ms: 3 * H, fmt: fmtTime },
|
|
1114
|
+
{ ms: 6 * H, fmt: fmtTime },
|
|
1115
|
+
{ ms: 12 * H, fmt: fmtTime },
|
|
1116
|
+
{ ms: D, fmt: fmtDate },
|
|
1117
|
+
{ ms: W, fmt: fmtDate },
|
|
1118
|
+
{ ms: MO, fmt: fmtMonthYear },
|
|
1119
|
+
{ ms: 3 * MO, fmt: fmtMonthYear },
|
|
1120
|
+
{ ms: 6 * MO, fmt: fmtMonthYear },
|
|
1121
|
+
{ ms: Y, fmt: fmtYear },
|
|
1122
|
+
{ ms: 5 * Y, fmt: fmtYear },
|
|
1123
|
+
{ ms: 10 * Y, fmt: fmtYear }
|
|
1124
|
+
];
|
|
1125
|
+
function createTimeScale(opts) {
|
|
1126
|
+
let dMin = ts(opts?.domain?.[0] ?? 0);
|
|
1127
|
+
let dMax = ts(opts?.domain?.[1] ?? Date.now());
|
|
1128
|
+
let rMin = opts?.range?.[0] ?? 0;
|
|
1129
|
+
let rMax = opts?.range?.[1] ?? 1;
|
|
1130
|
+
const customFmt = opts?.format;
|
|
1131
|
+
function map(value) {
|
|
1132
|
+
const v = ts(value);
|
|
1133
|
+
const span = dMax - dMin;
|
|
1134
|
+
if (span === 0) return (rMin + rMax) / 2;
|
|
1135
|
+
return rMin + (v - dMin) / span * (rMax - rMin);
|
|
1136
|
+
}
|
|
1137
|
+
function invert(px) {
|
|
1138
|
+
const span = rMax - rMin;
|
|
1139
|
+
if (span === 0) return (dMin + dMax) / 2;
|
|
1140
|
+
return dMin + (px - rMin) / span * (dMax - dMin);
|
|
1141
|
+
}
|
|
1142
|
+
function ticks(count = 6) {
|
|
1143
|
+
const span = dMax - dMin;
|
|
1144
|
+
if (span <= 0) return [];
|
|
1145
|
+
const target = span / count;
|
|
1146
|
+
const interval = INTERVALS.find((i) => i.ms >= target) ?? INTERVALS[INTERVALS.length - 1];
|
|
1147
|
+
const fmt = customFmt ?? interval.fmt;
|
|
1148
|
+
const result = [];
|
|
1149
|
+
const start = Math.ceil(dMin / interval.ms) * interval.ms;
|
|
1150
|
+
for (let t = start; t <= dMax; t += interval.ms) {
|
|
1151
|
+
const d = new Date(t);
|
|
1152
|
+
result.push({ value: d, position: map(t), label: fmt(d) });
|
|
1153
|
+
}
|
|
1154
|
+
return result;
|
|
1155
|
+
}
|
|
1156
|
+
return {
|
|
1157
|
+
map,
|
|
1158
|
+
invert,
|
|
1159
|
+
ticks,
|
|
1160
|
+
setDomain(min, max) {
|
|
1161
|
+
dMin = ts(min);
|
|
1162
|
+
dMax = ts(max);
|
|
1163
|
+
},
|
|
1164
|
+
setRange(min, max) {
|
|
1165
|
+
rMin = min;
|
|
1166
|
+
rMax = max;
|
|
1167
|
+
},
|
|
1168
|
+
getDomain() {
|
|
1169
|
+
return [new Date(dMin), new Date(dMax)];
|
|
1170
|
+
},
|
|
1171
|
+
getRange() {
|
|
1172
|
+
return [rMin, rMax];
|
|
1173
|
+
},
|
|
1174
|
+
bandwidth() {
|
|
1175
|
+
return 0;
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function ts(v) {
|
|
1180
|
+
return v instanceof Date ? v.getTime() : typeof v === "string" ? new Date(v).getTime() : v;
|
|
1181
|
+
}
|
|
1182
|
+
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
1183
|
+
function pad(n) {
|
|
1184
|
+
return n < 10 ? `0${n}` : String(n);
|
|
1185
|
+
}
|
|
1186
|
+
function fmtTime(d) {
|
|
1187
|
+
return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
1188
|
+
}
|
|
1189
|
+
function fmtDate(d) {
|
|
1190
|
+
return `${MONTHS[d.getMonth()]} ${d.getDate()}`;
|
|
1191
|
+
}
|
|
1192
|
+
function fmtMonthYear(d) {
|
|
1193
|
+
return `${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
1194
|
+
}
|
|
1195
|
+
function fmtYear(d) {
|
|
1196
|
+
return String(d.getFullYear());
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
export { Area, Bar, Baseline, Boxplot, Bubble, Bullet, Calendar, Candlestick, Chord, Combo, Custom, Donut, Dumbbell, Funnel, Gauge, Geo, Graph, Heatmap, Histogram, HorizontalBar, Kagi, Line, Lines, Lollipop, Matrix, OHLC, Parallel, PictorialBar, Pie, Polar, Radar, RadialBar, Range, Renko, Sankey, Scatter, Sparkline, StackedBar, Step, Sunburst, ThemeRiver, Tree, Treemap, Volume, Waterfall, aggregateData, annotation, applyDataZoom, clearRegistry, createDataZoomState, createDataZoomWidget, createGraphicElements, createStreamingChart, createTimeScale, filterData, filterLabels, filterSeries, getChart, getScaleFactory, horizontalLine, linkCharts, parseRichText, pivotData, registerChart, registerScale, renderDataZoomSlider, richLabel, sliceData, sortData, transformData, verticalLine };
|
|
1200
|
+
//# sourceMappingURL=index.js.map
|
|
1201
|
+
//# sourceMappingURL=index.js.map
|