openalgo-charts 2.1.7 → 2.1.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
@@ -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, 73.31 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, 76.16 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-73.31%20KB%20base%20%C2%B7%20197.58%20KB%20all%20tiers-brightgreen.svg)](#size-budget)
12
- [![tests](https://img.shields.io/badge/tests-4337%20passing-brightgreen.svg)](#develop)
11
+ [![bundle](https://img.shields.io/badge/brotli-76.16%20KB%20base%20%C2%B7%20203.62%20KB%20all%20tiers-brightgreen.svg)](#size-budget)
12
+ [![tests](https://img.shields.io/badge/tests-4402%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)
@@ -43,14 +43,13 @@ Every chart in the [live gallery](https://marketcalls.github.io/openalgo-charts/
43
43
 
44
44
  ## Install
45
45
 
46
- Current version: **2.1.7**.
46
+ Current version: **2.1.9**.
47
47
 
48
- This release adds a searchable Objects panel and shared object-management API for
49
- drawings, indicators and host-registered profiles. Dialogs fit narrow chart panes,
50
- and indicator visibility survives settings changes and layout restoration.
51
- See the [Objects guide](https://marketcalls.github.io/openalgo-charts/docs/objects/),
52
- the [2.1.7 changelog](./CHANGELOG.md#217) and
53
- [OpenAlgo compatibility guide](https://marketcalls.github.io/openalgo-charts/docs/openalgo-compatibility/).
48
+ This release adds default corner branding and optional background watermarks across
49
+ charts, widgets and reference hosts. It also fixes profile example histograms,
50
+ maximized-pane exports and logo gestures, and updates the website stock simulations.
51
+ See the [branding guide](https://marketcalls.github.io/openalgo-charts/docs/branding-and-watermarks/)
52
+ and the [2.1.9 changelog](./CHANGELOG.md#219).
54
53
 
55
54
  ```bash
56
55
  npm install openalgo-charts
@@ -63,6 +62,14 @@ const chart = createChart(document.getElementById('chart'));
63
62
  chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
64
63
  ```
65
64
 
65
+ ## Branding and optional watermark
66
+
67
+ Version 2.1.9 adds default corner branding and an optional background
68
+ watermark. The background text starts off. Use `branding: false` for a host-owned
69
+ logo, and `watermark: true` with `setDataContext` to show the current symbol and
70
+ interval. The same watermark controls appear under Appearance in chart settings.
71
+ See the [branding guide](https://marketcalls.github.io/openalgo-charts/docs/branding-and-watermarks/).
72
+
66
73
  ## No build step
67
74
 
68
75
  Every release is on unpkg and jsDelivr the moment it is published, because both sit
@@ -71,7 +78,7 @@ in front of npm rather than being places you upload to. A chart is one HTML file
71
78
  ```html
72
79
  <div id="chart" style="width:100vw;height:100vh"></div>
73
80
  <script type="module">
74
- import { createChart } from 'https://unpkg.com/openalgo-charts@2.1.7/dist/openalgo-charts.mjs';
81
+ import { createChart } from 'https://unpkg.com/openalgo-charts@2.1.9/dist/openalgo-charts.mjs';
75
82
  const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
76
83
  chart.addSeries('candlestick').setData(bars);
77
84
  </script>
@@ -94,6 +101,7 @@ const widget = createWidget('#terminal', {
94
101
  feed: new OpenAlgoDataFeed({ baseUrl: 'http://127.0.0.1:5000', apiKey: 'YOUR_KEY' }),
95
102
  symbol: 'RELIANCE', exchange: 'NSE', interval: '5m',
96
103
  theme: 'dark',
104
+ mobile: 'auto', // compact controls at 640 CSS px or less, or on a coarse pointer
97
105
  persist: true,
98
106
  onOrder: (order) => broker.place(order), // the right-click menu offers order entry only when this is set
99
107
  });
@@ -102,7 +110,7 @@ widget.chart; // the Chart underneath, every base API available
102
110
  widget.draw; // the DrawingController the rail drives
103
111
  ```
104
112
 
105
- `openalgo-charts/widget` is the eighth tier and the only one that builds DOM: a top bar (symbol search, interval pills, chart type, Indicators, capture, settings, theme), the drawing rail with pins and flyouts, a status line, toasts, a right-click menu, a keymap with a `?` panel, and optional layout persistence. Every dialog is generated from a schema the engine already ships (`chartSettingsSchema`, the indicator descriptor, `drawingSettingsSchema`), so no control exists without something behind it, and the chrome takes its colours from the active `ChartTheme` through `--oac-` tokens, so `setTheme` recolours canvas and chrome together. It drives the engine only through the public API, and the build proves it: the ESLint tier ACL and `npm run shake` keep it out of every other bundle, and importing the module touches no DOM, so it can sit in code that also runs on a server. The guide is [`docs/widget.md`](./docs/widget.md).
113
+ `openalgo-charts/widget` is the eighth tier and the only one that builds DOM: a top bar (symbol search, interval pills, chart type, Indicators, capture, settings, theme), the drawing rail with pins and flyouts, a status line, responsive mobile header and bottom controls, toasts, a right-click menu, a keymap with a `?` panel, and optional layout persistence. Every dialog is generated from a schema the engine already ships (`chartSettingsSchema`, the indicator descriptor, `drawingSettingsSchema`), so no control exists without something behind it, and the chrome takes its colours from the active `ChartTheme` through `--oac-` tokens, so `setTheme` recolours canvas and chrome together. It drives the engine only through the public API, and the build proves it: the ESLint tier ACL and `npm run shake` keep it out of every other bundle, and importing the module touches no DOM, so it can sit in code that also runs on a server. The guide is [`docs/widget.md`](./docs/widget.md).
106
114
 
107
115
  ## Tiers
108
116
 
@@ -110,16 +118,16 @@ Import only what you use. Each tier is a separate bundle that registers into the
110
118
 
111
119
  | Import | Contents | Brotli |
112
120
  |---|---|---|
113
- | `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 | 73.31 KB |
121
+ | `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 | 76.16 KB |
114
122
  | `openalgo-charts/indicators` | 102 built-in indicators, the `registerIndicator` contract for your own, and the Tier-2 (external-data) contract | 28.05 KB |
115
123
  | `openalgo-charts/draw` | 51 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 25.90 KB |
116
124
  | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi | 2.66 KB |
117
125
  | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 14.96 KB |
118
126
  | `openalgo-charts/trade` | Order / position / bracket tools + DOM ladder | 7.61 KB |
119
127
  | `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 |
120
- | `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 | 38.72 KB |
128
+ | `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 | 41.91 KB |
121
129
 
122
- Everything together is **197.58 KB Brotli**; a widget terminal (base + draw + indicators + widget, what one `createWidget` call loads) is 165.97 KB. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 80.92 KB.
130
+ Everything together is **203.62 KB Brotli**; a widget terminal (base + draw + indicators + widget, what one `createWidget` call loads) is 172.02 KB. Figures are measured from the 2.1.9 release build. The trade tier is listed as its delta over the base, so loading base + trade costs 83.77 KB.
123
131
 
124
132
  ## What's built
125
133
 
@@ -411,16 +419,16 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
411
419
 
412
420
  | Bundle | Limit | Actual |
413
421
  |---|---|---|
414
- | Base engine | 74 KB | 73.31 KB |
415
- | Base + trade | 82 KB | 80.92 KB |
422
+ | Base engine | 77 KB | 76.16 KB |
423
+ | Base + trade | 85 KB | 83.77 KB |
416
424
  | Indicators tier | 30 KB | 28.05 KB |
417
425
  | Draw tier | 26 KB | 25.90 KB |
418
426
  | Transform tier | 5 KB | 2.66 KB |
419
427
  | Profile tier | 15 KB | 14.96 KB |
420
428
  | WebGL2 tier | 7 KB | 6.38 KB |
421
- | Widget tier | 40 KB | 38.72 KB |
422
- | Widget terminal (base + draw + indicators + widget) | 168 KB | 165.97 KB |
423
- | **Everything** | **200 KB** | **197.58 KB** |
429
+ | Widget tier | 42 KB | 41.91 KB |
430
+ | Widget terminal (base + draw + indicators + widget) | 173 KB | 172.02 KB |
431
+ | **Everything** | 205 KB | 203.62 KB |
424
432
 
425
433
  ## Documentation
426
434
 
@@ -465,7 +473,7 @@ See [Contributing](./CONTRIBUTING.md) for setup, targeted checks, documentation
465
473
  ```bash
466
474
  npm install # install dev toolchain
467
475
  npm run typecheck # strict TypeScript check
468
- npm test # unit tests (vitest) - 4337 across 193 files
476
+ npm test # unit tests (vitest) - 4402 across 197 files
469
477
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
470
478
  npm run size # size-limit (Brotli) against the budget
471
479
  npm run e2e # Playwright Chromium smoke tests
@@ -482,7 +490,7 @@ npm run verify # lint + typecheck + test + build + demo tests + dts + size +
482
490
 
483
491
  ## Status &amp; limitations
484
492
 
485
- Version **2.1.7**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
493
+ Version **2.1.9**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
486
494
 
487
495
  Known gaps, stated plainly:
488
496