openalgo-charts 2.5.8 → 2.5.9

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
@@ -12,7 +12,7 @@ with no runtime dependencies.
12
12
  [![npm version](https://img.shields.io/npm/v/openalgo-charts.svg?color=cb3837&label=npm)](https://www.npmjs.com/package/openalgo-charts)
13
13
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
14
14
  [![npm downloads](https://img.shields.io/npm/dm/openalgo-charts.svg?color=0ea5e9&label=npm%20downloads)](https://www.npmjs.com/package/openalgo-charts)
15
- [![tests](https://img.shields.io/badge/engine%20tests-9374%20passing-brightgreen.svg)](#develop)
15
+ [![tests](https://img.shields.io/badge/engine%20tests-9382%20passing-brightgreen.svg)](#develop)
16
16
  [![dependencies](https://img.shields.io/badge/runtime%20deps-0-brightgreen.svg)](#principles)
17
17
 
18
18
  [**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)
@@ -25,7 +25,7 @@ with no runtime dependencies.
25
25
  npm install openalgo-charts
26
26
  ```
27
27
 
28
- Current version: **2.5.8**, a rendering performance release: a live tick no longer rebuilds the time index or rewrites every study plot, sixteen common built-in studies update without a pass over the whole history, a tick or a study recompute repaints only the panes it changes, a zoomed-out chart draws one stick per pixel column (the level of detail, now on by default), primitives can bound their hit tests, and a render bench holds frame budgets per bar count in CI. 2.5.7 split the chart's code by responsibility with no change to the API or to what it paints.
28
+ Current version: **2.5.9**, drawing interaction and replay: drawings belong to the instrument they were drawn on, the magnet works on every pane and in every drag, box select, drag to copy, an eraser, a temporary measure and visibility per interval join the drawing controller, the widget adds a floating drawing toolbar, style templates and a coordinates tab, replay's forming bar stays inside the bar it closes on (and can form over simulated steps where no finer data exists), and lines reach the edges of the view. 2.5.8 was the rendering performance release.
29
29
  See the [changelog](./CHANGELOG.md) for release notes.
30
30
 
31
31
  ## Quick start
@@ -54,9 +54,16 @@ Bar timestamps use UTC seconds. See [getting started](./docs/getting-started.md)
54
54
  for setup, [data feeds](https://marketcalls.github.io/openalgo-charts/docs/data-feeds/)
55
55
  for live data, or [the widget example](#the-whole-terminal-in-one-call) for chart controls.
56
56
 
57
+ In a framework, create the chart when the component mounts and call `chart.destroy()`
58
+ when it unmounts. [Framework integration](https://marketcalls.github.io/openalgo-charts/docs/frameworks/)
59
+ covers React, Next.js, Angular and Svelte. The [Vue 3 guide](https://marketcalls.github.io/openalgo-charts/docs/vue/)
60
+ has a composable and a component tested in Chromium, Firefox and WebKit, with a
61
+ no-build example in [`examples/vue`](./examples/vue). In Vue, hold the chart in a
62
+ `shallowRef`, never in `ref()` or `reactive()`.
63
+
57
64
  ## Architecture
58
65
 
59
- <a href="docs/architecture-diagram.svg"><img src="docs/architecture-diagram.svg" alt="OpenAlgo Charts 2.5.8 architecture: host responsibilities, the base data-to-rendering pipeline with alerts and shared replay, and eight optional tiers including workspace storage, trading tools and the widget" width="920" /></a>
66
+ <a href="docs/architecture-diagram.svg"><img src="docs/architecture-diagram.svg" alt="OpenAlgo Charts 2.5.9 architecture: host responsibilities, the base data-to-rendering pipeline with alerts and shared replay, and eight optional tiers including workspace storage, trading tools and the widget" width="920" /></a>
60
67
 
61
68
  How data reaches the chart, what your app owns, and which features you can import.
62
69
  [Open the full-size diagram](docs/architecture-diagram.svg).
@@ -107,7 +114,7 @@ You can also load the library from a CDN in a plain HTML page:
107
114
  ```html
108
115
  <div id="chart" style="width:100vw;height:100vh"></div>
109
116
  <script type="module">
110
- import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.5.8/dist/openalgo-charts.mjs';
117
+ import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.5.9/dist/openalgo-charts.mjs';
111
118
  const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
112
119
  chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
113
120
  chart.fitContent();
@@ -165,17 +172,17 @@ Unused optional tiers stay out of the base chart download.
165
172
 
166
173
  | Import | Contents | Brotli |
167
174
  |---|---|---|
168
- | `openalgo-charts` | Engine, 13 chart types, panes and scales, custom indicator registry, primitives, alerts, replay, comparisons, chart linking, state, feeds, bar cache, trading overlays, CSV and SVG export | 130.37 kB |
175
+ | `openalgo-charts` | Engine, 13 chart types, panes and scales, custom indicator registry, primitives, alerts, replay, comparisons, chart linking, state, feeds, bar cache, trading overlays, CSV and SVG export | 131.68 kB |
169
176
  | `openalgo-charts/indicators` | 105 built-in indicators, calculation helpers and helpers for studies that use external data | 40.38 kB |
170
- | `openalgo-charts/draw` | 87 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 48.42 kB |
171
- | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi, and symbol arithmetic (`AAPL/MSFT`) | 4.50 kB |
177
+ | `openalgo-charts/draw` | 87 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 55.61 kB |
178
+ | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi, and symbol arithmetic (`AAPL/MSFT`) | 4.56 kB |
172
179
  | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 14.96 kB |
173
180
  | `openalgo-charts/trade` | Order, position and bracket tools, account state, order preview and position commands, plus a depth-of-market ladder | 16.69 kB |
174
- | `openalgo-charts/webgl` | GPU drawing for supported series, with Canvas 2D fallback | 6.39 kB |
175
- | `openalgo-charts/widget` | `createWidget`: toolbar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, shortcuts and optional layout persistence | 92.72 kB |
176
- | `openalgo-charts/workspace` | Validated workspace and indicator-template documents, named watchlists, named catalogs with revision checks, asynchronous storage and an IndexedDB adapter; no DOM | 10.47 kB |
181
+ | `openalgo-charts/webgl` | GPU drawing for supported series, with Canvas 2D fallback | 6.93 kB |
182
+ | `openalgo-charts/widget` | `createWidget`: toolbar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, shortcuts and optional layout persistence | 99.64 kB |
183
+ | `openalgo-charts/workspace` | Validated workspace and indicator-template documents, named watchlists, named catalogs with revision checks, asynchronous storage and an IndexedDB adapter; no DOM | 11.33 kB |
177
184
 
178
- Everything together is **364.91 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 311.90 kB. Figures are measured from the 2.5.8 release build. The trade tier is 16.69 kB on its own; base + trade costs 147.06 kB. Sizes use decimal kB.
185
+ Everything together is **381.78 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 327.32 kB. Figures are measured from the 2.5.9 release build. The trade tier is 16.69 kB on its own; base + trade costs 148.36 kB. Sizes use decimal kB.
179
186
 
180
187
  ## What's built
181
188
 
@@ -501,17 +508,17 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
501
508
 
502
509
  | Bundle | Limit | Actual |
503
510
  |---|---|---|
504
- | Base engine | 130.38 kB | 130.37 kB |
505
- | Base + trade | 147.07 kB | 147.06 kB |
511
+ | Base engine | 131.68 kB | 131.68 kB |
512
+ | Base + trade | 148.37 kB | 148.36 kB |
506
513
  | Indicators tier | 40.39 kB | 40.38 kB |
507
- | Draw tier | 48.42 kB | 48.42 kB |
508
- | Transform tier | 6 kB | 4.50 kB |
514
+ | Draw tier | 55.62 kB | 55.61 kB |
515
+ | Transform tier | 6 kB | 4.56 kB |
509
516
  | Profile tier | 15 kB | 14.96 kB |
510
- | WebGL2 tier | 7 kB | 6.39 kB |
511
- | Widget tier | 92.72 kB | 92.72 kB |
512
- | Widget terminal (base + draw + indicators + widget) | 311.90 kB | 311.90 kB |
513
- | Workspace tier | 10.47 kB | 10.47 kB |
514
- | **Everything** | 364.91 kB | 364.91 kB |
517
+ | WebGL2 tier | 7 kB | 6.93 kB |
518
+ | Widget tier | 99.65 kB | 99.64 kB |
519
+ | Widget terminal (base + draw + indicators + widget) | 327.32 kB | 327.32 kB |
520
+ | Workspace tier | 11.34 kB | 11.33 kB |
521
+ | **Everything** | 381.79 kB | 381.78 kB |
515
522
 
516
523
  ## Documentation
517
524
 
@@ -536,7 +543,7 @@ Teach your AI coding assistant this library:
536
543
  npx skills add https://github.com/marketcalls/openalgo-charts
537
544
  ```
538
545
 
539
- Installs six skills from [`.github/skills/`](./.github/skills) - a reference hub with 22 deep-dive files covering the whole API surface and its foot-guns, plus task skills for scaffolding a chart, adding indicators, building a terminal, writing a plugin, and debugging. Works with Claude Code, Cursor, Codex, Copilot, Gemini CLI and the rest of the `skills` CLI's supported agents.
546
+ Installs six skills from [`.github/skills/`](./.github/skills) - a reference hub with 26 deep-dive files covering the whole API surface and its foot-guns, plus task skills for scaffolding a chart, adding indicators, building a terminal, writing a plugin, and debugging. Works with Claude Code, Cursor, Codex, Copilot, Gemini CLI and the rest of the `skills` CLI's supported agents.
540
547
 
541
548
  ## Examples
542
549
 
@@ -549,6 +556,12 @@ cd examples/yfinance && pip install -r requirements.txt && python server.py
549
556
  python server.py --fixture # no yfinance, no network: deterministic synthetic bars
550
557
  ```
551
558
 
559
+ A **Vue 3 example** ([`examples/vue`](./examples/vue)) runs with no build step from Vue's
560
+ browser build: a composable, a component with symbol, interval and theme props, a bare
561
+ chart and the widget under one `KeepAlive`, and a switch that unmounts both. Serve the
562
+ repository root after `npm run build` (for example `node tests/e2e/serve.cjs`) and open
563
+ `/examples/vue/index.html`.
564
+
552
565
  ## Develop
553
566
 
554
567
  See [Contributing](./CONTRIBUTING.md) for setup, targeted checks, documentation updates and the release workflow.
@@ -556,8 +569,8 @@ See [Contributing](./CONTRIBUTING.md) for setup, targeted checks, documentation
556
569
  ```bash
557
570
  npm install # install dev toolchain
558
571
  npm run typecheck # strict TypeScript check
559
- npm test # engine unit tests (Vitest): 9374 across 418 files
560
- npm run test:demo # reference-host tests: 653 across 62 files
572
+ npm test # engine unit tests (Vitest): 9803 across 442 files
573
+ npm run test:demo # reference-host tests: 668 across 63 files
561
574
  npm run test:endurance # node endurance-harness tests: 7 cases
562
575
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
563
576
  npm run size # size-limit (Brotli) against the budget
@@ -577,7 +590,7 @@ npm run verify # lint + types + unit + endurance harness + build + demo + dt
577
590
 
578
591
  ## Status &amp; limitations
579
592
 
580
- Version **2.5.8**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
593
+ Version **2.5.9**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
581
594
 
582
595
  Known gaps, stated plainly:
583
596