openalgo-charts 1.8.9 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@ Professional interactive charts, 102 built-in indicators plus your own custom on
9
9
  [![npm version](https://img.shields.io/npm/v/openalgo-charts.svg?color=cb3837&label=npm)](https://www.npmjs.com/package/openalgo-charts)
10
10
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
11
11
  [![bundle](https://img.shields.io/badge/brotli-61%20KB%20base%20%C2%B7%20122%20KB%20all%20tiers-brightgreen.svg)](#size-budget)
12
- [![tests](https://img.shields.io/badge/tests-2586%20passing-brightgreen.svg)](#develop)
12
+ [![tests](https://img.shields.io/badge/tests-2590%20passing-brightgreen.svg)](#develop)
13
13
  [![dependencies](https://img.shields.io/badge/runtime%20deps-0-brightgreen.svg)](#principles)
14
14
 
15
15
  [**Documentation**](https://marketcalls.github.io/openalgo-charts/)  ·  [**Live examples**](https://marketcalls.github.io/openalgo-charts/examples)  ·  [**Getting started**](./docs/getting-started.md)  ·  [**Architecture**](./ARCHITECTURE.md)
@@ -62,7 +62,7 @@ in front of npm rather than being places you upload to. A chart is one HTML file
62
62
  ```html
63
63
  <div id="chart" style="width:100vw;height:100vh"></div>
64
64
  <script type="module">
65
- import { createChart } from 'https://unpkg.com/openalgo-charts@1.8.9/dist/openalgo-charts.mjs';
65
+ import { createChart } from 'https://unpkg.com/openalgo-charts@1.9.1/dist/openalgo-charts.mjs';
66
66
  const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
67
67
  chart.addSeries('candlestick').setData(bars);
68
68
  </script>
@@ -86,7 +86,7 @@ Import only what you use. Each tier is a separate bundle that registers into the
86
86
  | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO), Footprint, order flow | 10.7 KB |
87
87
  | `openalgo-charts/trade` | Order / position / bracket tools + DOM ladder | 7.6 KB |
88
88
 
89
- Everything together is **122.15 KB Brotli**. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 68.43 KB.
89
+ Everything together is **122.16 KB Brotli**. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 68.45 KB.
90
90
 
91
91
  ## What's built
92
92
 
@@ -227,13 +227,13 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
227
227
 
228
228
  | Bundle | Limit | Actual |
229
229
  |---|---|---|
230
- | Base engine | 62 KB | 60.83 KB |
231
- | Base + trade | 70 KB | 68.43 KB |
230
+ | Base engine | 62 KB | 60.84 KB |
231
+ | Base + trade | 70 KB | 68.45 KB |
232
232
  | Indicators tier | 30 KB | 27.27 KB |
233
233
  | Draw tier | 14 KB | 13.13 KB |
234
234
  | Transform tier | 5 KB | 2.66 KB |
235
235
  | Profile tier | 11 KB | 10.66 KB |
236
- | **Everything** | **124 KB** | **122.15 KB** |
236
+ | **Everything** | **124 KB** | **122.16 KB** |
237
237
 
238
238
  ## Documentation
239
239
 
@@ -273,7 +273,7 @@ cd examples/yfinance && pip install -r requirements.txt && python server.py
273
273
  ```bash
274
274
  npm install # install dev toolchain
275
275
  npm run typecheck # strict TypeScript check
276
- npm test # unit tests (vitest) - 2586 across 140 files
276
+ npm test # unit tests (vitest) - 2590 across 141 files
277
277
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
278
278
  npm run size # size-limit (Brotli) against the budget
279
279
  npm run e2e # Playwright Chromium smoke tests
@@ -290,7 +290,7 @@ npm run verify # typecheck + test + build + size
290
290
 
291
291
  ## Status &amp; limitations
292
292
 
293
- Version **1.8.9**. All engine build phases are implemented with 2586 unit tests across 140 files.
293
+ Version **1.9.1**. All engine build phases are implemented with 2590 unit tests across 141 files.
294
294
 
295
295
  Known gaps, stated plainly:
296
296
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Library version string. Matches package.json (published npm release). */
2
- declare const VERSION = "1.8.9";
2
+ declare const VERSION = "1.9.1";
3
3
  /** Returns the current library version. */
4
4
  declare function version(): string;
5
5
 
@@ -2387,6 +2387,20 @@ interface IndicatorHost {
2387
2387
  * one to ask for the instrument's own step.
2388
2388
  */
2389
2389
  tickSize?(paneIndex: number): number | undefined;
2390
+ /**
2391
+ * Write a number the way the price axis of that pane writes it.
2392
+ *
2393
+ * The legend sits inches from the axis and names the same quantity, so the
2394
+ * two disagreeing is the reading a user has to reconcile themselves. Deriving
2395
+ * the format here from a tick got that wrong twice over: a study pane carries
2396
+ * no tick at all, so a percentage read `0.618` beside an axis saying `0.62`,
2397
+ * and a price pane's tick alone misses the precision floor and the host's own
2398
+ * formatter, so a volume study read seven digits where its axis said `1.20M`.
2399
+ *
2400
+ * Asking the scale removes the second opinion. Optional so a host driving
2401
+ * this module alone still works, falling back to the magnitude ladder.
2402
+ */
2403
+ formatPrice?(paneIndex: number, value: number): string | undefined;
2390
2404
  /** Pin a pane's price scale to a fixed range, or release it with `null`. */
2391
2405
  setPaneRange(paneIndex: number, range: {
2392
2406
  min: number;