@pipsend/charts 2.1.0 → 2.2.1
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 +9 -4
- package/dist/pipsend-charts.development.mjs +224 -22
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +224 -21
- package/dist/pipsend-charts.standalone.development.mjs +224 -22
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +43 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -260,10 +260,15 @@ const ha = applyHeikinAshi(series, chart);
|
|
|
260
260
|
ha.remove();
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
The source series keeps its real prices and is only
|
|
264
|
-
to it keep computing on the true OHLC,
|
|
265
|
-
|
|
266
|
-
the
|
|
263
|
+
The source series keeps its real prices and is only painted transparent, not
|
|
264
|
+
hidden: indicators bound to it keep computing on the true OHLC, its price lines
|
|
265
|
+
and primitives (positions, alerts, drawings) stay on screen, and `remove()`
|
|
266
|
+
restores the chart exactly as it was — which makes this usable as a chart-type
|
|
267
|
+
toggle. New bars pushed to the source are transformed automatically.
|
|
268
|
+
|
|
269
|
+
The same trick is exported as `hideSeriesPaint(series)` for drawing any other
|
|
270
|
+
view over a series: it blanks the paint, leaves the series visible to the engine,
|
|
271
|
+
and returns a function that puts the paint back.
|
|
267
272
|
|
|
268
273
|
Colors can be changed on a running transform, and are the candlestick ones:
|
|
269
274
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v2.1
|
|
3
|
+
* Pipsend Charts v2.2.1
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -15520,6 +15520,85 @@ function hasSeriesVolumes(series) {
|
|
|
15520
15520
|
return volumes !== undefined && volumes.size > 0;
|
|
15521
15521
|
}
|
|
15522
15522
|
|
|
15523
|
+
const TRANSPARENT = 'rgba(0, 0, 0, 0)';
|
|
15524
|
+
/**
|
|
15525
|
+
* Take a series off the screen without hiding it.
|
|
15526
|
+
*
|
|
15527
|
+
* `visible: false` takes down everything hung off the series as well: its
|
|
15528
|
+
* price lines, primitives and price-axis label stop rendering. A transform
|
|
15529
|
+
* that only wants the bars themselves out of the way — Heikin Ashi drawing
|
|
15530
|
+
* over its source — needs the series to stay visible to the engine, so its
|
|
15531
|
+
* paint is made transparent instead and the last-value label and price line
|
|
15532
|
+
* are switched off. Custom series have no known colours; those fall back to
|
|
15533
|
+
* `visible: false`.
|
|
15534
|
+
*
|
|
15535
|
+
* @param series - Series to blank out.
|
|
15536
|
+
* @returns Puts back the options the series had when it was blanked.
|
|
15537
|
+
*/
|
|
15538
|
+
function hideSeriesPaint(series) {
|
|
15539
|
+
switch (series.seriesType()) {
|
|
15540
|
+
case 'Candlestick':
|
|
15541
|
+
return blank(series, {
|
|
15542
|
+
upColor: TRANSPARENT,
|
|
15543
|
+
downColor: TRANSPARENT,
|
|
15544
|
+
borderVisible: false,
|
|
15545
|
+
wickVisible: false,
|
|
15546
|
+
});
|
|
15547
|
+
case 'Bar':
|
|
15548
|
+
return blank(series, {
|
|
15549
|
+
upColor: TRANSPARENT,
|
|
15550
|
+
downColor: TRANSPARENT,
|
|
15551
|
+
});
|
|
15552
|
+
case 'Line':
|
|
15553
|
+
return blank(series, {
|
|
15554
|
+
color: TRANSPARENT,
|
|
15555
|
+
crosshairMarkerVisible: false,
|
|
15556
|
+
pointMarkersVisible: false,
|
|
15557
|
+
});
|
|
15558
|
+
case 'Area':
|
|
15559
|
+
return blank(series, {
|
|
15560
|
+
lineColor: TRANSPARENT,
|
|
15561
|
+
topColor: TRANSPARENT,
|
|
15562
|
+
bottomColor: TRANSPARENT,
|
|
15563
|
+
crosshairMarkerVisible: false,
|
|
15564
|
+
pointMarkersVisible: false,
|
|
15565
|
+
});
|
|
15566
|
+
case 'Baseline':
|
|
15567
|
+
return blank(series, {
|
|
15568
|
+
topLineColor: TRANSPARENT,
|
|
15569
|
+
topFillColor1: TRANSPARENT,
|
|
15570
|
+
topFillColor2: TRANSPARENT,
|
|
15571
|
+
bottomLineColor: TRANSPARENT,
|
|
15572
|
+
bottomFillColor1: TRANSPARENT,
|
|
15573
|
+
bottomFillColor2: TRANSPARENT,
|
|
15574
|
+
crosshairMarkerVisible: false,
|
|
15575
|
+
pointMarkersVisible: false,
|
|
15576
|
+
});
|
|
15577
|
+
case 'Histogram':
|
|
15578
|
+
return blank(series, {
|
|
15579
|
+
color: TRANSPARENT,
|
|
15580
|
+
});
|
|
15581
|
+
default:
|
|
15582
|
+
return blank(series, { visible: false });
|
|
15583
|
+
}
|
|
15584
|
+
}
|
|
15585
|
+
function blank(series, paint) {
|
|
15586
|
+
const patch = {
|
|
15587
|
+
...paint,
|
|
15588
|
+
lastValueVisible: false,
|
|
15589
|
+
priceLineVisible: false,
|
|
15590
|
+
};
|
|
15591
|
+
const before = series.options();
|
|
15592
|
+
const snapshot = {};
|
|
15593
|
+
for (const key of Object.keys(patch)) {
|
|
15594
|
+
snapshot[key] = before[key];
|
|
15595
|
+
}
|
|
15596
|
+
series.applyOptions(patch);
|
|
15597
|
+
return () => {
|
|
15598
|
+
series.applyOptions(snapshot);
|
|
15599
|
+
};
|
|
15600
|
+
}
|
|
15601
|
+
|
|
15523
15602
|
/**
|
|
15524
15603
|
* Pins a bounded indicator (RSI, Stochastic…) to a fixed price range.
|
|
15525
15604
|
*
|
|
@@ -17216,9 +17295,9 @@ function calculateHeikinAshi(bars) {
|
|
|
17216
17295
|
* Draw a source series as Heikin Ashi candles.
|
|
17217
17296
|
*
|
|
17218
17297
|
* The source series is left in place holding its real prices — it is only
|
|
17219
|
-
*
|
|
17220
|
-
*
|
|
17221
|
-
* chart-type toggle:
|
|
17298
|
+
* painted transparent — so indicators bound to it keep computing on the true
|
|
17299
|
+
* OHLC, its price lines and primitives stay on screen, and `remove()` puts the
|
|
17300
|
+
* chart back exactly as it was. That makes this usable as a chart-type toggle:
|
|
17222
17301
|
*
|
|
17223
17302
|
* ```js
|
|
17224
17303
|
* const ha = applyHeikinAshi(candleSeries, chart);
|
|
@@ -17260,10 +17339,16 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17260
17339
|
priceScaleId: sourceOptions.priceScaleId,
|
|
17261
17340
|
priceFormat: sourceOptions.priceFormat,
|
|
17262
17341
|
}, resolved.paneIndex);
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17342
|
+
let restoreSourcePaint = null;
|
|
17343
|
+
const blankSource = (blank) => {
|
|
17344
|
+
if (blank && restoreSourcePaint === null) {
|
|
17345
|
+
restoreSourcePaint = hideSeriesPaint(series);
|
|
17346
|
+
}
|
|
17347
|
+
else if (!blank && restoreSourcePaint !== null) {
|
|
17348
|
+
restoreSourcePaint();
|
|
17349
|
+
restoreSourcePaint = null;
|
|
17350
|
+
}
|
|
17351
|
+
};
|
|
17267
17352
|
const runtime = bindIndicator({
|
|
17268
17353
|
_internal_source: series,
|
|
17269
17354
|
_internal_chart: chart,
|
|
@@ -17287,9 +17372,7 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17287
17372
|
wickUpColor: current.wickUpColor,
|
|
17288
17373
|
wickDownColor: current.wickDownColor,
|
|
17289
17374
|
});
|
|
17290
|
-
|
|
17291
|
-
visible: current.hideSource === true ? false : sourceWasVisible,
|
|
17292
|
-
});
|
|
17375
|
+
blankSource(current.hideSource === true);
|
|
17293
17376
|
},
|
|
17294
17377
|
});
|
|
17295
17378
|
const handle = {
|
|
@@ -17299,10 +17382,10 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17299
17382
|
recalculate: runtime.recalculate,
|
|
17300
17383
|
remove: () => {
|
|
17301
17384
|
runtime.remove();
|
|
17302
|
-
// The source outlives the indicator, so its
|
|
17385
|
+
// The source outlives the indicator, so its paint is ours to put
|
|
17303
17386
|
// back — otherwise removing a Heikin Ashi overlay leaves a blank chart.
|
|
17304
17387
|
try {
|
|
17305
|
-
|
|
17388
|
+
blankSource(false);
|
|
17306
17389
|
}
|
|
17307
17390
|
catch (error) {
|
|
17308
17391
|
// The series may already be gone if the chart was disposed
|
|
@@ -19929,6 +20012,9 @@ class DrawingToolBase {
|
|
|
19929
20012
|
get type() {
|
|
19930
20013
|
return this._type;
|
|
19931
20014
|
}
|
|
20015
|
+
isComplete() {
|
|
20016
|
+
return true;
|
|
20017
|
+
}
|
|
19932
20018
|
/**
|
|
19933
20019
|
* Lets a tool hand the base its own options object, once, in the constructor.
|
|
19934
20020
|
*
|
|
@@ -20256,6 +20342,7 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
20256
20342
|
this._private__dragStartPoint2 = null;
|
|
20257
20343
|
// Interactive mode
|
|
20258
20344
|
this._private__isComplete = false;
|
|
20345
|
+
this._private__interactive = null;
|
|
20259
20346
|
this._private__previewPoint = null;
|
|
20260
20347
|
this._private__trendOptions = {
|
|
20261
20348
|
lineColor: '#2962ff',
|
|
@@ -20303,7 +20390,7 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
20303
20390
|
this._private__isComplete = true;
|
|
20304
20391
|
}
|
|
20305
20392
|
});
|
|
20306
|
-
|
|
20393
|
+
this._private__interactive = manager;
|
|
20307
20394
|
manager._internal_startDrawing();
|
|
20308
20395
|
}
|
|
20309
20396
|
_private__createPrimitive() {
|
|
@@ -20633,7 +20720,14 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
20633
20720
|
_update() {
|
|
20634
20721
|
this._private__requestUpdate();
|
|
20635
20722
|
}
|
|
20723
|
+
isComplete() {
|
|
20724
|
+
return this._private__isComplete;
|
|
20725
|
+
}
|
|
20636
20726
|
remove() {
|
|
20727
|
+
if (this._private__interactive) {
|
|
20728
|
+
this._private__interactive._internal_destroy();
|
|
20729
|
+
this._private__interactive = null;
|
|
20730
|
+
}
|
|
20637
20731
|
if (this._private__primitive) {
|
|
20638
20732
|
// Detach from series
|
|
20639
20733
|
this._series.detachPrimitive(this._private__primitive);
|
|
@@ -21540,6 +21634,9 @@ class PolygonTool extends DrawingToolBase {
|
|
|
21540
21634
|
points() {
|
|
21541
21635
|
return this._private__points;
|
|
21542
21636
|
}
|
|
21637
|
+
isComplete() {
|
|
21638
|
+
return this._private__isComplete;
|
|
21639
|
+
}
|
|
21543
21640
|
remove() {
|
|
21544
21641
|
this._private__stopDrawing();
|
|
21545
21642
|
if (this._private__primitive) {
|
|
@@ -22010,6 +22107,9 @@ class ParallelChannelTool extends DrawingToolBase {
|
|
|
22010
22107
|
isHovered() {
|
|
22011
22108
|
return this._private__isHovered;
|
|
22012
22109
|
}
|
|
22110
|
+
isComplete() {
|
|
22111
|
+
return this._private__isComplete;
|
|
22112
|
+
}
|
|
22013
22113
|
remove() {
|
|
22014
22114
|
this._private__stopDrawing();
|
|
22015
22115
|
if (this._private__primitive) {
|
|
@@ -22474,6 +22574,9 @@ class PitchforkTool extends DrawingToolBase {
|
|
|
22474
22574
|
isHovered() {
|
|
22475
22575
|
return this._private__isHovered;
|
|
22476
22576
|
}
|
|
22577
|
+
isComplete() {
|
|
22578
|
+
return this._private__isComplete;
|
|
22579
|
+
}
|
|
22477
22580
|
remove() {
|
|
22478
22581
|
this._private__stopDrawing();
|
|
22479
22582
|
if (this._private__primitive) {
|
|
@@ -23404,6 +23507,9 @@ class FibonacciTool extends DrawingToolBase {
|
|
|
23404
23507
|
}
|
|
23405
23508
|
return false;
|
|
23406
23509
|
}
|
|
23510
|
+
isComplete() {
|
|
23511
|
+
return this._private__isComplete;
|
|
23512
|
+
}
|
|
23407
23513
|
remove() {
|
|
23408
23514
|
if (this._private__primitive) {
|
|
23409
23515
|
this._series.detachPrimitive(this._private__primitive);
|
|
@@ -24294,6 +24400,9 @@ class FibonacciFanTool extends DrawingToolBase {
|
|
|
24294
24400
|
_update() {
|
|
24295
24401
|
this._private__requestUpdate();
|
|
24296
24402
|
}
|
|
24403
|
+
isComplete() {
|
|
24404
|
+
return !this._private__isDrawing;
|
|
24405
|
+
}
|
|
24297
24406
|
remove() {
|
|
24298
24407
|
if (this._private__clickHandler) {
|
|
24299
24408
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -24837,6 +24946,9 @@ class RectangleTool extends DrawingToolBase {
|
|
|
24837
24946
|
_update() {
|
|
24838
24947
|
this._private__requestUpdate();
|
|
24839
24948
|
}
|
|
24949
|
+
isComplete() {
|
|
24950
|
+
return !this._private__isDrawing;
|
|
24951
|
+
}
|
|
24840
24952
|
remove() {
|
|
24841
24953
|
if (this._private__clickHandler) {
|
|
24842
24954
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -25300,6 +25412,9 @@ class CircleTool extends DrawingToolBase {
|
|
|
25300
25412
|
_update() {
|
|
25301
25413
|
this._private__requestUpdate();
|
|
25302
25414
|
}
|
|
25415
|
+
isComplete() {
|
|
25416
|
+
return !this._private__isDrawing;
|
|
25417
|
+
}
|
|
25303
25418
|
remove() {
|
|
25304
25419
|
if (this._private__clickHandler) {
|
|
25305
25420
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -25842,6 +25957,9 @@ class ArrowTool extends DrawingToolBase {
|
|
|
25842
25957
|
_update() {
|
|
25843
25958
|
this._private__requestUpdate();
|
|
25844
25959
|
}
|
|
25960
|
+
isComplete() {
|
|
25961
|
+
return !this._private__isDrawing;
|
|
25962
|
+
}
|
|
25845
25963
|
remove() {
|
|
25846
25964
|
// Clean up click handler
|
|
25847
25965
|
if (this._private__clickHandler) {
|
|
@@ -26408,7 +26526,7 @@ class TextTool extends DrawingToolBase {
|
|
|
26408
26526
|
}
|
|
26409
26527
|
_private__setupClickOutsideHandler() {
|
|
26410
26528
|
// Set up click handler to finish editing when clicking outside
|
|
26411
|
-
|
|
26529
|
+
const handler = (param) => {
|
|
26412
26530
|
if (!this._private__isEditing)
|
|
26413
26531
|
return;
|
|
26414
26532
|
// Get click coordinates
|
|
@@ -26424,7 +26542,9 @@ class TextTool extends DrawingToolBase {
|
|
|
26424
26542
|
this.remove();
|
|
26425
26543
|
}
|
|
26426
26544
|
}
|
|
26427
|
-
}
|
|
26545
|
+
};
|
|
26546
|
+
this._private__clickOutsideHandler = handler;
|
|
26547
|
+
this._chart.subscribeClick(handler);
|
|
26428
26548
|
}
|
|
26429
26549
|
_private__createPrimitive() {
|
|
26430
26550
|
this._private__paneView = this._private__createPaneView();
|
|
@@ -28573,6 +28693,9 @@ class DrawingToolsManager {
|
|
|
28573
28693
|
this._private__selectionChanged = new Delegate();
|
|
28574
28694
|
this._private__isDragging = false;
|
|
28575
28695
|
this._private__draggedToolId = null;
|
|
28696
|
+
this._private__pendingToolIds = new Set();
|
|
28697
|
+
this._private__completionCheck = null;
|
|
28698
|
+
this._private__drawingCompleted = new Delegate();
|
|
28576
28699
|
this._private__chart = chart;
|
|
28577
28700
|
this._private__series = series;
|
|
28578
28701
|
this._private__options = {
|
|
@@ -28611,9 +28734,63 @@ class DrawingToolsManager {
|
|
|
28611
28734
|
addTool(tool, id) {
|
|
28612
28735
|
const toolId = id ?? tool.id;
|
|
28613
28736
|
this._private__tools.set(toolId, tool);
|
|
28737
|
+
if (!tool.isComplete()) {
|
|
28738
|
+
this._private__pendingToolIds.add(toolId);
|
|
28739
|
+
}
|
|
28614
28740
|
this.recordChange();
|
|
28615
28741
|
return toolId;
|
|
28616
28742
|
}
|
|
28743
|
+
hasPendingDrawing() {
|
|
28744
|
+
return this._private__pendingToolIds.size > 0;
|
|
28745
|
+
}
|
|
28746
|
+
/** Removes every tool still waiting for points; returns how many were dropped. */
|
|
28747
|
+
cancelPendingDrawings() {
|
|
28748
|
+
if (this._private__pendingToolIds.size === 0) {
|
|
28749
|
+
return 0;
|
|
28750
|
+
}
|
|
28751
|
+
let cancelled = 0;
|
|
28752
|
+
for (const id of Array.from(this._private__pendingToolIds)) {
|
|
28753
|
+
const tool = this._private__tools.get(id);
|
|
28754
|
+
if (tool) {
|
|
28755
|
+
if (this._private__selectedToolId === id) {
|
|
28756
|
+
this._private__applySelection(null);
|
|
28757
|
+
}
|
|
28758
|
+
tool.remove();
|
|
28759
|
+
this._private__tools.delete(id);
|
|
28760
|
+
cancelled++;
|
|
28761
|
+
}
|
|
28762
|
+
}
|
|
28763
|
+
this._private__pendingToolIds.clear();
|
|
28764
|
+
if (cancelled > 0) {
|
|
28765
|
+
this.recordChange();
|
|
28766
|
+
}
|
|
28767
|
+
return cancelled;
|
|
28768
|
+
}
|
|
28769
|
+
subscribeDrawingCompleted(handler) {
|
|
28770
|
+
this._private__drawingCompleted._internal_subscribe(handler);
|
|
28771
|
+
}
|
|
28772
|
+
unsubscribeDrawingCompleted(handler) {
|
|
28773
|
+
this._private__drawingCompleted._internal_unsubscribe(handler);
|
|
28774
|
+
}
|
|
28775
|
+
_private__scheduleCompletionCheck() {
|
|
28776
|
+
if (this._private__pendingToolIds.size === 0 || this._private__completionCheck !== null) {
|
|
28777
|
+
return;
|
|
28778
|
+
}
|
|
28779
|
+
this._private__completionCheck = setTimeout(() => {
|
|
28780
|
+
this._private__completionCheck = null;
|
|
28781
|
+
for (const id of Array.from(this._private__pendingToolIds)) {
|
|
28782
|
+
const tool = this._private__tools.get(id);
|
|
28783
|
+
if (!tool) {
|
|
28784
|
+
this._private__pendingToolIds.delete(id);
|
|
28785
|
+
continue;
|
|
28786
|
+
}
|
|
28787
|
+
if (tool.isComplete()) {
|
|
28788
|
+
this._private__pendingToolIds.delete(id);
|
|
28789
|
+
this._private__drawingCompleted._internal_fire(id);
|
|
28790
|
+
}
|
|
28791
|
+
}
|
|
28792
|
+
}, 0);
|
|
28793
|
+
}
|
|
28617
28794
|
/**
|
|
28618
28795
|
* Remove a tool by ID
|
|
28619
28796
|
*/
|
|
@@ -28625,6 +28802,7 @@ class DrawingToolsManager {
|
|
|
28625
28802
|
}
|
|
28626
28803
|
tool.remove();
|
|
28627
28804
|
this._private__tools.delete(id);
|
|
28805
|
+
this._private__pendingToolIds.delete(id);
|
|
28628
28806
|
this.recordChange();
|
|
28629
28807
|
return true;
|
|
28630
28808
|
}
|
|
@@ -28824,6 +29002,7 @@ class DrawingToolsManager {
|
|
|
28824
29002
|
this._private__applySelection(null);
|
|
28825
29003
|
this._private__tools.forEach((tool) => tool.remove());
|
|
28826
29004
|
this._private__tools.clear();
|
|
29005
|
+
this._private__pendingToolIds.clear();
|
|
28827
29006
|
this.recordChange();
|
|
28828
29007
|
}
|
|
28829
29008
|
/**
|
|
@@ -29044,6 +29223,11 @@ class DrawingToolsManager {
|
|
|
29044
29223
|
* Destroy the manager and cleanup
|
|
29045
29224
|
*/
|
|
29046
29225
|
destroy() {
|
|
29226
|
+
if (this._private__completionCheck !== null) {
|
|
29227
|
+
clearTimeout(this._private__completionCheck);
|
|
29228
|
+
this._private__completionCheck = null;
|
|
29229
|
+
}
|
|
29230
|
+
this._private__drawingCompleted._internal_destroy();
|
|
29047
29231
|
this.clearAll();
|
|
29048
29232
|
this._private__detachEventHandlers();
|
|
29049
29233
|
}
|
|
@@ -29063,8 +29247,8 @@ class DrawingToolsManager {
|
|
|
29063
29247
|
const chartElement = this._private__chart.chartElement();
|
|
29064
29248
|
if (chartElement) {
|
|
29065
29249
|
this._private__pointerDownHandler = (event) => this._private__handlePointerDown(event);
|
|
29066
|
-
this._private__pointerUpHandler = (event) => this._private__handlePointerUp();
|
|
29067
|
-
this._private__pointerCancelHandler = (event) => this._private__handlePointerUp();
|
|
29250
|
+
this._private__pointerUpHandler = (event) => this._private__handlePointerUp(event);
|
|
29251
|
+
this._private__pointerCancelHandler = (event) => this._private__handlePointerUp(event);
|
|
29068
29252
|
chartElement.addEventListener('pointerdown', this._private__pointerDownHandler);
|
|
29069
29253
|
chartElement.addEventListener('pointerup', this._private__pointerUpHandler);
|
|
29070
29254
|
chartElement.addEventListener('pointercancel', this._private__pointerCancelHandler);
|
|
@@ -29107,6 +29291,7 @@ class DrawingToolsManager {
|
|
|
29107
29291
|
}
|
|
29108
29292
|
}
|
|
29109
29293
|
_private__handleClick(param) {
|
|
29294
|
+
this._private__scheduleCompletionCheck();
|
|
29110
29295
|
if (!param.point) {
|
|
29111
29296
|
return;
|
|
29112
29297
|
}
|
|
@@ -29186,6 +29371,9 @@ class DrawingToolsManager {
|
|
|
29186
29371
|
return null;
|
|
29187
29372
|
}
|
|
29188
29373
|
_private__handlePointerDown(event) {
|
|
29374
|
+
if (this._private__isDragging) {
|
|
29375
|
+
return;
|
|
29376
|
+
}
|
|
29189
29377
|
// Cleared for every press, then raised only if this one grabs a drawing
|
|
29190
29378
|
setInputClaim(this._private__chart, false);
|
|
29191
29379
|
const chartElement = this._private__chart.chartElement();
|
|
@@ -29228,10 +29416,13 @@ class DrawingToolsManager {
|
|
|
29228
29416
|
// mouse events, and those are what drive the crosshair the drag reads.
|
|
29229
29417
|
this._private__disableChartInteractions();
|
|
29230
29418
|
}
|
|
29231
|
-
_private__handlePointerUp() {
|
|
29419
|
+
_private__handlePointerUp(event) {
|
|
29232
29420
|
if (!this._private__isDragging || this._private__draggedToolId === null) {
|
|
29233
29421
|
return;
|
|
29234
29422
|
}
|
|
29423
|
+
if (event && this._private__pointerId !== null && event.pointerId !== this._private__pointerId) {
|
|
29424
|
+
return;
|
|
29425
|
+
}
|
|
29235
29426
|
const tool = this._private__tools.get(this._private__draggedToolId);
|
|
29236
29427
|
if (tool) {
|
|
29237
29428
|
tool.stopDrag();
|
|
@@ -29289,6 +29480,9 @@ class DrawingToolsManager {
|
|
|
29289
29480
|
this._private__pointerId = null;
|
|
29290
29481
|
}
|
|
29291
29482
|
_private__disableChartInteractions() {
|
|
29483
|
+
if (this._private__interactionsBeforeDrag !== null) {
|
|
29484
|
+
return;
|
|
29485
|
+
}
|
|
29292
29486
|
const options = this._private__chart.options();
|
|
29293
29487
|
this._private__interactionsBeforeDrag = {
|
|
29294
29488
|
_internal_handleScroll: options.handleScroll,
|
|
@@ -29313,6 +29507,14 @@ class DrawingToolsManager {
|
|
|
29313
29507
|
});
|
|
29314
29508
|
}
|
|
29315
29509
|
_private__handleKeyboard(event) {
|
|
29510
|
+
const target = event.target;
|
|
29511
|
+
const typing = !!target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable);
|
|
29512
|
+
if (typing) {
|
|
29513
|
+
return;
|
|
29514
|
+
}
|
|
29515
|
+
if (event.key === 'Enter') {
|
|
29516
|
+
this._private__scheduleCompletionCheck();
|
|
29517
|
+
}
|
|
29316
29518
|
// Delete or Backspace to remove selected tool
|
|
29317
29519
|
if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
29318
29520
|
if (this.deleteSelected()) {
|
|
@@ -29333,8 +29535,8 @@ class DrawingToolsManager {
|
|
|
29333
29535
|
}
|
|
29334
29536
|
return;
|
|
29335
29537
|
}
|
|
29336
|
-
// Escape to deselect
|
|
29337
29538
|
if (event.key === 'Escape') {
|
|
29539
|
+
this.cancelPendingDrawings();
|
|
29338
29540
|
this._private__handlePointerUp();
|
|
29339
29541
|
this._private__deselectAll();
|
|
29340
29542
|
this.stopDrawing();
|
|
@@ -29370,7 +29572,7 @@ const customSeriesDefaultOptions = {
|
|
|
29370
29572
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
29371
29573
|
*/
|
|
29372
29574
|
function version() {
|
|
29373
|
-
return "2.1
|
|
29575
|
+
return "2.2.1";
|
|
29374
29576
|
}
|
|
29375
29577
|
|
|
29376
|
-
export { areaSeries as AreaSeries, ArrowTool, barSeries as BarSeries, baselineSeries as BaselineSeries, BrushTool, candlestickSeries as CandlestickSeries, CircleTool, ColorType, CrossLineTool, CrosshairMode, DEFAULT_SESSIONS, DraggablePriceLine, DrawingToolsManager, EXTENDED_FIBONACCI_RATIOS, FibonacciCalculator, FibonacciExtensionTool, FibonacciFanTool, FibonacciTool, GanttTool, histogramSeries as HistogramSeries, HorizontalLineTool, InteractiveLineManager, LastPriceAnimationMode, lineSeries as LineSeries, LineStyle, LineType, MismatchDirection, ParallelChannelTool, PitchforkTool, PolygonTool, PositionCalculator, PositionMarkersManager, PositionTool, PriceLineSource, PriceScaleMode, RectangleTool, RulerCalculator, RulerTool, STANDARD_FIBONACCI_RATIOS, TextTool, TickMarkType, TrackingModeExitMode, TradingSessionsIndicator, TrendLineTool, VerticalLineTool, VolumeProfileIndicator, applyADX, applyATR, applyBollingerBands, applyCCI, applyDonchianChannels, applyEMA, applyHeikinAshi, applyIchimoku, applyKeltnerChannels, applyMACD, applyMFI, applyOBV, applyParabolicSAR, applyPivotPoints, applyRSI, applySMA, applyStochastic, applySuperTrend, applyVWAP, applyVolume, applyWMA, applyWilliamsR, calculateHeikinAshi, calculatePipConfig, coordinateFromTime, createArrowTool, createBrushTool, createChart, createChartEx, createCircleTool, createCrossLineTool, createFibonacciExtensionTool, createFibonacciFanTool, createFibonacciTool, createGanttTool, createHorizontalLineTool, createImageWatermark, createInteractiveLineManager, createOptionsChart, createParallelChannelTool, createPitchforkTool, createPolygonTool, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, isBusinessDay, isUTCTimestamp, setSeriesVolumes, setVolumeProfileData, timeFromCoordinate, version };
|
|
29578
|
+
export { areaSeries as AreaSeries, ArrowTool, barSeries as BarSeries, baselineSeries as BaselineSeries, BrushTool, candlestickSeries as CandlestickSeries, CircleTool, ColorType, CrossLineTool, CrosshairMode, DEFAULT_SESSIONS, DraggablePriceLine, DrawingToolsManager, EXTENDED_FIBONACCI_RATIOS, FibonacciCalculator, FibonacciExtensionTool, FibonacciFanTool, FibonacciTool, GanttTool, histogramSeries as HistogramSeries, HorizontalLineTool, InteractiveLineManager, LastPriceAnimationMode, lineSeries as LineSeries, LineStyle, LineType, MismatchDirection, ParallelChannelTool, PitchforkTool, PolygonTool, PositionCalculator, PositionMarkersManager, PositionTool, PriceLineSource, PriceScaleMode, RectangleTool, RulerCalculator, RulerTool, STANDARD_FIBONACCI_RATIOS, TextTool, TickMarkType, TrackingModeExitMode, TradingSessionsIndicator, TrendLineTool, VerticalLineTool, VolumeProfileIndicator, applyADX, applyATR, applyBollingerBands, applyCCI, applyDonchianChannels, applyEMA, applyHeikinAshi, applyIchimoku, applyKeltnerChannels, applyMACD, applyMFI, applyOBV, applyParabolicSAR, applyPivotPoints, applyRSI, applySMA, applyStochastic, applySuperTrend, applyVWAP, applyVolume, applyWMA, applyWilliamsR, calculateHeikinAshi, calculatePipConfig, coordinateFromTime, createArrowTool, createBrushTool, createChart, createChartEx, createCircleTool, createCrossLineTool, createFibonacciExtensionTool, createFibonacciFanTool, createFibonacciTool, createGanttTool, createHorizontalLineTool, createImageWatermark, createInteractiveLineManager, createOptionsChart, createParallelChannelTool, createPitchforkTool, createPolygonTool, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, hideSeriesPaint, isBusinessDay, isUTCTimestamp, setSeriesVolumes, setVolumeProfileData, timeFromCoordinate, version };
|