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 +30 -22
- package/dist/index.d.ts +232 -188
- package/dist/openalgo-charts.mjs +1 -1
- package/dist/openalgo-charts.mjs.map +1 -1
- package/dist/openalgo-charts.standalone.js +1 -1
- package/dist/openalgo-charts.standalone.js.map +1 -1
- package/dist/openalgo-charts.widget.mjs +1 -1
- package/dist/openalgo-charts.widget.mjs.map +1 -1
- package/dist/widget/index.d.ts +34 -1
- package/package.json +1 -1
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,
|
|
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
|
[](https://www.npmjs.com/package/openalgo-charts)
|
|
10
10
|
[](./LICENSE)
|
|
11
|
-
[](#size-budget)
|
|
12
|
+
[](#develop)
|
|
13
13
|
[](#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.
|
|
46
|
+
Current version: **2.1.9**.
|
|
47
47
|
|
|
48
|
-
This release adds
|
|
49
|
-
|
|
50
|
-
and
|
|
51
|
-
See the [
|
|
52
|
-
the [2.1.
|
|
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.
|
|
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 & scales, primitives, registries, chart state, chart linking, bar cache, interval registry, trading overlay, SVG export, render backend port, OpenAlgo feeds |
|
|
121
|
+
| `openalgo-charts` | Engine, 13 chart types, panes & 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 & 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 |
|
|
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 **
|
|
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 |
|
|
415
|
-
| Base + trade |
|
|
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 |
|
|
422
|
-
| Widget terminal (base + draw + indicators + widget) |
|
|
423
|
-
| **Everything** |
|
|
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) -
|
|
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 & limitations
|
|
484
492
|
|
|
485
|
-
Version **2.1.
|
|
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
|
|