zengeld-canvas 0.1.5 → 0.1.8

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
@@ -2,11 +2,17 @@
2
2
 
3
3
  **High-performance SVG chart rendering engine for financial data visualization**
4
4
 
5
- [![Crates.io](https://img.shields.io/crates/v/zengeld-canvas.svg)](https://crates.io/crates/zengeld-canvas)
6
- [![PyPI](https://img.shields.io/pypi/v/zengeld-canvas.svg)](https://pypi.org/project/zengeld-canvas/)
7
5
  [![npm](https://img.shields.io/npm/v/zengeld-canvas.svg)](https://www.npmjs.com/package/zengeld-canvas)
8
6
 
9
- WebAssembly bindings for the high-performance zengeld-canvas chart rendering engine. Built in Rust with zero runtime dependencies.
7
+ WebAssembly bindings for the zengeld-canvas chart rendering engine. Built in Rust with zero runtime dependencies.
8
+
9
+ ## Features
10
+
11
+ - **96 Drawing Primitives** - Fibonacci, Gann, Pitchforks, Elliott Waves, Patterns, Channels, and more
12
+ - **45+ Indicator Presets** - Pre-configured rendering styles for SMA, RSI, MACD, Bollinger, Ichimoku, etc.
13
+ - **12 Series Types** - Candlestick, HeikinAshi, Line, Area, Histogram, Baseline, and more
14
+ - **14 Multi-Chart Layouts** - Grid, split, and custom layouts for dashboards
15
+ - **High Performance** - Native Rust speed via WebAssembly
10
16
 
11
17
  ## Installation
12
18
 
@@ -14,60 +20,61 @@ WebAssembly bindings for the high-performance zengeld-canvas chart rendering eng
14
20
  npm install zengeld-canvas
15
21
  ```
16
22
 
17
- ## Examples
18
-
19
- <table>
20
- <tr>
21
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/09_dark_theme.svg" width="400"/><br/><b>Dark Theme</b></td>
22
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/05_with_macd.svg" width="400"/><br/><b>MACD Indicator</b></td>
23
- </tr>
24
- <tr>
25
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/14_multichart_1_3.svg" width="400"/><br/><b>Multi-Chart Layout</b></td>
26
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/19_primitives_channels.svg" width="400"/><br/><b>Channels</b></td>
27
- </tr>
28
- <tr>
29
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/22_primitives_gann.svg" width="400"/><br/><b>Gann Tools</b></td>
30
- <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/25_primitives_patterns.svg" width="400"/><br/><b>Chart Patterns</b></td>
31
- </tr>
32
- </table>
33
-
34
- ## Features
35
-
36
- - **80+ Drawing Primitives** - Fibonacci, Gann, Pitchforks, Patterns, Elliott Waves, and more
37
- - **12 Series Types** - Candlestick, Line, Area, Histogram, and more
38
- - **Platform Agnostic** - `RenderContext` trait for any rendering backend
39
- - **Zero Dependencies** - Only serde for serialization
40
- - **High Performance** - Optimized for real-time chart rendering
41
-
42
23
  ## Quick Start
43
24
 
44
25
  ```javascript
45
- import init, { JsBar, JsViewport, JsPriceScale, JsTheme } from 'zengeld-canvas';
26
+ import init, { Chart, JsBar } from 'zengeld-canvas';
46
27
 
47
28
  async function main() {
48
29
  await init();
49
30
 
50
- // Create bars
51
- const bar = new JsBar(1703721600, 100.0, 105.0, 98.0, 103.0, 1000000);
52
- console.log(`Bullish: ${bar.isBullish()}`);
31
+ // Create sample OHLCV data
32
+ const bars = [
33
+ new JsBar(1703721600n, 100.0, 105.0, 98.0, 103.0, 1000.0)
34
+ ];
53
35
 
54
- // Create viewport
55
- const viewport = new JsViewport(800.0, 600.0);
56
- viewport.firstBar = 0.0;
57
- viewport.lastBar = 100.0;
36
+ // Create chart
37
+ const chart = new Chart(800, 600);
38
+ chart.setBars(bars);
39
+ chart.candlesticks();
40
+ chart.sma(20, "#2196F3");
58
41
 
59
- // Create price scale
60
- const priceScale = new JsPriceScale();
61
- priceScale.setRange(95.0, 110.0);
42
+ // Render to SVG
43
+ const svg = chart.renderSvg();
62
44
 
63
- // Use dark theme
64
- const theme = JsTheme.dark();
65
- console.log(`Background: ${theme.background}`);
45
+ // Use in DOM
46
+ document.getElementById('chart').innerHTML = svg;
66
47
  }
67
48
 
68
49
  main();
69
50
  ```
70
51
 
52
+ ## Examples
53
+
54
+ <table>
55
+ <tr>
56
+ <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/09_dark_theme.svg" width="400"/><br/><b>Dark Theme</b></td>
57
+ <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/05_with_macd.svg" width="400"/><br/><b>MACD Indicator</b></td>
58
+ </tr>
59
+ <tr>
60
+ <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/14_multichart_1_3.svg" width="400"/><br/><b>Multi-Chart Layout</b></td>
61
+ <td align="center"><img src="https://raw.githubusercontent.com/zengeld/zengeld-canvas/main/crates/canvas/chart_output/19_primitives_channels.svg" width="400"/><br/><b>Channels</b></td>
62
+ </tr>
63
+ </table>
64
+
65
+ ## Drawing Primitives
66
+
67
+ | Category | Count | Examples |
68
+ |----------|-------|----------|
69
+ | Fibonacci | 11 | Retracement, Fan, Arcs, Circles, Channel, Spiral |
70
+ | Lines | 9 | TrendLine, HorizontalLine, Ray, ExtendedLine |
71
+ | Annotations | 11 | Text, Callout, PriceLabel, Flag, Table |
72
+ | Shapes | 10 | Rectangle, Circle, Ellipse, Triangle, Path |
73
+ | Elliott Waves | 5 | Impulse, Correction, Triangle, Combo |
74
+ | Patterns | 6 | XABCD, HeadShoulders, Cypher, ThreeDrives |
75
+ | Gann | 4 | Fan, Box, Square, SquareFixed |
76
+ | And more... | 40 | Channels, Pitchforks, Cycles, Projections |
77
+
71
78
  ## License
72
79
 
73
80
  MIT OR Apache-2.0
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "zengeld"
6
6
  ],
7
7
  "description": "WebAssembly bindings for zengeld-canvas chart rendering engine",
8
- "version": "0.1.5",
8
+ "version": "0.1.8",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "homepage": "https://github.com/zengeld/zengeld-canvas",