zengeld-canvas 0.1.6 → 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.
@@ -1,5 +1,27 @@
1
1
  let wasm;
2
2
 
3
+ function addToExternrefTable0(obj) {
4
+ const idx = wasm.__externref_table_alloc();
5
+ wasm.__wbindgen_externrefs.set(idx, obj);
6
+ return idx;
7
+ }
8
+
9
+ let cachedDataViewMemory0 = null;
10
+ function getDataViewMemory0() {
11
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
12
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
13
+ }
14
+ return cachedDataViewMemory0;
15
+ }
16
+
17
+ let cachedFloat64ArrayMemory0 = null;
18
+ function getFloat64ArrayMemory0() {
19
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
20
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
21
+ }
22
+ return cachedFloat64ArrayMemory0;
23
+ }
24
+
3
25
  function getStringFromWasm0(ptr, len) {
4
26
  ptr = ptr >>> 0;
5
27
  return decodeText(ptr, len);
@@ -10,43 +32,1724 @@ function getUint8ArrayMemory0() {
10
32
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
33
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
34
  }
13
- return cachedUint8ArrayMemory0;
14
- }
15
-
16
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
- cachedTextDecoder.decode();
18
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
19
- let numBytesDecoded = 0;
20
- function decodeText(ptr, len) {
21
- numBytesDecoded += len;
22
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
23
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
24
- cachedTextDecoder.decode();
25
- numBytesDecoded = len;
35
+ return cachedUint8ArrayMemory0;
36
+ }
37
+
38
+ function isLikeNone(x) {
39
+ return x === undefined || x === null;
40
+ }
41
+
42
+ function passArrayF64ToWasm0(arg, malloc) {
43
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
44
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
45
+ WASM_VECTOR_LEN = arg.length;
46
+ return ptr;
47
+ }
48
+
49
+ function passArrayJsValueToWasm0(array, malloc) {
50
+ const ptr = malloc(array.length * 4, 4) >>> 0;
51
+ for (let i = 0; i < array.length; i++) {
52
+ const add = addToExternrefTable0(array[i]);
53
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
54
+ }
55
+ WASM_VECTOR_LEN = array.length;
56
+ return ptr;
57
+ }
58
+
59
+ function passStringToWasm0(arg, malloc, realloc) {
60
+ if (realloc === undefined) {
61
+ const buf = cachedTextEncoder.encode(arg);
62
+ const ptr = malloc(buf.length, 1) >>> 0;
63
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
64
+ WASM_VECTOR_LEN = buf.length;
65
+ return ptr;
66
+ }
67
+
68
+ let len = arg.length;
69
+ let ptr = malloc(len, 1) >>> 0;
70
+
71
+ const mem = getUint8ArrayMemory0();
72
+
73
+ let offset = 0;
74
+
75
+ for (; offset < len; offset++) {
76
+ const code = arg.charCodeAt(offset);
77
+ if (code > 0x7F) break;
78
+ mem[ptr + offset] = code;
79
+ }
80
+ if (offset !== len) {
81
+ if (offset !== 0) {
82
+ arg = arg.slice(offset);
83
+ }
84
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
85
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
86
+ const ret = cachedTextEncoder.encodeInto(arg, view);
87
+
88
+ offset += ret.written;
89
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
90
+ }
91
+
92
+ WASM_VECTOR_LEN = offset;
93
+ return ptr;
94
+ }
95
+
96
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
97
+ cachedTextDecoder.decode();
98
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
99
+ let numBytesDecoded = 0;
100
+ function decodeText(ptr, len) {
101
+ numBytesDecoded += len;
102
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
103
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
104
+ cachedTextDecoder.decode();
105
+ numBytesDecoded = len;
106
+ }
107
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
108
+ }
109
+
110
+ const cachedTextEncoder = new TextEncoder();
111
+
112
+ if (!('encodeInto' in cachedTextEncoder)) {
113
+ cachedTextEncoder.encodeInto = function (arg, view) {
114
+ const buf = cachedTextEncoder.encode(arg);
115
+ view.set(buf);
116
+ return {
117
+ read: arg.length,
118
+ written: buf.length
119
+ };
120
+ }
121
+ }
122
+
123
+ let WASM_VECTOR_LEN = 0;
124
+
125
+ const ChartFinalization = (typeof FinalizationRegistry === 'undefined')
126
+ ? { register: () => {}, unregister: () => {} }
127
+ : new FinalizationRegistry(ptr => wasm.__wbg_chart_free(ptr >>> 0, 1));
128
+
129
+ const JsBarFinalization = (typeof FinalizationRegistry === 'undefined')
130
+ ? { register: () => {}, unregister: () => {} }
131
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsbar_free(ptr >>> 0, 1));
132
+
133
+ const JsChartConfigFinalization = (typeof FinalizationRegistry === 'undefined')
134
+ ? { register: () => {}, unregister: () => {} }
135
+ : new FinalizationRegistry(ptr => wasm.__wbg_jschartconfig_free(ptr >>> 0, 1));
136
+
137
+ const JsThemeFinalization = (typeof FinalizationRegistry === 'undefined')
138
+ ? { register: () => {}, unregister: () => {} }
139
+ : new FinalizationRegistry(ptr => wasm.__wbg_jstheme_free(ptr >>> 0, 1));
140
+
141
+ const JsViewportFinalization = (typeof FinalizationRegistry === 'undefined')
142
+ ? { register: () => {}, unregister: () => {} }
143
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsviewport_free(ptr >>> 0, 1));
144
+
145
+ /**
146
+ * High-level chart builder for creating financial charts.
147
+ */
148
+ export class Chart {
149
+ __destroy_into_raw() {
150
+ const ptr = this.__wbg_ptr;
151
+ this.__wbg_ptr = 0;
152
+ ChartFinalization.unregister(this);
153
+ return ptr;
154
+ }
155
+ free() {
156
+ const ptr = this.__destroy_into_raw();
157
+ wasm.__wbg_chart_free(ptr, 0);
158
+ }
159
+ /**
160
+ * Arrow down
161
+ * @param {number} x
162
+ * @param {number} y
163
+ */
164
+ arrowDown(x, y) {
165
+ wasm.chart_arrowDown(this.__wbg_ptr, x, y);
166
+ }
167
+ /**
168
+ * Arrow line
169
+ * @param {number} x1
170
+ * @param {number} y1
171
+ * @param {number} x2
172
+ * @param {number} y2
173
+ */
174
+ arrowLine(x1, y1, x2, y2) {
175
+ wasm.chart_arrowLine(this.__wbg_ptr, x1, y1, x2, y2);
176
+ }
177
+ /**
178
+ * Buy signal
179
+ * @param {number} bar_index
180
+ * @param {number} price
181
+ * @param {string | null} [label]
182
+ */
183
+ buySignal(bar_index, price, label) {
184
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
185
+ var len0 = WASM_VECTOR_LEN;
186
+ wasm.chart_buySignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
187
+ }
188
+ /**
189
+ * Choppiness Index
190
+ * @param {number} period
191
+ */
192
+ choppiness(period) {
193
+ wasm.chart_choppiness(this.__wbg_ptr, period);
194
+ }
195
+ /**
196
+ * Cross line at position
197
+ * @param {number} x
198
+ * @param {number} y
199
+ */
200
+ crossLine(x, y) {
201
+ wasm.chart_crossLine(this.__wbg_ptr, x, y);
202
+ }
203
+ /**
204
+ * Apply dark theme
205
+ */
206
+ darkTheme() {
207
+ wasm.chart_darkTheme(this.__wbg_ptr);
208
+ }
209
+ /**
210
+ * Date range
211
+ * @param {number} x1
212
+ * @param {number} y1
213
+ * @param {number} x2
214
+ * @param {number} y2
215
+ */
216
+ dateRange(x1, y1, x2, y2) {
217
+ wasm.chart_dateRange(this.__wbg_ptr, x1, y1, x2, y2);
218
+ }
219
+ /**
220
+ * Fibonacci spiral
221
+ * @param {number} x1
222
+ * @param {number} y1
223
+ * @param {number} x2
224
+ * @param {number} y2
225
+ */
226
+ fibSpiral(x1, y1, x2, y2) {
227
+ wasm.chart_fibSpiral(this.__wbg_ptr, x1, y1, x2, y2);
228
+ }
229
+ /**
230
+ * Mass Index
231
+ */
232
+ massIndex() {
233
+ wasm.chart_massIndex(this.__wbg_ptr);
234
+ }
235
+ /**
236
+ * Price note
237
+ * @param {number} x
238
+ * @param {number} y
239
+ * @param {string} content
240
+ */
241
+ priceNote(x, y, content) {
242
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
243
+ const len0 = WASM_VECTOR_LEN;
244
+ wasm.chart_priceNote(this.__wbg_ptr, x, y, ptr0, len0);
245
+ }
246
+ /**
247
+ * Projection
248
+ * @param {number} x1
249
+ * @param {number} y1
250
+ * @param {number} x2
251
+ * @param {number} y2
252
+ */
253
+ projection(x1, y1, x2, y2) {
254
+ wasm.chart_projection(this.__wbg_ptr, x1, y1, x2, y2);
255
+ }
256
+ /**
257
+ * Render chart to SVG string
258
+ * @returns {string}
259
+ */
260
+ renderSvg() {
261
+ let deferred1_0;
262
+ let deferred1_1;
263
+ try {
264
+ const ret = wasm.chart_renderSvg(this.__wbg_ptr);
265
+ deferred1_0 = ret[0];
266
+ deferred1_1 = ret[1];
267
+ return getStringFromWasm0(ret[0], ret[1]);
268
+ } finally {
269
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
270
+ }
271
+ }
272
+ /**
273
+ * Set up/down colors
274
+ * @param {string} up
275
+ * @param {string} down
276
+ */
277
+ setColors(up, down) {
278
+ const ptr0 = passStringToWasm0(up, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
+ const len0 = WASM_VECTOR_LEN;
280
+ const ptr1 = passStringToWasm0(down, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const len1 = WASM_VECTOR_LEN;
282
+ wasm.chart_setColors(this.__wbg_ptr, ptr0, len0, ptr1, len1);
283
+ }
284
+ /**
285
+ * Stochastic Oscillator
286
+ * @param {number} k
287
+ * @param {number} d
288
+ */
289
+ stochastic(k, d) {
290
+ wasm.chart_stochastic(this.__wbg_ptr, k, d);
291
+ }
292
+ /**
293
+ * Supertrend
294
+ * @param {number} period
295
+ * @param {number} multiplier
296
+ */
297
+ supertrend(period, multiplier) {
298
+ wasm.chart_supertrend(this.__wbg_ptr, period, multiplier);
299
+ }
300
+ /**
301
+ * Trend line between two points
302
+ * @param {number} start_x
303
+ * @param {number} start_y
304
+ * @param {number} end_x
305
+ * @param {number} end_y
306
+ */
307
+ trendLine(start_x, start_y, end_x, end_y) {
308
+ wasm.chart_trendLine(this.__wbg_ptr, start_x, start_y, end_x, end_y);
309
+ }
310
+ /**
311
+ * Williams %R
312
+ * @param {number} period
313
+ */
314
+ williamsR(period) {
315
+ wasm.chart_williamsR(this.__wbg_ptr, period);
316
+ }
317
+ /**
318
+ * Custom overlay with pre-calculated values
319
+ * @param {string} name
320
+ * @param {Float64Array} values
321
+ * @param {string} color
322
+ */
323
+ addOverlay(name, values, color) {
324
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
325
+ const len0 = WASM_VECTOR_LEN;
326
+ const ptr1 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
327
+ const len1 = WASM_VECTOR_LEN;
328
+ const ptr2 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
+ const len2 = WASM_VECTOR_LEN;
330
+ wasm.chart_addOverlay(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
331
+ }
332
+ /**
333
+ * Connors RSI
334
+ */
335
+ connorsRsi() {
336
+ wasm.chart_connorsRsi(this.__wbg_ptr);
337
+ }
338
+ /**
339
+ * Cycle lines
340
+ * @param {number} x1
341
+ * @param {number} y1
342
+ * @param {number} x2
343
+ * @param {number} y2
344
+ */
345
+ cycleLines(x1, y1, x2, y2) {
346
+ wasm.chart_cycleLines(this.__wbg_ptr, x1, y1, x2, y2);
347
+ }
348
+ /**
349
+ * Exit signal
350
+ * @param {number} bar_index
351
+ * @param {number} price
352
+ * @param {string | null} [label]
353
+ */
354
+ exitSignal(bar_index, price, label) {
355
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ var len0 = WASM_VECTOR_LEN;
357
+ wasm.chart_exitSignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
358
+ }
359
+ /**
360
+ * Fibonacci channel
361
+ * @param {number} x1
362
+ * @param {number} y1
363
+ * @param {number} x2
364
+ * @param {number} y2
365
+ * @param {number} x3
366
+ * @param {number} y3
367
+ */
368
+ fibChannel(x1, y1, x2, y2, x3, y3) {
369
+ wasm.chart_fibChannel(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
370
+ }
371
+ /**
372
+ * Fibonacci circles
373
+ * @param {number} x1
374
+ * @param {number} y1
375
+ * @param {number} x2
376
+ * @param {number} y2
377
+ */
378
+ fibCircles(x1, y1, x2, y2) {
379
+ wasm.chart_fibCircles(this.__wbg_ptr, x1, y1, x2, y2);
380
+ }
381
+ /**
382
+ * Force Index
383
+ * @param {number} period
384
+ */
385
+ forceIndex(period) {
386
+ wasm.chart_forceIndex(this.__wbg_ptr, period);
387
+ }
388
+ /**
389
+ * Gann Square
390
+ * @param {number} x1
391
+ * @param {number} y1
392
+ * @param {number} x2
393
+ * @param {number} y2
394
+ */
395
+ gannSquare(x1, y1, x2, y2) {
396
+ wasm.chart_gannSquare(this.__wbg_ptr, x1, y1, x2, y2);
397
+ }
398
+ /**
399
+ * Highlighter
400
+ * @param {Float64Array} points
401
+ */
402
+ highlighter(points) {
403
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
404
+ const len0 = WASM_VECTOR_LEN;
405
+ wasm.chart_highlighter(this.__wbg_ptr, ptr0, len0);
406
+ }
407
+ /**
408
+ * Apply light theme
409
+ */
410
+ lightTheme() {
411
+ wasm.chart_lightTheme(this.__wbg_ptr);
412
+ }
413
+ /**
414
+ * Price label
415
+ * @param {number} x
416
+ * @param {number} y
417
+ */
418
+ priceLabel(x, y) {
419
+ wasm.chart_priceLabel(this.__wbg_ptr, x, y);
420
+ }
421
+ /**
422
+ * Price range
423
+ * @param {number} x1
424
+ * @param {number} y1
425
+ * @param {number} x2
426
+ * @param {number} y2
427
+ */
428
+ priceRange(x1, y1, x2, y2) {
429
+ wasm.chart_priceRange(this.__wbg_ptr, x1, y1, x2, y2);
430
+ }
431
+ /**
432
+ * Sell signal
433
+ * @param {number} bar_index
434
+ * @param {number} price
435
+ * @param {string | null} [label]
436
+ */
437
+ sellSignal(bar_index, price, label) {
438
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
439
+ var len0 = WASM_VECTOR_LEN;
440
+ wasm.chart_sellSignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
441
+ }
442
+ /**
443
+ * SMI Ergodic
444
+ */
445
+ smiErgodic() {
446
+ wasm.chart_smiErgodic(this.__wbg_ptr);
447
+ }
448
+ /**
449
+ * Time cycles
450
+ * @param {number} x1
451
+ * @param {number} y1
452
+ * @param {number} x2
453
+ * @param {number} y2
454
+ */
455
+ timeCycles(x1, y1, x2, y2) {
456
+ wasm.chart_timeCycles(this.__wbg_ptr, x1, y1, x2, y2);
457
+ }
458
+ /**
459
+ * Trend angle
460
+ * @param {number} x1
461
+ * @param {number} y1
462
+ * @param {number} x2
463
+ * @param {number} y2
464
+ */
465
+ trendAngle(x1, y1, x2, y2) {
466
+ wasm.chart_trendAngle(this.__wbg_ptr, x1, y1, x2, y2);
467
+ }
468
+ /**
469
+ * Ulcer Index
470
+ * @param {number} period
471
+ */
472
+ ulcerIndex(period) {
473
+ wasm.chart_ulcerIndex(this.__wbg_ptr, period);
474
+ }
475
+ /**
476
+ * ABCD Pattern
477
+ * @param {Float64Array} points
478
+ */
479
+ abcdPattern(points) {
480
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
481
+ const len0 = WASM_VECTOR_LEN;
482
+ wasm.chart_abcdPattern(this.__wbg_ptr, ptr0, len0);
483
+ }
484
+ /**
485
+ * Arrow marker
486
+ * @param {number} x1
487
+ * @param {number} y1
488
+ * @param {number} x2
489
+ * @param {number} y2
490
+ */
491
+ arrowMarker(x1, y1, x2, y2) {
492
+ wasm.chart_arrowMarker(this.__wbg_ptr, x1, y1, x2, y2);
493
+ }
494
+ /**
495
+ * Bars pattern
496
+ * @param {number} x1
497
+ * @param {number} y1
498
+ * @param {number} x2
499
+ * @param {number} y2
500
+ */
501
+ barsPattern(x1, y1, x2, y2) {
502
+ wasm.chart_barsPattern(this.__wbg_ptr, x1, y1, x2, y2);
503
+ }
504
+ /**
505
+ * Candlestick chart (default)
506
+ */
507
+ candlesticks() {
508
+ wasm.chart_candlesticks(this.__wbg_ptr);
509
+ }
510
+ /**
511
+ * Double curve
512
+ * @param {Float64Array} points
513
+ */
514
+ doubleCurve(points) {
515
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
516
+ const len0 = WASM_VECTOR_LEN;
517
+ wasm.chart_doubleCurve(this.__wbg_ptr, ptr0, len0);
518
+ }
519
+ /**
520
+ * Entry signal
521
+ * @param {number} bar_index
522
+ * @param {number} price
523
+ * @param {string | null} [label]
524
+ */
525
+ entrySignal(bar_index, price, label) {
526
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
527
+ var len0 = WASM_VECTOR_LEN;
528
+ wasm.chart_entrySignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
529
+ }
530
+ /**
531
+ * MACD with default settings (12, 26, 9)
532
+ */
533
+ macdDefault() {
534
+ wasm.chart_macdDefault(this.__wbg_ptr);
535
+ }
536
+ /**
537
+ * Pivot Points
538
+ */
539
+ pivotPoints() {
540
+ wasm.chart_pivotPoints(this.__wbg_ptr);
541
+ }
542
+ /**
543
+ * Three Drives
544
+ * @param {Float64Array} points
545
+ */
546
+ threeDrives(points) {
547
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
548
+ const len0 = WASM_VECTOR_LEN;
549
+ wasm.chart_threeDrives(this.__wbg_ptr, ptr0, len0);
550
+ }
551
+ /**
552
+ * Anchored text
553
+ * @param {number} x1
554
+ * @param {number} y1
555
+ * @param {number} x2
556
+ * @param {number} y2
557
+ * @param {string} content
558
+ */
559
+ anchoredText(x1, y1, x2, y2, content) {
560
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
561
+ const len0 = WASM_VECTOR_LEN;
562
+ wasm.chart_anchoredText(this.__wbg_ptr, x1, y1, x2, y2, ptr0, len0);
563
+ }
564
+ /**
565
+ * Anchored VWAP
566
+ * @param {number} x
567
+ * @param {number} y
568
+ */
569
+ anchoredVwap(x, y) {
570
+ wasm.chart_anchoredVwap(this.__wbg_ptr, x, y);
571
+ }
572
+ /**
573
+ * Coppock Curve
574
+ */
575
+ coppockCurve() {
576
+ wasm.chart_coppockCurve(this.__wbg_ptr);
577
+ }
578
+ /**
579
+ * Custom signal
580
+ * @param {number} bar_index
581
+ * @param {number} price
582
+ * @param {string} label
583
+ */
584
+ customSignal(bar_index, price, label) {
585
+ const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
586
+ const len0 = WASM_VECTOR_LEN;
587
+ wasm.chart_customSignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
588
+ }
589
+ /**
590
+ * Extended line (infinite in both directions)
591
+ * @param {number} x1
592
+ * @param {number} y1
593
+ * @param {number} x2
594
+ * @param {number} y2
595
+ */
596
+ extendedLine(x1, y1, x2, y2) {
597
+ wasm.chart_extendedLine(this.__wbg_ptr, x1, y1, x2, y2);
598
+ }
599
+ /**
600
+ * Fibonacci extension
601
+ * @param {number} x1
602
+ * @param {number} y1
603
+ * @param {number} x2
604
+ * @param {number} y2
605
+ * @param {number} x3
606
+ * @param {number} y3
607
+ */
608
+ fibExtension(x1, y1, x2, y2, x3, y3) {
609
+ wasm.chart_fibExtension(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
610
+ }
611
+ /**
612
+ * Long position
613
+ * @param {number} ex
614
+ * @param {number} ey
615
+ * @param {number} tpx
616
+ * @param {number} tpy
617
+ * @param {number} slx
618
+ * @param {number} sly
619
+ */
620
+ longPosition(ex, ey, tpx, tpy, slx, sly) {
621
+ wasm.chart_longPosition(this.__wbg_ptr, ex, ey, tpx, tpy, slx, sly);
622
+ }
623
+ /**
624
+ * Price Channel
625
+ * @param {number} period
626
+ */
627
+ priceChannel(period) {
628
+ wasm.chart_priceChannel(this.__wbg_ptr, period);
629
+ }
630
+ /**
631
+ * Vertical line at bar index
632
+ * @param {number} bar_index
633
+ */
634
+ verticalLine(bar_index) {
635
+ wasm.chart_verticalLine(this.__wbg_ptr, bar_index);
636
+ }
637
+ /**
638
+ * XABCD Pattern
639
+ * @param {Float64Array} points
640
+ */
641
+ xabcdPattern(points) {
642
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
643
+ const len0 = WASM_VECTOR_LEN;
644
+ wasm.chart_xabcdPattern(this.__wbg_ptr, ptr0, len0);
645
+ }
646
+ /**
647
+ * Cypher Pattern
648
+ * @param {Float64Array} points
649
+ */
650
+ cypherPattern(points) {
651
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
652
+ const len0 = WASM_VECTOR_LEN;
653
+ wasm.chart_cypherPattern(this.__wbg_ptr, ptr0, len0);
654
+ }
655
+ /**
656
+ * Fibonacci time zones
657
+ * @param {number} x1
658
+ * @param {number} y1
659
+ * @param {number} x2
660
+ * @param {number} y2
661
+ */
662
+ fibTimeZones(x1, y1, x2, y2) {
663
+ wasm.chart_fibTimeZones(this.__wbg_ptr, x1, y1, x2, y2);
664
+ }
665
+ /**
666
+ * Fibonacci trend time
667
+ * @param {number} x1
668
+ * @param {number} y1
669
+ * @param {number} x2
670
+ * @param {number} y2
671
+ * @param {number} x3
672
+ * @param {number} y3
673
+ */
674
+ fibTrendTime(x1, y1, x2, y2, x3, y3) {
675
+ wasm.chart_fibTrendTime(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
676
+ }
677
+ /**
678
+ * Head and Shoulders
679
+ * @param {Float64Array} points
680
+ */
681
+ headShoulders(points) {
682
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
683
+ const len0 = WASM_VECTOR_LEN;
684
+ wasm.chart_headShoulders(this.__wbg_ptr, ptr0, len0);
685
+ }
686
+ /**
687
+ * Horizontal ray
688
+ * @param {number} x1
689
+ * @param {number} y1
690
+ * @param {number} x2
691
+ * @param {number} y2
692
+ */
693
+ horizontalRay(x1, y1, x2, y2) {
694
+ wasm.chart_horizontalRay(this.__wbg_ptr, x1, y1, x2, y2);
695
+ }
696
+ /**
697
+ * Set background color
698
+ * @param {string} color
699
+ */
700
+ setBackground(color) {
701
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
702
+ const len0 = WASM_VECTOR_LEN;
703
+ wasm.chart_setBackground(this.__wbg_ptr, ptr0, len0);
704
+ }
705
+ /**
706
+ * Short position
707
+ * @param {number} ex
708
+ * @param {number} ey
709
+ * @param {number} tpx
710
+ * @param {number} tpy
711
+ * @param {number} slx
712
+ * @param {number} sly
713
+ */
714
+ shortPosition(ex, ey, tpx, tpy, slx, sly) {
715
+ wasm.chart_shortPosition(this.__wbg_ptr, ex, ey, tpx, tpy, slx, sly);
716
+ }
717
+ /**
718
+ * Elliott Impulse Wave
719
+ * @param {Float64Array} points
720
+ */
721
+ elliottImpulse(points) {
722
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
723
+ const len0 = WASM_VECTOR_LEN;
724
+ wasm.chart_elliottImpulse(this.__wbg_ptr, ptr0, len0);
725
+ }
726
+ /**
727
+ * Fibonacci retracement
728
+ * @param {number} x1
729
+ * @param {number} y1
730
+ * @param {number} x2
731
+ * @param {number} y2
732
+ */
733
+ fibRetracement(x1, y1, x2, y2) {
734
+ wasm.chart_fibRetracement(this.__wbg_ptr, x1, y1, x2, y2);
735
+ }
736
+ /**
737
+ * Flat top/bottom channel
738
+ * @param {number} x1
739
+ * @param {number} y1
740
+ * @param {number} x2
741
+ * @param {number} y2
742
+ * @param {number} x3
743
+ * @param {number} y3
744
+ */
745
+ flatTopBottom(x1, y1, x2, y2, x3, y3) {
746
+ wasm.chart_flatTopBottom(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
747
+ }
748
+ /**
749
+ * Horizontal line at price level
750
+ * @param {number} price
751
+ */
752
+ horizontalLine(price) {
753
+ wasm.chart_horizontalLine(this.__wbg_ptr, price);
754
+ }
755
+ /**
756
+ * Modified Schiff Pitchfork
757
+ * @param {number} x1
758
+ * @param {number} y1
759
+ * @param {number} x2
760
+ * @param {number} y2
761
+ * @param {number} x3
762
+ * @param {number} y3
763
+ */
764
+ modifiedSchiff(x1, y1, x2, y2, x3, y3) {
765
+ wasm.chart_modifiedSchiff(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
766
+ }
767
+ /**
768
+ * Aroon Oscillator
769
+ * @param {number} period
770
+ */
771
+ aroonOscillator(period) {
772
+ wasm.chart_aroonOscillator(this.__wbg_ptr, period);
773
+ }
774
+ /**
775
+ * Balance of Power
776
+ */
777
+ balanceOfPower() {
778
+ wasm.chart_balanceOfPower(this.__wbg_ptr);
779
+ }
780
+ /**
781
+ * Bollinger Bands with filled cloud
782
+ * @param {number} period
783
+ */
784
+ bollingerFilled(period) {
785
+ wasm.chart_bollingerFilled(this.__wbg_ptr, period);
786
+ }
787
+ /**
788
+ * Disjoint channel
789
+ * @param {Float64Array} points
790
+ */
791
+ disjointChannel(points) {
792
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
793
+ const len0 = WASM_VECTOR_LEN;
794
+ wasm.chart_disjointChannel(this.__wbg_ptr, ptr0, len0);
795
+ }
796
+ /**
797
+ * Elliott Triangle
798
+ * @param {Float64Array} points
799
+ */
800
+ elliottTriangle(points) {
801
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
802
+ const len0 = WASM_VECTOR_LEN;
803
+ wasm.chart_elliottTriangle(this.__wbg_ptr, ptr0, len0);
804
+ }
805
+ /**
806
+ * Fisher Transform
807
+ * @param {number} period
808
+ */
809
+ fisherTransform(period) {
810
+ wasm.chart_fisherTransform(this.__wbg_ptr, period);
811
+ }
812
+ /**
813
+ * Inside Pitchfork
814
+ * @param {number} x1
815
+ * @param {number} y1
816
+ * @param {number} x2
817
+ * @param {number} y2
818
+ * @param {number} x3
819
+ * @param {number} y3
820
+ */
821
+ insidePitchfork(x1, y1, x2, y2, x3, y3) {
822
+ wasm.chart_insidePitchfork(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
823
+ }
824
+ /**
825
+ * Parallel channel
826
+ * @param {number} x1
827
+ * @param {number} y1
828
+ * @param {number} x2
829
+ * @param {number} y2
830
+ * @param {number} x3
831
+ * @param {number} y3
832
+ */
833
+ parallelChannel(x1, y1, x2, y2, x3, y3) {
834
+ wasm.chart_parallelChannel(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
835
+ }
836
+ /**
837
+ * Price and date range
838
+ * @param {number} x1
839
+ * @param {number} y1
840
+ * @param {number} x2
841
+ * @param {number} y2
842
+ */
843
+ priceDateRange(x1, y1, x2, y2) {
844
+ wasm.chart_priceDateRange(this.__wbg_ptr, x1, y1, x2, y2);
845
+ }
846
+ /**
847
+ * Price projection
848
+ * @param {number} x1
849
+ * @param {number} y1
850
+ * @param {number} x2
851
+ * @param {number} y2
852
+ * @param {number} x3
853
+ * @param {number} y3
854
+ */
855
+ priceProjection(x1, y1, x2, y2, x3, y3) {
856
+ wasm.chart_priceProjection(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
857
+ }
858
+ /**
859
+ * Regression trend channel
860
+ * @param {number} x1
861
+ * @param {number} y1
862
+ * @param {number} x2
863
+ * @param {number} y2
864
+ */
865
+ regressionTrend(x1, y1, x2, y2) {
866
+ wasm.chart_regressionTrend(this.__wbg_ptr, x1, y1, x2, y2);
867
+ }
868
+ /**
869
+ * Schiff Pitchfork
870
+ * @param {number} x1
871
+ * @param {number} y1
872
+ * @param {number} x2
873
+ * @param {number} y2
874
+ * @param {number} x3
875
+ * @param {number} y3
876
+ */
877
+ schiffPitchfork(x1, y1, x2, y2, x3, y3) {
878
+ wasm.chart_schiffPitchfork(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
879
+ }
880
+ /**
881
+ * Stop loss signal
882
+ * @param {number} bar_index
883
+ * @param {number} price
884
+ * @param {string | null} [label]
885
+ */
886
+ stopLossSignal(bar_index, price, label) {
887
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
888
+ var len0 = WASM_VECTOR_LEN;
889
+ wasm.chart_stopLossSignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
890
+ }
891
+ /**
892
+ * Triangle Pattern
893
+ * @param {number} x1
894
+ * @param {number} y1
895
+ * @param {number} x2
896
+ * @param {number} y2
897
+ * @param {number} x3
898
+ * @param {number} y3
899
+ */
900
+ trianglePattern(x1, y1, x2, y2, x3, y3) {
901
+ wasm.chart_trianglePattern(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
902
+ }
903
+ /**
904
+ * Chande Kroll Stop
905
+ */
906
+ chandeKrollStop() {
907
+ wasm.chart_chandeKrollStop(this.__wbg_ptr);
908
+ }
909
+ /**
910
+ * Gann Square Fixed
911
+ * @param {number} x1
912
+ * @param {number} y1
913
+ * @param {number} x2
914
+ * @param {number} y2
915
+ */
916
+ gannSquareFixed(x1, y1, x2, y2) {
917
+ wasm.chart_gannSquareFixed(this.__wbg_ptr, x1, y1, x2, y2);
918
+ }
919
+ /**
920
+ * Linear Regression
921
+ * @param {number} period
922
+ * @param {string} color
923
+ */
924
+ linearRegression(period, color) {
925
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
926
+ const len0 = WASM_VECTOR_LEN;
927
+ wasm.chart_linearRegression(this.__wbg_ptr, period, ptr0, len0);
928
+ }
929
+ /**
930
+ * Rotated rectangle
931
+ * @param {number} x1
932
+ * @param {number} y1
933
+ * @param {number} x2
934
+ * @param {number} y2
935
+ * @param {number} x3
936
+ * @param {number} y3
937
+ */
938
+ rotatedRectangle(x1, y1, x2, y2, x3, y3) {
939
+ wasm.chart_rotatedRectangle(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
940
+ }
941
+ /**
942
+ * Awesome Oscillator
943
+ */
944
+ awesomeOscillator() {
945
+ wasm.chart_awesomeOscillator(this.__wbg_ptr);
946
+ }
947
+ /**
948
+ * Chaikin Oscillator
949
+ */
950
+ chaikinOscillator() {
951
+ wasm.chart_chaikinOscillator(this.__wbg_ptr);
952
+ }
953
+ /**
954
+ * Elliott Correction Wave
955
+ * @param {Float64Array} points
956
+ */
957
+ elliottCorrection(points) {
958
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
959
+ const len0 = WASM_VECTOR_LEN;
960
+ wasm.chart_elliottCorrection(this.__wbg_ptr, ptr0, len0);
961
+ }
962
+ /**
963
+ * Schaff Trend Cycle
964
+ */
965
+ schaffTrendCycle() {
966
+ wasm.chart_schaffTrendCycle(this.__wbg_ptr);
967
+ }
968
+ /**
969
+ * Take profit signal
970
+ * @param {number} bar_index
971
+ * @param {number} price
972
+ * @param {string | null} [label]
973
+ */
974
+ takeProfitSignal(bar_index, price, label) {
975
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
976
+ var len0 = WASM_VECTOR_LEN;
977
+ wasm.chart_takeProfitSignal(this.__wbg_ptr, bar_index, price, ptr0, len0);
978
+ }
979
+ /**
980
+ * Ultimate Oscillator
981
+ */
982
+ ultimateOscillator() {
983
+ wasm.chart_ultimateOscillator(this.__wbg_ptr);
984
+ }
985
+ /**
986
+ * Elliott Double Combo
987
+ * @param {Float64Array} points
988
+ */
989
+ elliottDoubleCombo(points) {
990
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
991
+ const len0 = WASM_VECTOR_LEN;
992
+ wasm.chart_elliottDoubleCombo(this.__wbg_ptr, ptr0, len0);
993
+ }
994
+ /**
995
+ * Elliott Triple Combo
996
+ * @param {Float64Array} points
997
+ */
998
+ elliottTripleCombo(points) {
999
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1000
+ const len0 = WASM_VECTOR_LEN;
1001
+ wasm.chart_elliottTripleCombo(this.__wbg_ptr, ptr0, len0);
1002
+ }
1003
+ /**
1004
+ * Fibonacci speed/resistance
1005
+ * @param {number} x1
1006
+ * @param {number} y1
1007
+ * @param {number} x2
1008
+ * @param {number} y2
1009
+ */
1010
+ fibSpeedResistance(x1, y1, x2, y2) {
1011
+ wasm.chart_fibSpeedResistance(this.__wbg_ptr, x1, y1, x2, y2);
1012
+ }
1013
+ /**
1014
+ * Fixed volume profile
1015
+ * @param {number} x1
1016
+ * @param {number} y1
1017
+ * @param {number} x2
1018
+ * @param {number} y2
1019
+ */
1020
+ fixedVolumeProfile(x1, y1, x2, y2) {
1021
+ wasm.chart_fixedVolumeProfile(this.__wbg_ptr, x1, y1, x2, y2);
1022
+ }
1023
+ /**
1024
+ * Historical Volatility
1025
+ * @param {number} period
1026
+ */
1027
+ historicalVolatility(period) {
1028
+ wasm.chart_historicalVolatility(this.__wbg_ptr, period);
1029
+ }
1030
+ /**
1031
+ * Accelerator Oscillator
1032
+ */
1033
+ acceleratorOscillator() {
1034
+ wasm.chart_acceleratorOscillator(this.__wbg_ptr);
1035
+ }
1036
+ /**
1037
+ * Anchored volume profile
1038
+ * @param {number} x1
1039
+ * @param {number} y1
1040
+ * @param {number} x2
1041
+ * @param {number} y2
1042
+ */
1043
+ anchoredVolumeProfile(x1, y1, x2, y2) {
1044
+ wasm.chart_anchoredVolumeProfile(this.__wbg_ptr, x1, y1, x2, y2);
1045
+ }
1046
+ /**
1047
+ * Linear Regression Slope
1048
+ * @param {number} period
1049
+ */
1050
+ linearRegressionSlope(period) {
1051
+ wasm.chart_linearRegressionSlope(this.__wbg_ptr, period);
1052
+ }
1053
+ /**
1054
+ * Average Directional Index
1055
+ * @param {number} period
1056
+ */
1057
+ adx(period) {
1058
+ wasm.chart_adx(this.__wbg_ptr, period);
1059
+ }
1060
+ /**
1061
+ * Arc
1062
+ * @param {number} x1
1063
+ * @param {number} y1
1064
+ * @param {number} x2
1065
+ * @param {number} y2
1066
+ * @param {number} x3
1067
+ * @param {number} y3
1068
+ */
1069
+ arc(x1, y1, x2, y2, x3, y3) {
1070
+ wasm.chart_arc(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
1071
+ }
1072
+ /**
1073
+ * Average True Range
1074
+ * @param {number} period
1075
+ */
1076
+ atr(period) {
1077
+ wasm.chart_atr(this.__wbg_ptr, period);
1078
+ }
1079
+ /**
1080
+ * Commodity Channel Index
1081
+ * @param {number} period
1082
+ */
1083
+ cci(period) {
1084
+ wasm.chart_cci(this.__wbg_ptr, period);
1085
+ }
1086
+ /**
1087
+ * Chaikin Money Flow
1088
+ * @param {number} period
1089
+ */
1090
+ cmf(period) {
1091
+ wasm.chart_cmf(this.__wbg_ptr, period);
1092
+ }
1093
+ /**
1094
+ * Chande Momentum Oscillator
1095
+ * @param {number} period
1096
+ */
1097
+ cmo(period) {
1098
+ wasm.chart_cmo(this.__wbg_ptr, period);
1099
+ }
1100
+ /**
1101
+ * Detrended Price Oscillator
1102
+ * @param {number} period
1103
+ */
1104
+ dpo(period) {
1105
+ wasm.chart_dpo(this.__wbg_ptr, period);
1106
+ }
1107
+ /**
1108
+ * Exponential Moving Average
1109
+ * @param {number} period
1110
+ * @param {string} color
1111
+ */
1112
+ ema(period, color) {
1113
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1114
+ const len0 = WASM_VECTOR_LEN;
1115
+ wasm.chart_ema(this.__wbg_ptr, period, ptr0, len0);
1116
+ }
1117
+ /**
1118
+ * Ease of Movement
1119
+ * @param {number} period
1120
+ */
1121
+ eom(period) {
1122
+ wasm.chart_eom(this.__wbg_ptr, period);
1123
+ }
1124
+ /**
1125
+ * Hull Moving Average
1126
+ * @param {number} period
1127
+ * @param {string} color
1128
+ */
1129
+ hma(period, color) {
1130
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1131
+ const len0 = WASM_VECTOR_LEN;
1132
+ wasm.chart_hma(this.__wbg_ptr, period, ptr0, len0);
1133
+ }
1134
+ /**
1135
+ * Know Sure Thing
1136
+ */
1137
+ kst() {
1138
+ wasm.chart_kst(this.__wbg_ptr);
1139
+ }
1140
+ /**
1141
+ * Money Flow Index
1142
+ * @param {number} period
1143
+ */
1144
+ mfi(period) {
1145
+ wasm.chart_mfi(this.__wbg_ptr, period);
1146
+ }
1147
+ /**
1148
+ * Create a new chart with specified dimensions.
1149
+ * @param {number} width
1150
+ * @param {number} height
1151
+ */
1152
+ constructor(width, height) {
1153
+ const ret = wasm.chart_new(width, height);
1154
+ this.__wbg_ptr = ret >>> 0;
1155
+ ChartFinalization.register(this, this.__wbg_ptr, this);
1156
+ return this;
1157
+ }
1158
+ /**
1159
+ * Negative Volume Index
1160
+ */
1161
+ nvi() {
1162
+ wasm.chart_nvi(this.__wbg_ptr);
1163
+ }
1164
+ /**
1165
+ * On Balance Volume
1166
+ */
1167
+ obv() {
1168
+ wasm.chart_obv(this.__wbg_ptr);
1169
+ }
1170
+ /**
1171
+ * Pretty Good Oscillator
1172
+ * @param {number} period
1173
+ */
1174
+ pgo(period) {
1175
+ wasm.chart_pgo(this.__wbg_ptr, period);
1176
+ }
1177
+ /**
1178
+ * Positive Volume Index
1179
+ */
1180
+ pvi() {
1181
+ wasm.chart_pvi(this.__wbg_ptr);
1182
+ }
1183
+ /**
1184
+ * Ray from p1 through p2
1185
+ * @param {number} x1
1186
+ * @param {number} y1
1187
+ * @param {number} x2
1188
+ * @param {number} y2
1189
+ */
1190
+ ray(x1, y1, x2, y2) {
1191
+ wasm.chart_ray(this.__wbg_ptr, x1, y1, x2, y2);
1192
+ }
1193
+ /**
1194
+ * Rate of Change
1195
+ * @param {number} period
1196
+ */
1197
+ roc(period) {
1198
+ wasm.chart_roc(this.__wbg_ptr, period);
1199
+ }
1200
+ /**
1201
+ * Relative Strength Index
1202
+ * @param {number} period
1203
+ */
1204
+ rsi(period) {
1205
+ wasm.chart_rsi(this.__wbg_ptr, period);
1206
+ }
1207
+ /**
1208
+ * Relative Vigor Index
1209
+ * @param {number} period
1210
+ */
1211
+ rvi(period) {
1212
+ wasm.chart_rvi(this.__wbg_ptr, period);
1213
+ }
1214
+ /**
1215
+ * Simple Moving Average
1216
+ * @param {number} period
1217
+ * @param {string} color
1218
+ */
1219
+ sma(period, color) {
1220
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1221
+ const len0 = WASM_VECTOR_LEN;
1222
+ wasm.chart_sma(this.__wbg_ptr, period, ptr0, len0);
1223
+ }
1224
+ /**
1225
+ * True Strength Index
1226
+ * @param {number} r
1227
+ * @param {number} s
1228
+ */
1229
+ tsi(r, s) {
1230
+ wasm.chart_tsi(this.__wbg_ptr, r, s);
1231
+ }
1232
+ /**
1233
+ * Volume Price Trend
1234
+ */
1235
+ vpt() {
1236
+ wasm.chart_vpt(this.__wbg_ptr);
1237
+ }
1238
+ /**
1239
+ * Weighted Moving Average
1240
+ * @param {number} period
1241
+ * @param {string} color
1242
+ */
1243
+ wma(period, color) {
1244
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1245
+ const len0 = WASM_VECTOR_LEN;
1246
+ wasm.chart_wma(this.__wbg_ptr, period, ptr0, len0);
1247
+ }
1248
+ /**
1249
+ * Area chart (filled)
1250
+ */
1251
+ area() {
1252
+ wasm.chart_area(this.__wbg_ptr);
1253
+ }
1254
+ /**
1255
+ * Double Exponential Moving Average
1256
+ * @param {number} period
1257
+ * @param {string} color
1258
+ */
1259
+ dema(period, color) {
1260
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1261
+ const len0 = WASM_VECTOR_LEN;
1262
+ wasm.chart_dema(this.__wbg_ptr, period, ptr0, len0);
1263
+ }
1264
+ /**
1265
+ * Flag
1266
+ * @param {number} x
1267
+ * @param {number} y
1268
+ */
1269
+ flag(x, y) {
1270
+ wasm.chart_flag(this.__wbg_ptr, x, y);
1271
+ }
1272
+ /**
1273
+ * Kaufman Adaptive Moving Average
1274
+ * @param {number} period
1275
+ * @param {string} color
1276
+ */
1277
+ kama(period, color) {
1278
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1279
+ const len0 = WASM_VECTOR_LEN;
1280
+ wasm.chart_kama(this.__wbg_ptr, period, ptr0, len0);
1281
+ }
1282
+ /**
1283
+ * Line chart (close prices)
1284
+ */
1285
+ line() {
1286
+ wasm.chart_line(this.__wbg_ptr);
1287
+ }
1288
+ /**
1289
+ * MACD
1290
+ * @param {number} fast
1291
+ * @param {number} slow
1292
+ * @param {number} signal
1293
+ */
1294
+ macd(fast, slow, signal) {
1295
+ wasm.chart_macd(this.__wbg_ptr, fast, slow, signal);
1296
+ }
1297
+ /**
1298
+ * Note
1299
+ * @param {number} x
1300
+ * @param {number} y
1301
+ * @param {string} content
1302
+ */
1303
+ note(x, y, content) {
1304
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1305
+ const len0 = WASM_VECTOR_LEN;
1306
+ wasm.chart_note(this.__wbg_ptr, x, y, ptr0, len0);
1307
+ }
1308
+ /**
1309
+ * Path (closed polygon)
1310
+ * @param {Float64Array} points
1311
+ */
1312
+ path(points) {
1313
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1314
+ const len0 = WASM_VECTOR_LEN;
1315
+ wasm.chart_path(this.__wbg_ptr, ptr0, len0);
1316
+ }
1317
+ /**
1318
+ * Parabolic SAR
1319
+ */
1320
+ psar() {
1321
+ wasm.chart_psar(this.__wbg_ptr);
1322
+ }
1323
+ /**
1324
+ * Sign
1325
+ * @param {number} x
1326
+ * @param {number} y
1327
+ */
1328
+ sign(x, y) {
1329
+ wasm.chart_sign(this.__wbg_ptr, x, y);
1330
+ }
1331
+ /**
1332
+ * Triple Exponential Moving Average
1333
+ * @param {number} period
1334
+ * @param {string} color
1335
+ */
1336
+ tema(period, color) {
1337
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1338
+ const len0 = WASM_VECTOR_LEN;
1339
+ wasm.chart_tema(this.__wbg_ptr, period, ptr0, len0);
1340
+ }
1341
+ /**
1342
+ * Text annotation
1343
+ * @param {number} x
1344
+ * @param {number} y
1345
+ * @param {string} content
1346
+ */
1347
+ text(x, y, content) {
1348
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1349
+ const len0 = WASM_VECTOR_LEN;
1350
+ wasm.chart_text(this.__wbg_ptr, x, y, ptr0, len0);
1351
+ }
1352
+ /**
1353
+ * TRIX
1354
+ * @param {number} period
1355
+ */
1356
+ trix(period) {
1357
+ wasm.chart_trix(this.__wbg_ptr, period);
1358
+ }
1359
+ /**
1360
+ * VWAP
1361
+ */
1362
+ vwap() {
1363
+ wasm.chart_vwap(this.__wbg_ptr);
1364
+ }
1365
+ /**
1366
+ * Aroon
1367
+ * @param {number} period
1368
+ */
1369
+ aroon(period) {
1370
+ wasm.chart_aroon(this.__wbg_ptr, period);
1371
+ }
1372
+ /**
1373
+ * Brush
1374
+ * @param {Float64Array} points
1375
+ */
1376
+ brush(points) {
1377
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1378
+ const len0 = WASM_VECTOR_LEN;
1379
+ wasm.chart_brush(this.__wbg_ptr, ptr0, len0);
1380
+ }
1381
+ /**
1382
+ * Curve
1383
+ * @param {Float64Array} points
1384
+ */
1385
+ curve(points) {
1386
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1387
+ const len0 = WASM_VECTOR_LEN;
1388
+ wasm.chart_curve(this.__wbg_ptr, ptr0, len0);
1389
+ }
1390
+ /**
1391
+ * Table
1392
+ * @param {number} x
1393
+ * @param {number} y
1394
+ */
1395
+ table(x, y) {
1396
+ wasm.chart_table(this.__wbg_ptr, x, y);
1397
+ }
1398
+ /**
1399
+ * Triangular Moving Average
1400
+ * @param {number} period
1401
+ * @param {string} color
1402
+ */
1403
+ trima(period, color) {
1404
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1405
+ const len0 = WASM_VECTOR_LEN;
1406
+ wasm.chart_trima(this.__wbg_ptr, period, ptr0, len0);
1407
+ }
1408
+ /**
1409
+ * Zero Lag EMA
1410
+ * @param {number} period
1411
+ * @param {string} color
1412
+ */
1413
+ zlema(period, color) {
1414
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1415
+ const len0 = WASM_VECTOR_LEN;
1416
+ wasm.chart_zlema(this.__wbg_ptr, period, ptr0, len0);
1417
+ }
1418
+ /**
1419
+ * Circle
1420
+ * @param {number} cx
1421
+ * @param {number} cy
1422
+ * @param {number} ex
1423
+ * @param {number} ey
1424
+ */
1425
+ circle(cx, cy, ex, ey) {
1426
+ wasm.chart_circle(this.__wbg_ptr, cx, cy, ex, ey);
1427
+ }
1428
+ /**
1429
+ * QStick
1430
+ * @param {number} period
1431
+ */
1432
+ qstick(period) {
1433
+ wasm.chart_qstick(this.__wbg_ptr, period);
1434
+ }
1435
+ /**
1436
+ * Standard Deviation
1437
+ * @param {number} period
1438
+ */
1439
+ stddev(period) {
1440
+ wasm.chart_stddev(this.__wbg_ptr, period);
1441
+ }
1442
+ /**
1443
+ * Volume (subpane)
1444
+ */
1445
+ volume() {
1446
+ wasm.chart_volume(this.__wbg_ptr);
1447
+ }
1448
+ /**
1449
+ * Vortex Indicator
1450
+ * @param {number} period
1451
+ */
1452
+ vortex(period) {
1453
+ wasm.chart_vortex(this.__wbg_ptr, period);
1454
+ }
1455
+ /**
1456
+ * ZigZag
1457
+ * @param {number} deviation
1458
+ */
1459
+ zigzag(deviation) {
1460
+ wasm.chart_zigzag(this.__wbg_ptr, deviation);
1461
+ }
1462
+ /**
1463
+ * Accumulation/Distribution Line
1464
+ */
1465
+ adLine() {
1466
+ wasm.chart_adLine(this.__wbg_ptr);
1467
+ }
1468
+ /**
1469
+ * Callout
1470
+ * @param {number} x
1471
+ * @param {number} y
1472
+ * @param {string} content
1473
+ */
1474
+ callout(x, y, content) {
1475
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1476
+ const len0 = WASM_VECTOR_LEN;
1477
+ wasm.chart_callout(this.__wbg_ptr, x, y, ptr0, len0);
1478
+ }
1479
+ /**
1480
+ * Comment
1481
+ * @param {number} x
1482
+ * @param {number} y
1483
+ * @param {string} content
1484
+ */
1485
+ comment(x, y, content) {
1486
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1487
+ const len0 = WASM_VECTOR_LEN;
1488
+ wasm.chart_comment(this.__wbg_ptr, x, y, ptr0, len0);
1489
+ }
1490
+ /**
1491
+ * Ellipse
1492
+ * @param {number} cx
1493
+ * @param {number} cy
1494
+ * @param {number} ex
1495
+ * @param {number} ey
1496
+ */
1497
+ ellipse(cx, cy, ex, ey) {
1498
+ wasm.chart_ellipse(this.__wbg_ptr, cx, cy, ex, ey);
1499
+ }
1500
+ /**
1501
+ * Fibonacci fan
1502
+ * @param {number} x1
1503
+ * @param {number} y1
1504
+ * @param {number} x2
1505
+ * @param {number} y2
1506
+ */
1507
+ fibFan(x1, y1, x2, y2) {
1508
+ wasm.chart_fibFan(this.__wbg_ptr, x1, y1, x2, y2);
1509
+ }
1510
+ /**
1511
+ * Keltner Channel
1512
+ * @param {number} period
1513
+ */
1514
+ keltner(period) {
1515
+ wasm.chart_keltner(this.__wbg_ptr, period);
1516
+ }
1517
+ /**
1518
+ * Set device pixel ratio for high-DPI displays
1519
+ * @param {number} dpr
1520
+ */
1521
+ setDpr(dpr) {
1522
+ wasm.chart_setDpr(this.__wbg_ptr, dpr);
1523
+ }
1524
+ /**
1525
+ * Arrow up
1526
+ * @param {number} x
1527
+ * @param {number} y
1528
+ */
1529
+ arrowUp(x, y) {
1530
+ wasm.chart_arrowUp(this.__wbg_ptr, x, y);
1531
+ }
1532
+ /**
1533
+ * Donchian Channel
1534
+ * @param {number} period
1535
+ */
1536
+ donchian(period) {
1537
+ wasm.chart_donchian(this.__wbg_ptr, period);
1538
+ }
1539
+ /**
1540
+ * Fibonacci arcs
1541
+ * @param {number} x1
1542
+ * @param {number} y1
1543
+ * @param {number} x2
1544
+ * @param {number} y2
1545
+ */
1546
+ fibArcs(x1, y1, x2, y2) {
1547
+ wasm.chart_fibArcs(this.__wbg_ptr, x1, y1, x2, y2);
1548
+ }
1549
+ /**
1550
+ * Forecast
1551
+ * @param {number} x1
1552
+ * @param {number} y1
1553
+ * @param {number} x2
1554
+ * @param {number} y2
1555
+ */
1556
+ forecast(x1, y1, x2, y2) {
1557
+ wasm.chart_forecast(this.__wbg_ptr, x1, y1, x2, y2);
1558
+ }
1559
+ /**
1560
+ * Gann Box
1561
+ * @param {number} x1
1562
+ * @param {number} y1
1563
+ * @param {number} x2
1564
+ * @param {number} y2
1565
+ */
1566
+ gannBox(x1, y1, x2, y2) {
1567
+ wasm.chart_gannBox(this.__wbg_ptr, x1, y1, x2, y2);
1568
+ }
1569
+ /**
1570
+ * Gann Fan
1571
+ * @param {number} x1
1572
+ * @param {number} y1
1573
+ * @param {number} x2
1574
+ * @param {number} y2
1575
+ */
1576
+ gannFan(x1, y1, x2, y2) {
1577
+ wasm.chart_gannFan(this.__wbg_ptr, x1, y1, x2, y2);
1578
+ }
1579
+ /**
1580
+ * Ichimoku Cloud
1581
+ */
1582
+ ichimoku() {
1583
+ wasm.chart_ichimoku(this.__wbg_ptr);
1584
+ }
1585
+ /**
1586
+ * McGinley Dynamic
1587
+ * @param {number} period
1588
+ * @param {string} color
1589
+ */
1590
+ mcginley(period, color) {
1591
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1592
+ const len0 = WASM_VECTOR_LEN;
1593
+ wasm.chart_mcginley(this.__wbg_ptr, period, ptr0, len0);
1594
+ }
1595
+ /**
1596
+ * Momentum
1597
+ * @param {number} period
1598
+ */
1599
+ momentum(period) {
1600
+ wasm.chart_momentum(this.__wbg_ptr, period);
1601
+ }
1602
+ /**
1603
+ * Polyline
1604
+ * @param {Float64Array} points
1605
+ */
1606
+ polyline(points) {
1607
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1608
+ const len0 = WASM_VECTOR_LEN;
1609
+ wasm.chart_polyline(this.__wbg_ptr, ptr0, len0);
1610
+ }
1611
+ /**
1612
+ * Set OHLCV bar data
1613
+ * @param {JsBar[]} bars
1614
+ */
1615
+ setBars(bars) {
1616
+ const ptr0 = passArrayJsValueToWasm0(bars, wasm.__wbindgen_malloc);
1617
+ const len0 = WASM_VECTOR_LEN;
1618
+ wasm.chart_setBars(this.__wbg_ptr, ptr0, len0);
1619
+ }
1620
+ /**
1621
+ * Enable/disable grid
1622
+ * @param {boolean} show
1623
+ */
1624
+ setGrid(show) {
1625
+ wasm.chart_setGrid(this.__wbg_ptr, show);
1626
+ }
1627
+ /**
1628
+ * Signpost
1629
+ * @param {number} x
1630
+ * @param {number} y
1631
+ * @param {string} content
1632
+ */
1633
+ signpost(x, y, content) {
1634
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1635
+ const len0 = WASM_VECTOR_LEN;
1636
+ wasm.chart_signpost(this.__wbg_ptr, x, y, ptr0, len0);
1637
+ }
1638
+ /**
1639
+ * Triangle
1640
+ * @param {number} x1
1641
+ * @param {number} y1
1642
+ * @param {number} x2
1643
+ * @param {number} y2
1644
+ * @param {number} x3
1645
+ * @param {number} y3
1646
+ */
1647
+ triangle(x1, y1, x2, y2, x3, y3) {
1648
+ wasm.chart_triangle(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
1649
+ }
1650
+ /**
1651
+ * ATR Bands
1652
+ * @param {number} period
1653
+ * @param {number} multiplier
1654
+ */
1655
+ atrBands(period, multiplier) {
1656
+ wasm.chart_atrBands(this.__wbg_ptr, period, multiplier);
1657
+ }
1658
+ /**
1659
+ * Bollinger Bands
1660
+ * @param {number} period
1661
+ * @param {number} multiplier
1662
+ */
1663
+ bollinger(period, multiplier) {
1664
+ wasm.chart_bollinger(this.__wbg_ptr, period, multiplier);
1665
+ }
1666
+ /**
1667
+ * Elder Ray
1668
+ * @param {number} period
1669
+ */
1670
+ elderRay(period) {
1671
+ wasm.chart_elderRay(this.__wbg_ptr, period);
1672
+ }
1673
+ /**
1674
+ * Envelopes
1675
+ * @param {number} period
1676
+ * @param {number} percent
1677
+ */
1678
+ envelopes(period, percent) {
1679
+ wasm.chart_envelopes(this.__wbg_ptr, period, percent);
1680
+ }
1681
+ /**
1682
+ * Fibonacci wedge
1683
+ * @param {number} x1
1684
+ * @param {number} y1
1685
+ * @param {number} x2
1686
+ * @param {number} y2
1687
+ */
1688
+ fibWedge(x1, y1, x2, y2) {
1689
+ wasm.chart_fibWedge(this.__wbg_ptr, x1, y1, x2, y2);
1690
+ }
1691
+ /**
1692
+ * Info line with measurements
1693
+ * @param {number} x1
1694
+ * @param {number} y1
1695
+ * @param {number} x2
1696
+ * @param {number} y2
1697
+ */
1698
+ infoLine(x1, y1, x2, y2) {
1699
+ wasm.chart_infoLine(this.__wbg_ptr, x1, y1, x2, y2);
1700
+ }
1701
+ /**
1702
+ * Pitchfork
1703
+ * @param {number} x1
1704
+ * @param {number} y1
1705
+ * @param {number} x2
1706
+ * @param {number} y2
1707
+ * @param {number} x3
1708
+ * @param {number} y3
1709
+ */
1710
+ pitchfork(x1, y1, x2, y2, x3, y3) {
1711
+ wasm.chart_pitchfork(this.__wbg_ptr, x1, y1, x2, y2, x3, y3);
1712
+ }
1713
+ /**
1714
+ * Rectangle
1715
+ * @param {number} x1
1716
+ * @param {number} y1
1717
+ * @param {number} x2
1718
+ * @param {number} y2
1719
+ */
1720
+ rectangle(x1, y1, x2, y2) {
1721
+ wasm.chart_rectangle(this.__wbg_ptr, x1, y1, x2, y2);
1722
+ }
1723
+ /**
1724
+ * Sine wave
1725
+ * @param {number} x1
1726
+ * @param {number} y1
1727
+ * @param {number} x2
1728
+ * @param {number} y2
1729
+ */
1730
+ sineWave(x1, y1, x2, y2) {
1731
+ wasm.chart_sineWave(this.__wbg_ptr, x1, y1, x2, y2);
1732
+ }
1733
+ /**
1734
+ * Stochastic RSI
1735
+ * @param {number} period
1736
+ */
1737
+ stochRsi(period) {
1738
+ wasm.chart_stochRsi(this.__wbg_ptr, period);
26
1739
  }
27
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
28
1740
  }
29
-
30
- const JsBarFinalization = (typeof FinalizationRegistry === 'undefined')
31
- ? { register: () => {}, unregister: () => {} }
32
- : new FinalizationRegistry(ptr => wasm.__wbg_jsbar_free(ptr >>> 0, 1));
33
-
34
- const JsChartConfigFinalization = (typeof FinalizationRegistry === 'undefined')
35
- ? { register: () => {}, unregister: () => {} }
36
- : new FinalizationRegistry(ptr => wasm.__wbg_jschartconfig_free(ptr >>> 0, 1));
37
-
38
- const JsThemeFinalization = (typeof FinalizationRegistry === 'undefined')
39
- ? { register: () => {}, unregister: () => {} }
40
- : new FinalizationRegistry(ptr => wasm.__wbg_jstheme_free(ptr >>> 0, 1));
41
-
42
- const JsViewportFinalization = (typeof FinalizationRegistry === 'undefined')
43
- ? { register: () => {}, unregister: () => {} }
44
- : new FinalizationRegistry(ptr => wasm.__wbg_jsviewport_free(ptr >>> 0, 1));
1741
+ if (Symbol.dispose) Chart.prototype[Symbol.dispose] = Chart.prototype.free;
45
1742
 
46
1743
  /**
47
- * A single OHLCV bar
1744
+ * A single OHLCV bar representing one time period of price data.
48
1745
  */
49
1746
  export class JsBar {
1747
+ static __unwrap(jsValue) {
1748
+ if (!(jsValue instanceof JsBar)) {
1749
+ return 0;
1750
+ }
1751
+ return jsValue.__destroy_into_raw();
1752
+ }
50
1753
  __destroy_into_raw() {
51
1754
  const ptr = this.__wbg_ptr;
52
1755
  this.__wbg_ptr = 0;
@@ -72,6 +1775,7 @@ export class JsBar {
72
1775
  return ret;
73
1776
  }
74
1777
  /**
1778
+ * Create a new OHLCV bar.
75
1779
  * @param {bigint} timestamp
76
1780
  * @param {number} open
77
1781
  * @param {number} high
@@ -124,7 +1828,7 @@ export class JsBar {
124
1828
  if (Symbol.dispose) JsBar.prototype[Symbol.dispose] = JsBar.prototype.free;
125
1829
 
126
1830
  /**
127
- * Chart configuration
1831
+ * Low-level chart configuration.
128
1832
  */
129
1833
  export class JsChartConfig {
130
1834
  __destroy_into_raw() {
@@ -147,7 +1851,7 @@ export class JsChartConfig {
147
1851
  if (Symbol.dispose) JsChartConfig.prototype[Symbol.dispose] = JsChartConfig.prototype.free;
148
1852
 
149
1853
  /**
150
- * Chart theme (colors)
1854
+ * Chart theme with predefined color schemes.
151
1855
  */
152
1856
  export class JsTheme {
153
1857
  static __wrap(ptr) {
@@ -260,7 +1964,7 @@ export class JsTheme {
260
1964
  if (Symbol.dispose) JsTheme.prototype[Symbol.dispose] = JsTheme.prototype.free;
261
1965
 
262
1966
  /**
263
- * Chart viewport managing visible area
1967
+ * Chart viewport managing visible area and scrolling.
264
1968
  */
265
1969
  export class JsViewport {
266
1970
  __destroy_into_raw() {
@@ -327,7 +2031,7 @@ export class JsViewport {
327
2031
  if (Symbol.dispose) JsViewport.prototype[Symbol.dispose] = JsViewport.prototype.free;
328
2032
 
329
2033
  /**
330
- * Get library version
2034
+ * Get library version.
331
2035
  * @returns {string}
332
2036
  */
333
2037
  export function version() {
@@ -381,6 +2085,10 @@ function __wbg_get_imports() {
381
2085
  imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
382
2086
  throw new Error(getStringFromWasm0(arg0, arg1));
383
2087
  };
2088
+ imports.wbg.__wbg_jsbar_unwrap = function(arg0) {
2089
+ const ret = JsBar.__unwrap(arg0);
2090
+ return ret;
2091
+ };
384
2092
  imports.wbg.__wbindgen_init_externref_table = function() {
385
2093
  const table = wasm.__wbindgen_externrefs;
386
2094
  const offset = table.grow(4);
@@ -397,6 +2105,8 @@ function __wbg_get_imports() {
397
2105
  function __wbg_finalize_init(instance, module) {
398
2106
  wasm = instance.exports;
399
2107
  __wbg_init.__wbindgen_wasm_module = module;
2108
+ cachedDataViewMemory0 = null;
2109
+ cachedFloat64ArrayMemory0 = null;
400
2110
  cachedUint8ArrayMemory0 = null;
401
2111
 
402
2112