openalgo-charts 2.7.0 → 2.7.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/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-12042%20passing-brightgreen.svg)](#develop)
15
+ [![tests](https://img.shields.io/badge/engine%20tests-12117%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.7.0**, a finish release. The drawing tool icons are redrawn around their anchors: every point you place is an open ring and a line stops at its edge, so a trend line, a ray and an extended line are told apart by their rings, and patterns, channels, positions and the Fibonacci and Gann studies show the points that set them. The widget's rail keeps its tools in view in a short chart, a failed load is reported once with its retry, and reduced motion stops every animation. No tool, option or export is added or removed. 2.6.9 was a security release for the build toolchain and the documentation site, over 2.6.8, which made volume studies work on price-driven charts.
28
+ Current version: **2.7.2**. Elliott wave counts are numbered from the point after their origin, as a count is read: the origin is unlabelled, the waves read (1) to (5) or (A) to (C) in the default Intermediate degree, each label is centred on its point, a count is drawn as it is placed, and each count's icon names its first and last wave. 2.7.1 added the five Elliott wave counts, each drawn from its origin and labelled by degree, for 90 drawing tools.
29
29
 
30
30
  2.6.4 was an order flow release: a footprint finds the imbalances beside a row that never traded, prints volume shaded by delta, alerts once when price comes back to a zone, extends only the zone kinds you pick, and takes a colour for each of its parts or one of six named themes; the website gains an Order flow page of live footprint and market profile examples. 2.6.3 was a finish release: finer glyphs at one line weight, a drawing rail that folds away, a smoother wheel and trackpad zoom, a widget whose drag keeps the price scale fitting, and a log scale that fills the pane. 2.6.2 was a fix for the bottom bar's ranges and Go to, which reported missing history across a weekend or another gap no session trades in. 2.6.1 was order flow analytics for the footprint (trade classification, a trade size filter, imbalance and delta views, zones, unfinished auctions, delta flips and session statistics), rows aligned on the even boundary, Renko and point and figure sizing from price or the ATR, and settings dialogs for both chart types in the widget and the reference host. 2.6.0 was analysis depth and a stricter API: the chart applies Heikin Ashi, Renko, range bars, line break, point and figure and Kagi to the bars you feed, live, with each study on the elements or the underlying bars; seven new built-ins and a timeframe input on 29 of them; symbol search through the OpenAlgo feed; rich event details with host actions; a typed event map for `chart.on`; a classic-script build of every tier and `require()` of the ESM files; and declarations that hold for a host compiling with both strict flags. 2.5.10 was the persistence, saved layouts and chart grid release.
31
31
  See the [changelog](./CHANGELOG.md) for release notes.
@@ -119,7 +119,7 @@ You can also load the library from a CDN in a plain HTML page:
119
119
  ```html
120
120
  <div id="chart" style="width:100vw;height:100vh"></div>
121
121
  <script type="module">
122
- import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.7.0/dist/openalgo-charts.mjs';
122
+ import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.7.2/dist/openalgo-charts.mjs';
123
123
  const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
124
124
  chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
125
125
  chart.fitContent();
@@ -181,17 +181,17 @@ Unused optional tiers stay out of the base chart download.
181
181
 
182
182
  | Import | Contents | Brotli |
183
183
  |---|---|---|
184
- | `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 | 140.10 kB |
184
+ | `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 | 140.06 kB |
185
185
  | `openalgo-charts/indicators` | 112 built-in indicators, calculation helpers and helpers for studies that use external data | 44.85 kB |
186
- | `openalgo-charts/draw` | 87 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 59.60 kB |
186
+ | `openalgo-charts/draw` | 90 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 60.79 kB |
187
187
  | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi, and symbol arithmetic (`AAPL/MSFT`) | 6.38 kB |
188
188
  | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 20.83 kB |
189
189
  | `openalgo-charts/trade` | Order, position and bracket tools, account state, order preview and position commands, plus a depth-of-market ladder | 16.88 kB |
190
190
  | `openalgo-charts/webgl` | GPU drawing for supported series, with Canvas 2D fallback | 6.99 kB |
191
- | `openalgo-charts/widget` | `createWidget`: toolbar, bottom bar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, a shortcuts editor, saved layouts, the chart grid (`createChartGrid`) and optional persistence in IndexedDB | 129.56 kB |
191
+ | `openalgo-charts/widget` | `createWidget`: toolbar, bottom bar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, a shortcuts editor, saved layouts, the chart grid (`createChartGrid`) and optional persistence in IndexedDB | 129.58 kB |
192
192
  | `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.73 kB |
193
193
 
194
- Everything together is **436.91 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 374.10 kB. The widget's eight first-use parts (the shortcuts editor, the Layouts menu, the templates list, the chart data dialog, the chart type settings dialog, the grid bar and its menus, and the IndexedDB store) add 21.00 kB in files of their own, fetched only when a widget first uses one. The nine classic-script files together are 450.64 kB. Figures are measured from the 2.7.0 release build. The trade tier is 16.88 kB on its own; base + trade costs 156.98 kB. Sizes use decimal kB.
194
+ Everything together is **438.07 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 375.27 kB. The widget's eight first-use parts (the shortcuts editor, the Layouts menu, the templates list, the chart data dialog, the chart type settings dialog, the grid bar and its menus, and the IndexedDB store) add 21.00 kB in files of their own, fetched only when a widget first uses one. The nine classic-script files together are 451.66 kB. Figures are measured from the 2.7.2 release build. The trade tier is 16.88 kB on its own; base + trade costs 156.93 kB. Sizes use decimal kB.
195
195
 
196
196
  ## What's built
197
197
 
@@ -249,7 +249,7 @@ const draw = new DrawingController(chart, { magnet: true });
249
249
  draw.setTool('trend-line'); // the next two clicks place it
250
250
  ```
251
251
 
252
- 87 tools. Lines, channels and four pitchfork variants. Fibonacci levels, time projections, fans, circles, arcs, wedges and spirals. Gann fans, boxes and squares. Harmonic patterns, Elliott waves and Head and Shoulders. Geometric wavefronts and tessellation. Shapes, paths, forecasts, positions, measurements, text, tables and freehand brushes. Every tool appears in the [editable drawing gallery](https://marketcalls.github.io/openalgo-charts/demos/drawings/index.html), with simulated NIFTY prices near 23800 and desktop or touch controls.
252
+ 90 tools. Lines, channels and four pitchfork variants. Fibonacci levels, time projections, fans, circles, arcs, wedges and spirals. Gann fans, boxes and squares. Harmonic patterns, Head and Shoulders, and five Elliott wave counts (impulse, correction, triangle, double and triple combination) labelled by degree. Geometric wavefronts and tessellation. Shapes, paths, forecasts, positions, measurements, text, tables and freehand brushes. Every tool appears in the [editable drawing gallery](https://marketcalls.github.io/openalgo-charts/demos/drawings/index.html), with simulated NIFTY prices near 23800 and desktop or touch controls.
253
253
 
254
254
  Headless by design: no toolbar, no dialogs. Placement with live preview, selection, whole-shape and per-anchor dragging, magnet snap to O/H/L/C, undo/redo (a drag is one step), and persistence. A drawing can be pinned to the screen (`space: 'viewport'`), so pan and zoom leave it where it is. A drawing's `policy` makes it read-only, unselectable, transient or unlisted, for levels the host places and the user should not move. Studies and drawings share one draw order per pane (`chart.seriesStack`, `chart.moveInSeriesStack`, `draw.placeInStack`), so a drawing can sit between two studies and the pointer takes what is painted on top. Anchors are `{ time, price }`, never pixels, so they survive zoom and resolve inside collapsed session gaps and past the last bar.
255
255
 
@@ -517,19 +517,19 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
517
517
 
518
518
  | Bundle | Limit | Actual |
519
519
  |---|---|---|
520
- | Base engine | 140.14 kB | 140.10 kB |
521
- | Base + trade | 157.02 kB | 156.98 kB |
520
+ | Base engine | 140.14 kB | 140.06 kB |
521
+ | Base + trade | 157.02 kB | 156.93 kB |
522
522
  | Indicators tier | 44.86 kB | 44.85 kB |
523
- | Draw tier | 59.60 kB | 59.60 kB |
523
+ | Draw tier | 60.79 kB | 60.79 kB |
524
524
  | Transform tier | 6.39 kB | 6.38 kB |
525
525
  | Profile tier | 20.83 kB | 20.83 kB |
526
526
  | WebGL2 tier | 6.99 kB | 6.99 kB |
527
- | Widget tier | 129.56 kB | 129.56 kB |
527
+ | Widget tier | 129.58 kB | 129.58 kB |
528
528
  | Widget first-use parts (eight files beside the widget tier) | 21.00 kB | 21.00 kB |
529
- | Widget terminal (base + draw + indicators + widget) | 374.10 kB | 374.10 kB |
529
+ | Widget terminal (base + draw + indicators + widget) | 375.27 kB | 375.27 kB |
530
530
  | Workspace tier | 11.73 kB | 11.73 kB |
531
- | Script tags (the nine classic-script files) | 450.64 kB | 450.64 kB |
532
- | **Everything** | 436.91 kB | 436.91 kB |
531
+ | Script tags (the nine classic-script files) | 451.66 kB | 451.66 kB |
532
+ | **Everything** | 438.08 kB | 438.07 kB |
533
533
 
534
534
  ## Documentation
535
535
 
@@ -580,7 +580,7 @@ See [Contributing](./CONTRIBUTING.md) for setup, targeted checks, documentation
580
580
  ```bash
581
581
  npm install # install dev toolchain
582
582
  npm run typecheck # TypeScript: src with the stricter flags, then the tests
583
- npm test # engine unit tests (Vitest): 12042 across 527 files
583
+ npm test # engine unit tests (Vitest): 12117 across 528 files
584
584
  npm run test:demo # reference-host tests: 740 across 69 files
585
585
  npm run test:endurance # node endurance-harness tests: 7 cases
586
586
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
@@ -601,7 +601,7 @@ npm run verify # lint + types + cycles + unused exports + unit + endurance h
601
601
 
602
602
  ## Status &amp; limitations
603
603
 
604
- Version **2.7.0**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
604
+ Version **2.7.2**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
605
605
 
606
606
  Known gaps, stated plainly:
607
607
 
@@ -433,6 +433,14 @@ interface DrawingTool {
433
433
  * polyline behaviour and never terminates on its own.
434
434
  */
435
435
  freehand?: boolean;
436
+ /**
437
+ * Paint the tool itself while it is placed, from its second anchor on, in
438
+ * place of the dashed guide every other multi-anchor tool shows. Declare it
439
+ * only when `draw` paints whatever anchors it is given, from two up to
440
+ * `points`: a wave count does, so each click shows the wave it ends and that
441
+ * wave's label, and the first click reads as the origin it is.
442
+ */
443
+ progressive?: boolean;
436
444
  /**
437
445
  * Hold Shift to snap the free end of a two-anchor tool to 45 degree steps
438
446
  * on screen, while placing and while dragging a handle. The line family
@@ -2936,6 +2944,12 @@ declare function keyToDrawingAction(e: DrawingKeyEvent, ctx: DrawingKeyContext):
2936
2944
  * later version is read the same lenient way: what this build knows is kept
2937
2945
  * and the rest dropped, since refusing it would empty the chart on load.
2938
2946
  *
2947
+ * 2.7.1 gave the Elliott impulse and correction an origin anchor. One saved
2948
+ * before has an anchor fewer, and gains an origin on its first anchor, where
2949
+ * it draws nothing (see elliott.ts); the document version stays as it was,
2950
+ * since the shape of a drawing did not change, only how many anchors a tool
2951
+ * takes.
2952
+ *
2939
2953
  * Idempotent on a version 2 or 3 document, so a host can call it on every load.
2940
2954
  */
2941
2955
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Library version string. Matches package.json (including locally prepared releases). */
2
- declare const VERSION = "2.7.0";
2
+ declare const VERSION = "2.7.2";
3
3
  /** Returns the current library version. */
4
4
  declare function version(): string;
5
5