openalgo-charts 1.0.0 → 1.0.2

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/NOTICE ADDED
@@ -0,0 +1,15 @@
1
+ OpenAlgo Charts
2
+ Copyright 2026 OpenAlgo
3
+
4
+ This product includes software developed as part of the OpenAlgo project.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ This is original, clean-room code with no third-party charting library
13
+ dependencies. Should any third-party (Apache-2.0 or compatibly licensed)
14
+ routine ever be incorporated, its copyright/license headers will be preserved
15
+ and an attribution to its original authors will be added to this file.
package/README.md CHANGED
@@ -1,80 +1,112 @@
1
+ <div align="center">
2
+
1
3
  # OpenAlgo Charts
2
4
 
3
- A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo:
4
- professional-grade interactive financial-chart rendering plus advanced on-chart
5
- trading and trade management. Target: **< 50 KB Brotli** for the full package.
5
+ **A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo.**
6
6
 
7
- ## Documentation
7
+ Professional interactive financial charts, on-chart trading, and live data - in under 40 KB Brotli, with zero runtime dependencies.
8
8
 
9
- Full docs, an interactive example gallery, and the API reference live at:
9
+ [![npm version](https://img.shields.io/npm/v/openalgo-charts.svg?color=cb3837&label=npm)](https://www.npmjs.com/package/openalgo-charts)
10
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
11
+ [![bundle](https://img.shields.io/badge/brotli-~24%20KB%20base%20%C2%B7%20~38%20KB%20full-brightgreen.svg)](./ARCHITECTURE.md)
12
+ [![tests](https://img.shields.io/badge/tests-297%20passing-brightgreen.svg)](#develop)
13
+ [![dependencies](https://img.shields.io/badge/runtime%20deps-0-brightgreen.svg)](#principles)
10
14
 
11
- **https://marketcalls.github.io/openalgo-charts/**
15
+ [**Documentation**](https://marketcalls.github.io/openalgo-charts/) &nbsp;·&nbsp; [**Live examples**](https://marketcalls.github.io/openalgo-charts/examples) &nbsp;·&nbsp; [**Getting started**](./docs/getting-started.md) &nbsp;·&nbsp; [**Architecture**](./ARCHITECTURE.md)
16
+
17
+ <img src="docs/architecture-diagram.png" alt="OpenAlgo Charts - layered architecture from public API down to feeds and data, with loadable bundle tiers" width="920" />
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## Live OpenAlgo trading terminal
12
24
 
13
- The site is built with Nextra (in [`website/`](./website)) and statically exported to
14
- GitHub Pages on every push. Every code sample on a docs page is a *live* chart running the
15
- real library, so what you read is what runs. Adding a page is intentionally one step: drop a
16
- `.mdx` file in `website/pages/docs` and add one line to `website/pages/docs/_meta.ts`. To
17
- run the site locally:
25
+ Right-click the chart to place market / limit / stop orders, drag the order and TP/SL bracket lines to modify, and watch live P&amp;L on the position line - all on real OpenAlgo history + WebSocket tick data, with an analyzer (sandbox) mode so nothing goes live until you arm it.
26
+
27
+ <p align="center">
28
+ <img src="docs/trading.png" alt="OpenAlgo Charts live trading terminal: RELIANCE 5m candles with order lines, a right-click order menu, a long position with live P&L, and volume" width="920" />
29
+ </p>
30
+
31
+ ## Examples gallery
32
+
33
+ Every chart in the [live gallery](https://marketcalls.github.io/openalgo-charts/examples) is the real library running in your browser - switch tabs, hover the crosshair, drag the order lines. What you see is the code that ran.
34
+
35
+ <p align="center">
36
+ <img src="docs/demo1.png" alt="Chart-type switcher, custom themes, data tooltips, and event markers" width="49%" />
37
+ <img src="docs/demo2.png" alt="Range switcher, legend, series compare, and indicators and markers" width="49%" />
38
+ </p>
39
+ <p align="center">
40
+ <img src="docs/demo3.png" alt="More live OpenAlgo Charts examples" width="49%" />
41
+ <img src="docs/demo4.png" alt="More live OpenAlgo Charts examples" width="49%" />
42
+ </p>
43
+
44
+ ## Install
18
45
 
19
46
  ```bash
20
- npm run build # build the library (dist/) the live demos import
21
- cd website && npm install && npm run dev # http://localhost:3000/openalgo-charts
47
+ npm install openalgo-charts
22
48
  ```
23
49
 
24
- > Status: **pre-release (0.1.0)** — all 12 build phases of the engine are
25
- > implemented (standard chart types, transforms, trade terminal, depth ladder,
26
- > profiles) with 190+ unit tests, full package **~26 KB Brotli**. See
27
- > [`ARCHITECTURE.md`](./ARCHITECTURE.md), [`docs/getting-started.md`](./docs/getting-started.md),
28
- > and [`examples/index.html`](./examples/index.html).
29
- >
30
- > **Known limitations (not yet production-complete):** the OpenAlgo WS/trade
31
- > adapters ship but their exact message/endpoint schemas must be verified against
32
- > your running OpenAlgo build; there is **no real-browser/pixel test suite yet**
33
- > (logic is covered by a recording-canvas harness); multi-touch pinch, separate
34
- > axis-widget canvases, and overlay/indexed-to-100 price scales are not
35
- > implemented. See [`END_TO_END_AUDIT.md`](./END_TO_END_AUDIT.md) for the full list.
50
+ ```ts
51
+ import { createChart, generateBars } from 'openalgo-charts';
52
+
53
+ const chart = createChart(document.getElementById('chart'));
54
+ chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
55
+ ```
56
+
57
+ Loadable tiers - lazy-load only what you use:
58
+
59
+ | Import | Contents |
60
+ |---|---|
61
+ | `openalgo-charts` | Base engine + all standard chart types, indicators, primitives, trading overlay |
62
+ | `openalgo-charts/trade` | On-chart order/position/bracket tools + DOM ladder |
63
+ | `openalgo-charts/transform` | Renko, Range bars, Point &amp; Figure, Kagi, Line Break, Heikin Ashi |
64
+ | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO), Footprint, Order flow |
36
65
 
37
66
  ## What's built
38
67
 
39
- - **Chart types:** candles, hollow/volume candles, bars, high-low, line,
40
- line+markers, step, area, HLC-area, baseline, columns, histogram.
68
+ - **Chart types:** candles, hollow/volume candles, bars, high-low, line, line+markers, step, area, HLC-area, baseline, columns, histogram.
41
69
  - **Transforms:** Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi.
42
70
  - **Profiles &amp; order flow:** Volume Profile, Market Profile (TPO), Footprint, cumulative delta.
43
- - **Trading:** order/position/bracket lines, live P&amp;L, one-click + drag-to-modify,
44
- OCO, validation, analyzer mode, and a depth-of-market ladder (5→200 levels).
45
- - **Live + historical** data, markers/signals, earnings/dividend events, EMA indicator.
71
+ - **Trading:** order/position/bracket lines, live P&amp;L, one-click + drag-to-modify, OCO, validation, analyzer mode, and a depth-of-market ladder (5 to 200 levels).
72
+ - **Live + historical** OpenAlgo data (REST history + WebSocket ticks with auto-reconnect), a unified `chart.on(...)` event bus, markers/signals, earnings/dividend/expiry event markers, custom price/time formatters, and EMA/RSI/ATR/Supertrend indicators.
46
73
 
47
- ## Install (once published)
74
+ ## Documentation
48
75
 
49
- ```bash
50
- npm install openalgo-charts
51
- ```
76
+ Full docs, the interactive example gallery, and the generated API reference live at:
52
77
 
53
- Loadable tiers (lazy-load only what you use):
78
+ **https://marketcalls.github.io/openalgo-charts/**
79
+
80
+ The site is built with Nextra (in [`website/`](./website)) and statically exported to GitHub Pages on every push. Every code sample on a docs page is a *live* chart running the real library, so what you read is what runs. To run the site locally:
54
81
 
55
- - `openalgo-charts` — base engine + all standard chart types
56
- - `openalgo-charts/trade` on-chart order/position/bracket tools + DOM ladder
57
- - `openalgo-charts/transform` Renko, Range bars, Point & Figure, Kagi, Line Break, Heikin Ashi
58
- - `openalgo-charts/profile` — Volume Profile, Market Profile (TPO), Footprint, Orderflow
82
+ ```bash
83
+ npm run build # build the library (dist/) the live demos import
84
+ cd website && npm install && npm run dev # http://localhost:3000/openalgo-charts
85
+ ```
59
86
 
60
87
  ## Develop
61
88
 
62
89
  ```bash
63
90
  npm install # install dev toolchain
64
91
  npm run typecheck # strict TypeScript check
65
- npm test # unit tests (vitest)
66
- npm run build # Rollup dist/ (minified ESM per tier + types)
92
+ npm test # unit tests (vitest) - 297 across 39 files
93
+ npm run build # Rollup -> dist/ (minified ESM per tier + types)
67
94
  npm run size # size-limit (Brotli) against the budget
68
- npm run verify # all of the above
95
+ npm run e2e # Playwright Chromium smoke tests
96
+ npm run verify # typecheck + test + build + size
69
97
  ```
70
98
 
71
99
  ## Principles
72
100
 
73
- - **Single canvas pipeline** (no SVG, no DOM-per-bar) small and fast.
74
- - **Gapless time axis by default** weekends, holidays, and session breaks collapse.
75
- - **Zero runtime dependencies** nothing is excluded from the size budget.
101
+ - **Single canvas pipeline** (no SVG, no DOM-per-bar) - small and fast.
102
+ - **Gapless time axis by default** - weekends, holidays, and session breaks collapse.
103
+ - **Zero runtime dependencies** - nothing is excluded from the size budget.
76
104
  - **Apache-2.0**, original code.
77
105
 
106
+ ## Status &amp; limitations
107
+
108
+ Version **1.0.1 (published)** - all engine build phases are implemented with 297 unit tests, base engine ~24 KB Brotli, full package ~38 KB Brotli (all tiers). The OpenAlgo WS/trade adapters ship and auto-reconnect, but their exact message/endpoint schemas should be verified against your running OpenAlgo build. Overlay and `indexed-to-100` price scales are not yet implemented - see [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the honest deferred list.
109
+
78
110
  ## License
79
111
 
80
- [Apache-2.0](./LICENSE).
112
+ [Apache-2.0](./LICENSE). See [`NOTICE`](./NOTICE).