openalgo-charts 2.0.2 → 2.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/README.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  **A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo.**
6
6
 
7
- Professional interactive charts, 102 built-in indicators plus your own custom ones, 51 drawing tools, order flow, market replay, linked chart grids, on-chart trading, vector SVG export and an optional WebGL2 backend. Eight lazy-loaded tiers, zero runtime dependencies, 66.45 KB Brotli for the base engine, and a one-call widget tier that adds the toolbar, drawing rail, dialogs and shortcuts.
7
+ Professional interactive charts, 102 built-in indicators plus your own custom ones, 51 drawing tools, order flow, market replay, linked chart grids, on-chart trading, vector SVG export and an optional WebGL2 backend. Eight lazy-loaded tiers, zero runtime dependencies, 66.51 KB Brotli for the base engine, and a one-call widget tier that adds the toolbar, drawing rail, dialogs and shortcuts.
8
8
 
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
- [![bundle](https://img.shields.io/badge/brotli-66%20KB%20base%20%C2%B7%20182%20KB%20all%20tiers-brightgreen.svg)](#size-budget)
12
- [![tests](https://img.shields.io/badge/tests-3999%20passing-brightgreen.svg)](#develop)
11
+ [![bundle](https://img.shields.io/badge/brotli-66%20KB%20base%20%C2%B7%20183%20KB%20all%20tiers-brightgreen.svg)](#size-budget)
12
+ [![tests](https://img.shields.io/badge/tests-4026%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)  ·  [**Migrating to 2.0**](./docs/migrating-to-2.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@2.0.2/dist/openalgo-charts.mjs';
65
+ import { createChart } from 'https://unpkg.com/openalgo-charts@2.1.0/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>
@@ -101,16 +101,16 @@ Import only what you use. Each tier is a separate bundle that registers into the
101
101
 
102
102
  | Import | Contents | Brotli |
103
103
  |---|---|---|
104
- | `openalgo-charts` | Engine, 13 chart types, panes &amp; scales, primitives, registries, chart state, chart linking, bar cache, interval registry, trading overlay, SVG export, render backend port, OpenAlgo feeds | 66.45 KB |
104
+ | `openalgo-charts` | Engine, 13 chart types, panes &amp; scales, primitives, registries, chart state, chart linking, bar cache, interval registry, trading overlay, SVG export, render backend port, OpenAlgo feeds | 66.51 KB |
105
105
  | `openalgo-charts/indicators` | 102 built-in indicators, the `registerIndicator` contract for your own, and the Tier-2 (external-data) contract | 27.27 KB |
106
106
  | `openalgo-charts/draw` | 51 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 25.82 KB |
107
107
  | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi | 2.66 KB |
108
- | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO), Footprint, order flow | 10.66 KB |
108
+ | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 11.95 KB |
109
109
  | `openalgo-charts/trade` | Order / position / bracket tools + DOM ladder | 7.61 KB |
110
110
  | `openalgo-charts/webgl` | WebGL2 series backend: batched, analytically anti-aliased GPU rendering of the standard chart types behind `renderer: 'auto'`, with a session-long fallback to the 2D path | 6.38 KB |
111
111
  | `openalgo-charts/widget` | The chart with its chrome in one call: `createWidget` adds a top bar, the drawing rail, a status line, the settings and indicator dialogs, drawing properties, a right-click menu, a keymap with a `?` panel and optional layout persistence. The only tier that ships DOM | 35.56 KB |
112
112
 
113
- Everything together is **182.39 KB Brotli**; a widget terminal (base + draw + indicators + widget, what one `createWidget` call loads) is 155.09 KB. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 74.06 KB.
113
+ Everything together is **183.74 KB Brotli**; a widget terminal (base + draw + indicators + widget, what one `createWidget` call loads) is 155.15 KB. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 74.11 KB.
114
114
 
115
115
  ## What's built
116
116
 
@@ -248,6 +248,21 @@ Order, position, and bracket lines with live P&amp;L, one-click and drag-to-modi
248
248
  ### Profiles &amp; order flow
249
249
  Volume Profile, Market Profile (TPO), Footprint, and cumulative delta.
250
250
 
251
+ For compressed TPO charts, `new MarketProfile(result, { blockDisplay: 'compact' })`
252
+ keeps small letters and volume digits visible with an original pixel font. It needs
253
+ 5 physical pixels per row, preserves the configured price aggregation, and works
254
+ on Canvas 2D. Compare it with automatic letter fading in
255
+ [`examples/market-profile/index.html`](./examples/market-profile/index.html).
256
+ The demo also provides per-day split/unsplit on right-click, day-open `o` and
257
+ newest-session `#` price markers, and Dark, Blue, Graphite, Emerald and Ivory themes.
258
+
259
+ The [website profile guide](./website/pages/docs/market-profile-examples.mdx) includes
260
+ the interactive demo, all five theme screenshots and packed/split close-ups.
261
+ See the [2.1.0 changelog](./CHANGELOG.md#210).
262
+
263
+ <a href="website/public/screenshots/market-profile/blue.png"><img src="website/public/screenshots/market-profile/blue.png" alt="Blue compact TPO theme, with the newest session split" width="49%" /></a>
264
+ <a href="website/public/screenshots/market-profile/ivory.png"><img src="website/public/screenshots/market-profile/ivory.png" alt="Ivory compact TPO theme using the same synthetic sessions" width="49%" /></a>
265
+
251
266
  ### Warm-load cache &amp; interval registry
252
267
 
253
268
  ```ts
@@ -294,16 +309,16 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
294
309
 
295
310
  | Bundle | Limit | Actual |
296
311
  |---|---|---|
297
- | Base engine | 67 KB | 66.45 KB |
298
- | Base + trade | 75 KB | 74.06 KB |
312
+ | Base engine | 67 KB | 66.51 KB |
313
+ | Base + trade | 75 KB | 74.11 KB |
299
314
  | Indicators tier | 30 KB | 27.27 KB |
300
315
  | Draw tier | 26 KB | 25.82 KB |
301
316
  | Transform tier | 5 KB | 2.66 KB |
302
- | Profile tier | 11 KB | 10.66 KB |
317
+ | Profile tier | 12 KB | 11.95 KB |
303
318
  | WebGL2 tier | 7 KB | 6.38 KB |
304
319
  | Widget tier | 36 KB | 35.56 KB |
305
- | Widget terminal (base + draw + indicators + widget) | 156 KB | 155.09 KB |
306
- | **Everything** | **183 KB** | **182.39 KB** |
320
+ | Widget terminal (base + draw + indicators + widget) | 156 KB | 155.15 KB |
321
+ | **Everything** | **184 KB** | **183.74 KB** |
307
322
 
308
323
  ## Documentation
309
324
 
@@ -346,7 +361,7 @@ python server.py --fixture # no yfinance, no network: deterministic synthetic
346
361
  ```bash
347
362
  npm install # install dev toolchain
348
363
  npm run typecheck # strict TypeScript check
349
- npm test # unit tests (vitest) - 3999 across 170 files
364
+ npm test # unit tests (vitest) - 4026 across 172 files
350
365
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
351
366
  npm run size # size-limit (Brotli) against the budget
352
367
  npm run e2e # Playwright Chromium smoke tests
@@ -363,7 +378,7 @@ npm run verify # lint + typecheck + test + build + demo tests + dts + size +
363
378
 
364
379
  ## Status &amp; limitations
365
380
 
366
- Version **2.0.2**. All engine build phases are implemented with 3999 unit tests across 170 files. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
381
+ Version **2.1.0**. All engine build phases are implemented with 4026 unit tests across 172 files. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
367
382
 
368
383
  Known gaps, stated plainly:
369
384
 
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 = "2.0.2";
2
+ declare const VERSION = "2.1.0";
3
3
  /** Returns the current library version. */
4
4
  declare function version(): string;
5
5