zengeld-canvas 0.1.5 → 0.1.6

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,56 @@ 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 chart
32
+ const chart = new Chart(800, 600);
33
+ chart.bars(bars);
34
+ chart.candlesticks();
35
+ chart.sma(20, "#2196F3");
53
36
 
54
- // Create viewport
55
- const viewport = new JsViewport(800.0, 600.0);
56
- viewport.firstBar = 0.0;
57
- viewport.lastBar = 100.0;
37
+ // Render to SVG
38
+ const svg = chart.renderSvg();
58
39
 
59
- // Create price scale
60
- const priceScale = new JsPriceScale();
61
- priceScale.setRange(95.0, 110.0);
62
-
63
- // Use dark theme
64
- const theme = JsTheme.dark();
65
- console.log(`Background: ${theme.background}`);
40
+ // Use in DOM
41
+ document.getElementById('chart').innerHTML = svg;
66
42
  }
67
43
 
68
44
  main();
69
45
  ```
70
46
 
47
+ ## Examples
48
+
49
+ <table>
50
+ <tr>
51
+ <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>
52
+ <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>
53
+ </tr>
54
+ <tr>
55
+ <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>
56
+ <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>
57
+ </tr>
58
+ </table>
59
+
60
+ ## Drawing Primitives
61
+
62
+ | Category | Count | Examples |
63
+ |----------|-------|----------|
64
+ | Fibonacci | 11 | Retracement, Fan, Arcs, Circles, Channel, Spiral |
65
+ | Lines | 9 | TrendLine, HorizontalLine, Ray, ExtendedLine |
66
+ | Annotations | 11 | Text, Callout, PriceLabel, Flag, Table |
67
+ | Shapes | 10 | Rectangle, Circle, Ellipse, Triangle, Path |
68
+ | Elliott Waves | 5 | Impulse, Correction, Triangle, Combo |
69
+ | Patterns | 6 | XABCD, HeadShoulders, Cypher, ThreeDrives |
70
+ | Gann | 4 | Fan, Box, Square, SquareFixed |
71
+ | And more... | 40 | Channels, Pitchforks, Cycles, Projections |
72
+
71
73
  ## License
72
74
 
73
75
  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.6",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "homepage": "https://github.com/zengeld/zengeld-canvas",
Binary file