@itssumitrai/fin-charter 0.2.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.
Files changed (396) hide show
  1. package/README.md +96 -0
  2. package/dist/api/chart-api.d.ts +173 -0
  3. package/dist/api/export.d.ts +46 -0
  4. package/dist/api/indicator-api.d.ts +38 -0
  5. package/dist/api/options.d.ts +226 -0
  6. package/dist/api/pane-api.d.ts +28 -0
  7. package/dist/api/series-api.d.ts +115 -0
  8. package/dist/core/accessibility.d.ts +90 -0
  9. package/dist/core/alert-line.d.ts +49 -0
  10. package/dist/core/chart-state.d.ts +39 -0
  11. package/dist/core/chart-sync.d.ts +83 -0
  12. package/dist/core/crosshair.d.ts +28 -0
  13. package/dist/core/css-theme.d.ts +41 -0
  14. package/dist/core/custom-indicator.d.ts +70 -0
  15. package/dist/core/data-feed.d.ts +59 -0
  16. package/dist/core/data-layer.d.ts +38 -0
  17. package/dist/core/invalidation.d.ts +24 -0
  18. package/dist/core/market-session.d.ts +11 -0
  19. package/dist/core/order-line.d.ts +134 -0
  20. package/dist/core/pane-divider.d.ts +22 -0
  21. package/dist/core/pane.d.ts +32 -0
  22. package/dist/core/periodicity.d.ts +6 -0
  23. package/dist/core/plugin.d.ts +90 -0
  24. package/dist/core/price-line.d.ts +17 -0
  25. package/dist/core/price-scale.d.ts +74 -0
  26. package/dist/core/replay.d.ts +73 -0
  27. package/dist/core/rtl.d.ts +22 -0
  28. package/dist/core/segment-tree.d.ts +38 -0
  29. package/dist/core/series-markers.d.ts +18 -0
  30. package/dist/core/storage-adapter.d.ts +50 -0
  31. package/dist/core/streaming-adapter.d.ts +102 -0
  32. package/dist/core/symbol-resolver.d.ts +32 -0
  33. package/dist/core/text-label.d.ts +72 -0
  34. package/dist/core/time-scale.d.ts +109 -0
  35. package/dist/core/types.d.ts +144 -0
  36. package/dist/core/undo-redo.d.ts +46 -0
  37. package/dist/currency/currency.d.ts +8 -0
  38. package/dist/currency/index.d.ts +2 -0
  39. package/dist/drawings/arrow.d.ts +10 -0
  40. package/dist/drawings/base.d.ts +79 -0
  41. package/dist/drawings/channel.d.ts +10 -0
  42. package/dist/drawings/crossline.d.ts +10 -0
  43. package/dist/drawings/ellipse.d.ts +10 -0
  44. package/dist/drawings/fib-arc.d.ts +10 -0
  45. package/dist/drawings/fib-fan.d.ts +12 -0
  46. package/dist/drawings/fib-projection.d.ts +11 -0
  47. package/dist/drawings/fibonacci.d.ts +11 -0
  48. package/dist/drawings/horizontal-line.d.ts +10 -0
  49. package/dist/drawings/index.d.ts +7 -0
  50. package/dist/drawings/measurement.d.ts +11 -0
  51. package/dist/drawings/pitchfork.d.ts +12 -0
  52. package/dist/drawings/ray.d.ts +12 -0
  53. package/dist/drawings/rectangle.d.ts +10 -0
  54. package/dist/drawings/text-annotation.d.ts +11 -0
  55. package/dist/drawings/trendline.d.ts +10 -0
  56. package/dist/drawings/vertical-line.d.ts +10 -0
  57. package/dist/formatting/index.d.ts +5 -0
  58. package/dist/formatting/price-formatter.d.ts +6 -0
  59. package/dist/formatting/time-formatter.d.ts +7 -0
  60. package/dist/formatting/volume-formatter.d.ts +1 -0
  61. package/dist/i18n/i18n.d.ts +6 -0
  62. package/dist/i18n/index.d.ts +3 -0
  63. package/dist/i18n/locales/en.d.ts +3 -0
  64. package/dist/index.d.ts +63 -0
  65. package/dist/index.js +2 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/index10.js +2 -0
  68. package/dist/index10.js.map +1 -0
  69. package/dist/index100.js +2 -0
  70. package/dist/index100.js.map +1 -0
  71. package/dist/index101.js +2 -0
  72. package/dist/index101.js.map +1 -0
  73. package/dist/index102.js +2 -0
  74. package/dist/index102.js.map +1 -0
  75. package/dist/index103.js +2 -0
  76. package/dist/index103.js.map +1 -0
  77. package/dist/index104.js +2 -0
  78. package/dist/index104.js.map +1 -0
  79. package/dist/index105.js +2 -0
  80. package/dist/index105.js.map +1 -0
  81. package/dist/index106.js +2 -0
  82. package/dist/index106.js.map +1 -0
  83. package/dist/index107.js +2 -0
  84. package/dist/index107.js.map +1 -0
  85. package/dist/index108.js +2 -0
  86. package/dist/index108.js.map +1 -0
  87. package/dist/index109.js +2 -0
  88. package/dist/index109.js.map +1 -0
  89. package/dist/index11.js +2 -0
  90. package/dist/index11.js.map +1 -0
  91. package/dist/index110.js +2 -0
  92. package/dist/index110.js.map +1 -0
  93. package/dist/index111.js +2 -0
  94. package/dist/index111.js.map +1 -0
  95. package/dist/index112.js +2 -0
  96. package/dist/index112.js.map +1 -0
  97. package/dist/index113.js +2 -0
  98. package/dist/index113.js.map +1 -0
  99. package/dist/index114.js +2 -0
  100. package/dist/index114.js.map +1 -0
  101. package/dist/index115.js +2 -0
  102. package/dist/index115.js.map +1 -0
  103. package/dist/index116.js +2 -0
  104. package/dist/index116.js.map +1 -0
  105. package/dist/index117.js +2 -0
  106. package/dist/index117.js.map +1 -0
  107. package/dist/index118.js +2 -0
  108. package/dist/index118.js.map +1 -0
  109. package/dist/index119.js +2 -0
  110. package/dist/index119.js.map +1 -0
  111. package/dist/index12.js +2 -0
  112. package/dist/index12.js.map +1 -0
  113. package/dist/index120.js +2 -0
  114. package/dist/index120.js.map +1 -0
  115. package/dist/index121.js +2 -0
  116. package/dist/index121.js.map +1 -0
  117. package/dist/index122.js +2 -0
  118. package/dist/index122.js.map +1 -0
  119. package/dist/index123.js +2 -0
  120. package/dist/index123.js.map +1 -0
  121. package/dist/index124.js +2 -0
  122. package/dist/index124.js.map +1 -0
  123. package/dist/index13.js +2 -0
  124. package/dist/index13.js.map +1 -0
  125. package/dist/index14.js +2 -0
  126. package/dist/index14.js.map +1 -0
  127. package/dist/index15.js +2 -0
  128. package/dist/index15.js.map +1 -0
  129. package/dist/index16.js +2 -0
  130. package/dist/index16.js.map +1 -0
  131. package/dist/index17.js +2 -0
  132. package/dist/index17.js.map +1 -0
  133. package/dist/index18.js +2 -0
  134. package/dist/index18.js.map +1 -0
  135. package/dist/index19.js +2 -0
  136. package/dist/index19.js.map +1 -0
  137. package/dist/index2.js +2 -0
  138. package/dist/index2.js.map +1 -0
  139. package/dist/index20.js +2 -0
  140. package/dist/index20.js.map +1 -0
  141. package/dist/index21.js +2 -0
  142. package/dist/index21.js.map +1 -0
  143. package/dist/index22.js +2 -0
  144. package/dist/index22.js.map +1 -0
  145. package/dist/index23.js +2 -0
  146. package/dist/index23.js.map +1 -0
  147. package/dist/index24.js +2 -0
  148. package/dist/index24.js.map +1 -0
  149. package/dist/index25.js +2 -0
  150. package/dist/index25.js.map +1 -0
  151. package/dist/index26.js +2 -0
  152. package/dist/index26.js.map +1 -0
  153. package/dist/index27.js +2 -0
  154. package/dist/index27.js.map +1 -0
  155. package/dist/index28.js +2 -0
  156. package/dist/index28.js.map +1 -0
  157. package/dist/index29.js +2 -0
  158. package/dist/index29.js.map +1 -0
  159. package/dist/index3.js +2 -0
  160. package/dist/index3.js.map +1 -0
  161. package/dist/index30.js +2 -0
  162. package/dist/index30.js.map +1 -0
  163. package/dist/index31.js +2 -0
  164. package/dist/index31.js.map +1 -0
  165. package/dist/index32.js +2 -0
  166. package/dist/index32.js.map +1 -0
  167. package/dist/index33.js +2 -0
  168. package/dist/index33.js.map +1 -0
  169. package/dist/index34.js +2 -0
  170. package/dist/index34.js.map +1 -0
  171. package/dist/index35.js +2 -0
  172. package/dist/index35.js.map +1 -0
  173. package/dist/index36.js +2 -0
  174. package/dist/index36.js.map +1 -0
  175. package/dist/index37.js +2 -0
  176. package/dist/index37.js.map +1 -0
  177. package/dist/index38.js +2 -0
  178. package/dist/index38.js.map +1 -0
  179. package/dist/index39.js +2 -0
  180. package/dist/index39.js.map +1 -0
  181. package/dist/index4.js +2 -0
  182. package/dist/index4.js.map +1 -0
  183. package/dist/index40.js +2 -0
  184. package/dist/index40.js.map +1 -0
  185. package/dist/index41.js +2 -0
  186. package/dist/index41.js.map +1 -0
  187. package/dist/index42.js +2 -0
  188. package/dist/index42.js.map +1 -0
  189. package/dist/index43.js +2 -0
  190. package/dist/index43.js.map +1 -0
  191. package/dist/index44.js +2 -0
  192. package/dist/index44.js.map +1 -0
  193. package/dist/index45.js +2 -0
  194. package/dist/index45.js.map +1 -0
  195. package/dist/index46.js +2 -0
  196. package/dist/index46.js.map +1 -0
  197. package/dist/index47.js +2 -0
  198. package/dist/index47.js.map +1 -0
  199. package/dist/index48.js +2 -0
  200. package/dist/index48.js.map +1 -0
  201. package/dist/index49.js +2 -0
  202. package/dist/index49.js.map +1 -0
  203. package/dist/index5.js +2 -0
  204. package/dist/index5.js.map +1 -0
  205. package/dist/index50.js +2 -0
  206. package/dist/index50.js.map +1 -0
  207. package/dist/index51.js +2 -0
  208. package/dist/index51.js.map +1 -0
  209. package/dist/index52.js +2 -0
  210. package/dist/index52.js.map +1 -0
  211. package/dist/index53.js +2 -0
  212. package/dist/index53.js.map +1 -0
  213. package/dist/index54.js +2 -0
  214. package/dist/index54.js.map +1 -0
  215. package/dist/index55.js +2 -0
  216. package/dist/index55.js.map +1 -0
  217. package/dist/index56.js +2 -0
  218. package/dist/index56.js.map +1 -0
  219. package/dist/index57.js +2 -0
  220. package/dist/index57.js.map +1 -0
  221. package/dist/index58.js +2 -0
  222. package/dist/index58.js.map +1 -0
  223. package/dist/index59.js +2 -0
  224. package/dist/index59.js.map +1 -0
  225. package/dist/index6.js +2 -0
  226. package/dist/index6.js.map +1 -0
  227. package/dist/index60.js +2 -0
  228. package/dist/index60.js.map +1 -0
  229. package/dist/index61.js +2 -0
  230. package/dist/index61.js.map +1 -0
  231. package/dist/index62.js +2 -0
  232. package/dist/index62.js.map +1 -0
  233. package/dist/index63.js +2 -0
  234. package/dist/index63.js.map +1 -0
  235. package/dist/index64.js +2 -0
  236. package/dist/index64.js.map +1 -0
  237. package/dist/index65.js +3 -0
  238. package/dist/index65.js.map +1 -0
  239. package/dist/index66.js +2 -0
  240. package/dist/index66.js.map +1 -0
  241. package/dist/index67.js +2 -0
  242. package/dist/index67.js.map +1 -0
  243. package/dist/index68.js +2 -0
  244. package/dist/index68.js.map +1 -0
  245. package/dist/index69.js +2 -0
  246. package/dist/index69.js.map +1 -0
  247. package/dist/index7.js +2 -0
  248. package/dist/index7.js.map +1 -0
  249. package/dist/index70.js +2 -0
  250. package/dist/index70.js.map +1 -0
  251. package/dist/index71.js +2 -0
  252. package/dist/index71.js.map +1 -0
  253. package/dist/index72.js +2 -0
  254. package/dist/index72.js.map +1 -0
  255. package/dist/index73.js +2 -0
  256. package/dist/index73.js.map +1 -0
  257. package/dist/index74.js +2 -0
  258. package/dist/index74.js.map +1 -0
  259. package/dist/index75.js +2 -0
  260. package/dist/index75.js.map +1 -0
  261. package/dist/index76.js +2 -0
  262. package/dist/index76.js.map +1 -0
  263. package/dist/index77.js +2 -0
  264. package/dist/index77.js.map +1 -0
  265. package/dist/index78.js +2 -0
  266. package/dist/index78.js.map +1 -0
  267. package/dist/index79.js +2 -0
  268. package/dist/index79.js.map +1 -0
  269. package/dist/index8.js +2 -0
  270. package/dist/index8.js.map +1 -0
  271. package/dist/index80.js +2 -0
  272. package/dist/index80.js.map +1 -0
  273. package/dist/index81.js +2 -0
  274. package/dist/index81.js.map +1 -0
  275. package/dist/index82.js +2 -0
  276. package/dist/index82.js.map +1 -0
  277. package/dist/index83.js +2 -0
  278. package/dist/index83.js.map +1 -0
  279. package/dist/index84.js +2 -0
  280. package/dist/index84.js.map +1 -0
  281. package/dist/index85.js +2 -0
  282. package/dist/index85.js.map +1 -0
  283. package/dist/index86.js +2 -0
  284. package/dist/index86.js.map +1 -0
  285. package/dist/index87.js +2 -0
  286. package/dist/index87.js.map +1 -0
  287. package/dist/index88.js +2 -0
  288. package/dist/index88.js.map +1 -0
  289. package/dist/index89.js +2 -0
  290. package/dist/index89.js.map +1 -0
  291. package/dist/index9.js +2 -0
  292. package/dist/index9.js.map +1 -0
  293. package/dist/index90.js +2 -0
  294. package/dist/index90.js.map +1 -0
  295. package/dist/index91.js +2 -0
  296. package/dist/index91.js.map +1 -0
  297. package/dist/index92.js +2 -0
  298. package/dist/index92.js.map +1 -0
  299. package/dist/index93.js +2 -0
  300. package/dist/index93.js.map +1 -0
  301. package/dist/index94.js +2 -0
  302. package/dist/index94.js.map +1 -0
  303. package/dist/index95.js +2 -0
  304. package/dist/index95.js.map +1 -0
  305. package/dist/index96.js +2 -0
  306. package/dist/index96.js.map +1 -0
  307. package/dist/index97.js +2 -0
  308. package/dist/index97.js.map +1 -0
  309. package/dist/index98.js +2 -0
  310. package/dist/index98.js.map +1 -0
  311. package/dist/index99.js +2 -0
  312. package/dist/index99.js.map +1 -0
  313. package/dist/indicators/adx.d.ts +6 -0
  314. package/dist/indicators/aroon.d.ts +5 -0
  315. package/dist/indicators/atr.d.ts +1 -0
  316. package/dist/indicators/awesome-oscillator.d.ts +1 -0
  317. package/dist/indicators/bollinger.d.ts +6 -0
  318. package/dist/indicators/cci.d.ts +1 -0
  319. package/dist/indicators/chaikin-mf.d.ts +1 -0
  320. package/dist/indicators/choppiness.d.ts +1 -0
  321. package/dist/indicators/coppock.d.ts +1 -0
  322. package/dist/indicators/donchian.d.ts +6 -0
  323. package/dist/indicators/elder-force.d.ts +1 -0
  324. package/dist/indicators/ema.d.ts +1 -0
  325. package/dist/indicators/ichimoku.d.ts +8 -0
  326. package/dist/indicators/index.d.ts +31 -0
  327. package/dist/indicators/keltner.d.ts +6 -0
  328. package/dist/indicators/linear-regression.d.ts +1 -0
  329. package/dist/indicators/macd.d.ts +6 -0
  330. package/dist/indicators/mfi.d.ts +1 -0
  331. package/dist/indicators/obv.d.ts +1 -0
  332. package/dist/indicators/parabolic-sar.d.ts +1 -0
  333. package/dist/indicators/pivot-points.d.ts +10 -0
  334. package/dist/indicators/roc.d.ts +1 -0
  335. package/dist/indicators/rsi.d.ts +1 -0
  336. package/dist/indicators/sma.d.ts +1 -0
  337. package/dist/indicators/stochastic.d.ts +5 -0
  338. package/dist/indicators/supertrend.d.ts +5 -0
  339. package/dist/indicators/trix.d.ts +5 -0
  340. package/dist/indicators/utils.d.ts +20 -0
  341. package/dist/indicators/volume-profile.d.ts +37 -0
  342. package/dist/indicators/volume.d.ts +1 -0
  343. package/dist/indicators/vwap.d.ts +1 -0
  344. package/dist/indicators/vwma.d.ts +1 -0
  345. package/dist/indicators/williams-r.d.ts +1 -0
  346. package/dist/interactions/axis-drag.d.ts +24 -0
  347. package/dist/interactions/context-menu-handler.d.ts +42 -0
  348. package/dist/interactions/crosshair.d.ts +20 -0
  349. package/dist/interactions/drawing-handler.d.ts +39 -0
  350. package/dist/interactions/event-router.d.ts +37 -0
  351. package/dist/interactions/keyboard-nav.d.ts +11 -0
  352. package/dist/interactions/pan-zoom.d.ts +39 -0
  353. package/dist/interactions/range-selection.d.ts +103 -0
  354. package/dist/interactions/touch-gestures.d.ts +36 -0
  355. package/dist/logo.svg +40 -0
  356. package/dist/market/exchange-map.d.ts +3 -0
  357. package/dist/market/index.d.ts +4 -0
  358. package/dist/market/market-calendar.d.ts +4 -0
  359. package/dist/market/market-definition.d.ts +22 -0
  360. package/dist/mockServiceWorker.js +349 -0
  361. package/dist/renderers/area.d.ts +17 -0
  362. package/dist/renderers/bar-ohlc.d.ts +17 -0
  363. package/dist/renderers/baseline-delta-mountain.d.ts +22 -0
  364. package/dist/renderers/baseline.d.ts +19 -0
  365. package/dist/renderers/candlestick.d.ts +21 -0
  366. package/dist/renderers/canvas-renderer.d.ts +28 -0
  367. package/dist/renderers/colored-line.d.ts +15 -0
  368. package/dist/renderers/colored-mountain.d.ts +18 -0
  369. package/dist/renderers/column.d.ts +14 -0
  370. package/dist/renderers/high-low.d.ts +14 -0
  371. package/dist/renderers/histogram.d.ts +16 -0
  372. package/dist/renderers/hlc-area.d.ts +16 -0
  373. package/dist/renderers/hollow-candle.d.ts +18 -0
  374. package/dist/renderers/kagi.d.ts +22 -0
  375. package/dist/renderers/line-break.d.ts +20 -0
  376. package/dist/renderers/line.d.ts +17 -0
  377. package/dist/renderers/point-figure.d.ts +20 -0
  378. package/dist/renderers/renderer.d.ts +59 -0
  379. package/dist/renderers/renko.d.ts +24 -0
  380. package/dist/renderers/step-line.d.ts +14 -0
  381. package/dist/renderers/text-cache.d.ts +23 -0
  382. package/dist/renderers/volume-candle.d.ts +20 -0
  383. package/dist/renderers/webgl/area-webgl.d.ts +28 -0
  384. package/dist/renderers/webgl/candlestick-webgl.d.ts +30 -0
  385. package/dist/renderers/webgl/index.d.ts +7 -0
  386. package/dist/renderers/webgl/line-webgl.d.ts +23 -0
  387. package/dist/renderers/webgl/webgl-utils.d.ts +23 -0
  388. package/dist/timezone/index.d.ts +2 -0
  389. package/dist/timezone/timezone.d.ts +12 -0
  390. package/dist/transforms/aggregate.d.ts +2 -0
  391. package/dist/transforms/heikin-ashi.d.ts +2 -0
  392. package/dist/transforms/index.d.ts +2 -0
  393. package/dist/ui/context-menu.d.ts +14 -0
  394. package/dist/ui/hud.d.ts +43 -0
  395. package/dist/ui/settings-popup.d.ts +15 -0
  396. package/package.json +129 -0
@@ -0,0 +1,59 @@
1
+ import { GradientStop, PathCommand } from '../core/types';
2
+ /**
3
+ * Style options for drawing operations.
4
+ */
5
+ export interface DrawStyle {
6
+ strokeColor?: string;
7
+ fillColor?: string;
8
+ lineWidth?: number;
9
+ lineDash?: number[];
10
+ font?: string;
11
+ textAlign?: CanvasTextAlign;
12
+ textBaseline?: CanvasTextBaseline;
13
+ globalAlpha?: number;
14
+ }
15
+ /**
16
+ * IRenderer — thin abstraction over a 2D drawing surface.
17
+ *
18
+ * All coordinate arguments are in **logical (CSS) pixels**; implementations
19
+ * are responsible for applying the pixelRatio internally.
20
+ */
21
+ export interface IRenderer {
22
+ /** Resize the backing surface. */
23
+ setSize(width: number, height: number, pixelRatio: number): void;
24
+ /** Clear the entire surface. */
25
+ clear(): void;
26
+ /** Push the current drawing state onto the stack. */
27
+ save(): void;
28
+ /** Pop the top drawing state from the stack. */
29
+ restore(): void;
30
+ /** Clip subsequent drawing to the given rectangle (logical px). */
31
+ clip(x: number, y: number, width: number, height: number): void;
32
+ /**
33
+ * Set the current transform matrix (six-element affine transform).
34
+ * Values are in physical pixels (already account for pixelRatio).
35
+ */
36
+ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
37
+ /** Draw a stroked line from (x1, y1) to (x2, y2). */
38
+ drawLine(x1: number, y1: number, x2: number, y2: number): void;
39
+ /** Draw a stroked rectangle. */
40
+ drawRect(x: number, y: number, width: number, height: number): void;
41
+ /** Draw a filled rectangle. */
42
+ fillRect(x: number, y: number, width: number, height: number): void;
43
+ /**
44
+ * Execute a series of path commands and then stroke (and optionally fill)
45
+ * the resulting path.
46
+ */
47
+ drawPath(commands: PathCommand[], fill?: boolean): void;
48
+ /** Render a text string at the given position. */
49
+ fillText(text: string, x: number, y: number): void;
50
+ /** Return the rendered width of the given text string in logical pixels. */
51
+ measureText(text: string): number;
52
+ /** Apply a set of style properties to subsequent drawing operations. */
53
+ setStyle(style: DrawStyle): void;
54
+ /**
55
+ * Create a vertical linear gradient between y0 and y1 (logical px) and
56
+ * return it as a CanvasGradient.
57
+ */
58
+ createGradient(x0: number, y0: number, x1: number, y1: number, stops: GradientStop[]): CanvasGradient;
59
+ }
@@ -0,0 +1,24 @@
1
+ import { ColumnStore, IRenderTarget, VisibleRange } from '../core/types';
2
+ export interface RenkoRendererOptions {
3
+ boxSize: number;
4
+ upColor: string;
5
+ downColor: string;
6
+ }
7
+ /**
8
+ * RenkoRenderer — builds Renko bricks from close prices and draws them.
9
+ *
10
+ * Renko charts filter out noise by only drawing a new brick when price moves
11
+ * by at least `boxSize` in one direction. Up bricks are filled with `upColor`,
12
+ * down bricks with `downColor`.
13
+ */
14
+ export declare class RenkoRenderer {
15
+ private _options;
16
+ applyOptions(options: Partial<RenkoRendererOptions>): void;
17
+ /**
18
+ * Build Renko bricks from the close prices in the store for the given range.
19
+ * We walk from `fromIdx` to `toIdx` and emit bricks whenever the close price
20
+ * departs from the current brick level by at least `boxSize`.
21
+ */
22
+ private _buildBricks;
23
+ draw(target: IRenderTarget, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number, barWidth: number): void;
24
+ }
@@ -0,0 +1,14 @@
1
+ import { ColumnStore, IRenderTarget, VisibleRange } from '../core/types';
2
+ export interface StepLineRendererOptions {
3
+ color: string;
4
+ lineWidth: number;
5
+ }
6
+ /**
7
+ * StepLineRenderer — draws a close-price step line (horizontal-then-vertical)
8
+ * over the visible bar range.
9
+ */
10
+ export declare class StepLineRenderer {
11
+ private _options;
12
+ applyOptions(options: Partial<StepLineRendererOptions>): void;
13
+ draw(target: IRenderTarget, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number): void;
14
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * TextMetricsCache — precomputes per-character widths for the ~70 characters
3
+ * that appear in financial chart labels so that measuring a string requires
4
+ * only a fast arithmetic sum rather than a `ctx.measureText` call.
5
+ */
6
+ export declare class TextMetricsCache {
7
+ private _widths;
8
+ private _lastFont;
9
+ private _ctx;
10
+ /**
11
+ * Pre-measure all financial characters for the given font.
12
+ * If the font has not changed since the last call, this is a no-op.
13
+ */
14
+ prepare(ctx: CanvasRenderingContext2D, font: string): void;
15
+ /**
16
+ * Return the rendered width (in the same units as `ctx.measureText`) of
17
+ * `text` using the cached per-character widths.
18
+ *
19
+ * For any character not found in the cache the method falls back to a live
20
+ * `ctx.measureText` call and caches that result for future use.
21
+ */
22
+ measureWidth(text: string): number;
23
+ }
@@ -0,0 +1,20 @@
1
+ import { ColumnStore, IRenderTarget, VisibleRange } from '../core/types';
2
+ export interface VolumeCandleRendererOptions {
3
+ upColor: string;
4
+ downColor: string;
5
+ wickUpColor: string;
6
+ wickDownColor: string;
7
+ maxBarWidthMultiplier: number;
8
+ }
9
+ /**
10
+ * VolumeCandleRenderer — like CandlestickRenderer but the candle body width
11
+ * varies based on volume relative to the maximum volume in the visible range.
12
+ *
13
+ * Width = baseBarWidth * (volume / maxVolume) * maxBarWidthMultiplier,
14
+ * with a minimum of 1 physical pixel. Wicks are always 1px wide.
15
+ */
16
+ export declare class VolumeCandleRenderer {
17
+ private _options;
18
+ applyOptions(options: Partial<VolumeCandleRendererOptions>): void;
19
+ draw(target: IRenderTarget, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number, barWidth: number): void;
20
+ }
@@ -0,0 +1,28 @@
1
+ import { ColumnStore, VisibleRange } from '../../core/types';
2
+ export interface AreaWebGLOptions {
3
+ lineColor: string;
4
+ lineWidth: number;
5
+ topColor: string;
6
+ bottomColor: string;
7
+ }
8
+ /**
9
+ * GPU-accelerated area (mountain) chart renderer.
10
+ *
11
+ * Renders two passes:
12
+ * 1. Gradient-filled polygon from the price line down to the pane bottom.
13
+ * 2. Thick line along the close prices (same ribbon approach as LineWebGLRenderer).
14
+ */
15
+ export declare class AreaWebGLRenderer {
16
+ private _options;
17
+ private _resources;
18
+ private _fillPos;
19
+ private _fillT;
20
+ private _linePos;
21
+ private _topColor;
22
+ private _bottomColor;
23
+ private _lineColor;
24
+ applyOptions(options: Partial<AreaWebGLOptions>): void;
25
+ private _getResources;
26
+ draw(gl: WebGL2RenderingContext, width: number, height: number, pixelRatio: number, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number): void;
27
+ dispose(): void;
28
+ }
@@ -0,0 +1,30 @@
1
+ import { ColumnStore, VisibleRange } from '../../core/types';
2
+ export interface CandlestickWebGLOptions {
3
+ upColor: string;
4
+ downColor: string;
5
+ wickUpColor: string;
6
+ wickDownColor: string;
7
+ }
8
+ /**
9
+ * GPU-accelerated candlestick renderer using per-vertex rectangle geometry.
10
+ *
11
+ * Each candle is composed of two rectangles (wick + body), with each
12
+ * rectangle emitted as two triangles (6 vertices) into typed arrays.
13
+ * The vertex buffer is rebuilt each frame from the visible range — fast
14
+ * enough for 500k+ bars because only the visible subset is generated and
15
+ * uploaded.
16
+ */
17
+ export declare class CandlestickWebGLRenderer {
18
+ private _options;
19
+ private _resources;
20
+ private _posData;
21
+ private _colorData;
22
+ private _upColor;
23
+ private _downColor;
24
+ private _wickUpColor;
25
+ private _wickDownColor;
26
+ applyOptions(options: Partial<CandlestickWebGLOptions>): void;
27
+ private _getResources;
28
+ draw(gl: WebGL2RenderingContext, width: number, height: number, pixelRatio: number, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number, barWidth: number): void;
29
+ dispose(): void;
30
+ }
@@ -0,0 +1,7 @@
1
+ export { isWebGLAvailable, parseColor, compileShader, createProgram, uploadBuffer } from './webgl-utils';
2
+ export { CandlestickWebGLRenderer } from './candlestick-webgl';
3
+ export type { CandlestickWebGLOptions } from './candlestick-webgl';
4
+ export { LineWebGLRenderer } from './line-webgl';
5
+ export type { LineWebGLOptions } from './line-webgl';
6
+ export { AreaWebGLRenderer } from './area-webgl';
7
+ export type { AreaWebGLOptions } from './area-webgl';
@@ -0,0 +1,23 @@
1
+ import { ColumnStore, VisibleRange } from '../../core/types';
2
+ export interface LineWebGLOptions {
3
+ color: string;
4
+ lineWidth: number;
5
+ }
6
+ /**
7
+ * GPU-accelerated line renderer.
8
+ *
9
+ * Draws the close-price polyline as a screen-space ribbon: each line segment
10
+ * is expanded into a quad (2 triangles) on the CPU when building the vertex
11
+ * buffer, and the vertex shader transforms those positions to clip space,
12
+ * giving a consistent pixel-width line regardless of zoom level.
13
+ */
14
+ export declare class LineWebGLRenderer {
15
+ private _options;
16
+ private _resources;
17
+ private _posData;
18
+ private _parsedColor;
19
+ applyOptions(options: Partial<LineWebGLOptions>): void;
20
+ private _getResources;
21
+ draw(gl: WebGL2RenderingContext, width: number, height: number, pixelRatio: number, store: ColumnStore, range: VisibleRange, indexToX: (i: number) => number, priceToY: (price: number) => number): void;
22
+ dispose(): void;
23
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WebGL utility functions: shader compilation, program linking, buffer helpers.
3
+ */
4
+ /**
5
+ * Check whether WebGL2 is available in the current environment.
6
+ */
7
+ export declare function isWebGLAvailable(): boolean;
8
+ /**
9
+ * Compile a shader from source. Throws on compilation failure.
10
+ */
11
+ export declare function compileShader(gl: WebGL2RenderingContext, type: number, source: string): WebGLShader;
12
+ /**
13
+ * Link vertex + fragment shaders into a program. Throws on failure.
14
+ */
15
+ export declare function createProgram(gl: WebGL2RenderingContext, vertexSource: string, fragmentSource: string): WebGLProgram;
16
+ /**
17
+ * Parse a CSS color string into normalized [r, g, b, a] values (0–1).
18
+ */
19
+ export declare function parseColor(color: string): [number, number, number, number];
20
+ /**
21
+ * Upload Float32Array data to a buffer object.
22
+ */
23
+ export declare function uploadBuffer(gl: WebGL2RenderingContext, buffer: WebGLBuffer, data: Float32Array): void;
@@ -0,0 +1,2 @@
1
+ export { timestampToDateParts, formatInTimezone, getTimezoneOffsetMinutes, } from './timezone';
2
+ export type { DateParts } from './timezone';
@@ -0,0 +1,12 @@
1
+ export interface DateParts {
2
+ year: number;
3
+ month: number;
4
+ day: number;
5
+ hour: number;
6
+ minute: number;
7
+ second: number;
8
+ weekday: number;
9
+ }
10
+ export declare function timestampToDateParts(timestampSec: number, timezone: string): DateParts;
11
+ export declare function formatInTimezone(timestampSec: number, timezone: string, options: Intl.DateTimeFormatOptions, locale?: string): string;
12
+ export declare function getTimezoneOffsetMinutes(timestampSec: number, timezone: string): number;
@@ -0,0 +1,2 @@
1
+ import { ColumnStore } from '../core/types';
2
+ export declare function aggregateOHLC(source: ColumnStore, targetIntervalSec: number): ColumnStore;
@@ -0,0 +1,2 @@
1
+ import { ColumnStore } from '../core/types';
2
+ export declare function computeHeikinAshi(store: ColumnStore): ColumnStore;
@@ -0,0 +1,2 @@
1
+ export { computeHeikinAshi } from './heikin-ashi';
2
+ export { aggregateOHLC } from './aggregate';
@@ -0,0 +1,14 @@
1
+ export interface ContextMenuItem {
2
+ label: string;
3
+ icon?: string;
4
+ action: () => void;
5
+ separator?: boolean;
6
+ }
7
+ export declare function createContextMenu(items: ContextMenuItem[], position: {
8
+ x: number;
9
+ y: number;
10
+ }, theme: {
11
+ bg: string;
12
+ text: string;
13
+ border: string;
14
+ }): HTMLDivElement;
@@ -0,0 +1,43 @@
1
+ import { SettingsField, OnApply } from './settings-popup';
2
+ export interface HudRowConfig {
3
+ id: string;
4
+ label: string;
5
+ color: string;
6
+ getValues: (barIndex: number) => string;
7
+ onToggleVisible: () => boolean;
8
+ onRemove: () => void;
9
+ getSettingsFields: () => SettingsField[];
10
+ onSettingsApply: OnApply;
11
+ }
12
+ export declare class HudManager {
13
+ private _container;
14
+ private _rows;
15
+ private _theme;
16
+ private _activePopup;
17
+ private _outsideClickHandler;
18
+ private _pendingRaf;
19
+ private _globalCollapsed;
20
+ private _compactLine;
21
+ private _globalChevron;
22
+ private _rowsWrapper;
23
+ private _onGlobalCollapseToggle;
24
+ constructor(paneRow: HTMLElement, theme: {
25
+ bg: string;
26
+ text: string;
27
+ border: string;
28
+ fontFamily: string;
29
+ });
30
+ get isGlobalCollapsed(): boolean;
31
+ set onGlobalCollapseToggle(cb: (() => void) | null);
32
+ setGlobalCollapsed(collapsed: boolean): void;
33
+ addRow(config: HudRowConfig): void;
34
+ removeRow(id: string): void;
35
+ updateValues(barIndex: number): void;
36
+ /** Programmatically open the settings popup for a row. */
37
+ triggerSettings(rowId: string): void;
38
+ destroy(): void;
39
+ private _chevronStyle;
40
+ private _buttonStyle;
41
+ private _openSettings;
42
+ private _closePopup;
43
+ }
@@ -0,0 +1,15 @@
1
+ export interface SettingsField {
2
+ key: string;
3
+ label: string;
4
+ type: 'number' | 'color';
5
+ value: number | string;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ }
10
+ export type OnApply = (values: Record<string, number | string>) => void;
11
+ export declare function createSettingsPopup(fields: SettingsField[], onApply: OnApply, onCancel: () => void, theme: {
12
+ bg: string;
13
+ text: string;
14
+ border: string;
15
+ }): HTMLDivElement;
package/package.json ADDED
@@ -0,0 +1,129 @@
1
+ {
2
+ "name": "@itssumitrai/fin-charter",
3
+ "version": "0.2.0",
4
+ "description": "Ultra-fast, tree-shakeable financial charting library",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Sumit Rai",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/itssumitrai/fin-charter.git"
11
+ },
12
+ "homepage": "https://github.com/itssumitrai/fin-charter",
13
+ "bugs": {
14
+ "url": "https://github.com/itssumitrai/fin-charter/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "provenance": true
19
+ },
20
+ "sideEffects": false,
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ },
29
+ "./indicators": {
30
+ "types": "./dist/indicators/index.d.ts",
31
+ "import": "./dist/indicators/index.js"
32
+ },
33
+ "./indicators/*": {
34
+ "types": "./dist/indicators/*.d.ts",
35
+ "import": "./dist/indicators/*.js"
36
+ },
37
+ "./interactions/*": {
38
+ "types": "./dist/interactions/*.d.ts",
39
+ "import": "./dist/interactions/*.js"
40
+ },
41
+ "./i18n": {
42
+ "types": "./dist/i18n/index.d.ts",
43
+ "import": "./dist/i18n/index.js"
44
+ },
45
+ "./timezone": {
46
+ "types": "./dist/timezone/index.d.ts",
47
+ "import": "./dist/timezone/index.js"
48
+ },
49
+ "./formatting": {
50
+ "types": "./dist/formatting/index.d.ts",
51
+ "import": "./dist/formatting/index.js"
52
+ },
53
+ "./currency": {
54
+ "types": "./dist/currency/index.d.ts",
55
+ "import": "./dist/currency/index.js"
56
+ },
57
+ "./market": {
58
+ "types": "./dist/market/index.d.ts",
59
+ "import": "./dist/market/index.js"
60
+ },
61
+ "./gui/*": {
62
+ "svelte": "./src/gui/*.svelte"
63
+ }
64
+ },
65
+ "files": [
66
+ "dist"
67
+ ],
68
+ "scripts": {
69
+ "dev": "vite --config dev/vite.config.ts",
70
+ "build": "vite build",
71
+ "prepublishOnly": "npm run build",
72
+ "changeset": "changeset",
73
+ "version-packages": "changeset version",
74
+ "release": "changeset publish",
75
+ "test": "vitest run",
76
+ "test:watch": "vitest",
77
+ "lint": "eslint src/",
78
+ "format": "prettier --write \"src/**/*.{ts,svelte}\"",
79
+ "format:check": "prettier --check \"src/**/*.{ts,svelte}\"",
80
+ "size": "node -e \"const{execSync:e}=require('child_process');const f=s=>(parseInt(e('gzip -c '+s+' | wc -c').toString().trim())/1024).toFixed(1);const big=e('ls -S dist/*.js').toString().trim().split('\\n')[0].trim();console.log('Core ('+big.split('/').pop()+'):', f(big), 'KB gzip');console.log('Full bundle:', (parseInt(e('cat dist/*.js | gzip | wc -c').toString().trim())/1024).toFixed(1), 'KB gzip')\"",
81
+ "storybook": "storybook dev -p 6006",
82
+ "build-storybook": "storybook build -o storybook-static",
83
+ "chromatic": "chromatic"
84
+ },
85
+ "keywords": [
86
+ "chart",
87
+ "financial",
88
+ "trading",
89
+ "candlestick",
90
+ "canvas",
91
+ "lightweight"
92
+ ],
93
+ "devDependencies": {
94
+ "@changesets/changelog-github": "^0.6.0",
95
+ "@changesets/cli": "^2.30.0",
96
+ "@eslint/js": "^10.0.1",
97
+ "@storybook/addon-docs": "^10.3.4",
98
+ "@storybook/html": "^10.3.4",
99
+ "@storybook/html-vite": "^10.3.4",
100
+ "@sveltejs/vite-plugin-svelte": "^7.0.0",
101
+ "@vitest/coverage-v8": "^4.1.2",
102
+ "chromatic": "^16.1.0",
103
+ "eslint": "^10.1.0",
104
+ "eslint-plugin-svelte": "^3.17.0",
105
+ "jsdom": "^29.0.1",
106
+ "msw": "^2.12.14",
107
+ "msw-storybook-addon": "^2.0.6",
108
+ "prettier": "^3.8.1",
109
+ "prettier-plugin-svelte": "^3.5.1",
110
+ "storybook": "^10.3.4",
111
+ "svelte": "^5.55.1",
112
+ "svelte-check": "^4.4.6",
113
+ "terser": "^5.46.1",
114
+ "tslib": "2.8.1",
115
+ "typescript": "^6.0.2",
116
+ "typescript-eslint": "^8.58.0",
117
+ "vite": "^8.0.3",
118
+ "vite-plugin-dts": "^4.5.4",
119
+ "vitest": "^4.1.2"
120
+ },
121
+ "dependencies": {
122
+ "@mdi/js": "^7.4.47"
123
+ },
124
+ "msw": {
125
+ "workerDirectory": [
126
+ "public"
127
+ ]
128
+ }
129
+ }