@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
|
@@ -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)
|
|
@@ -15913,6 +15913,85 @@ function hasSeriesVolumes(series) {
|
|
|
15913
15913
|
return volumes !== undefined && volumes.size > 0;
|
|
15914
15914
|
}
|
|
15915
15915
|
|
|
15916
|
+
const TRANSPARENT = 'rgba(0, 0, 0, 0)';
|
|
15917
|
+
/**
|
|
15918
|
+
* Take a series off the screen without hiding it.
|
|
15919
|
+
*
|
|
15920
|
+
* `visible: false` takes down everything hung off the series as well: its
|
|
15921
|
+
* price lines, primitives and price-axis label stop rendering. A transform
|
|
15922
|
+
* that only wants the bars themselves out of the way — Heikin Ashi drawing
|
|
15923
|
+
* over its source — needs the series to stay visible to the engine, so its
|
|
15924
|
+
* paint is made transparent instead and the last-value label and price line
|
|
15925
|
+
* are switched off. Custom series have no known colours; those fall back to
|
|
15926
|
+
* `visible: false`.
|
|
15927
|
+
*
|
|
15928
|
+
* @param series - Series to blank out.
|
|
15929
|
+
* @returns Puts back the options the series had when it was blanked.
|
|
15930
|
+
*/
|
|
15931
|
+
function hideSeriesPaint(series) {
|
|
15932
|
+
switch (series.seriesType()) {
|
|
15933
|
+
case 'Candlestick':
|
|
15934
|
+
return blank(series, {
|
|
15935
|
+
upColor: TRANSPARENT,
|
|
15936
|
+
downColor: TRANSPARENT,
|
|
15937
|
+
borderVisible: false,
|
|
15938
|
+
wickVisible: false,
|
|
15939
|
+
});
|
|
15940
|
+
case 'Bar':
|
|
15941
|
+
return blank(series, {
|
|
15942
|
+
upColor: TRANSPARENT,
|
|
15943
|
+
downColor: TRANSPARENT,
|
|
15944
|
+
});
|
|
15945
|
+
case 'Line':
|
|
15946
|
+
return blank(series, {
|
|
15947
|
+
color: TRANSPARENT,
|
|
15948
|
+
crosshairMarkerVisible: false,
|
|
15949
|
+
pointMarkersVisible: false,
|
|
15950
|
+
});
|
|
15951
|
+
case 'Area':
|
|
15952
|
+
return blank(series, {
|
|
15953
|
+
lineColor: TRANSPARENT,
|
|
15954
|
+
topColor: TRANSPARENT,
|
|
15955
|
+
bottomColor: TRANSPARENT,
|
|
15956
|
+
crosshairMarkerVisible: false,
|
|
15957
|
+
pointMarkersVisible: false,
|
|
15958
|
+
});
|
|
15959
|
+
case 'Baseline':
|
|
15960
|
+
return blank(series, {
|
|
15961
|
+
topLineColor: TRANSPARENT,
|
|
15962
|
+
topFillColor1: TRANSPARENT,
|
|
15963
|
+
topFillColor2: TRANSPARENT,
|
|
15964
|
+
bottomLineColor: TRANSPARENT,
|
|
15965
|
+
bottomFillColor1: TRANSPARENT,
|
|
15966
|
+
bottomFillColor2: TRANSPARENT,
|
|
15967
|
+
crosshairMarkerVisible: false,
|
|
15968
|
+
pointMarkersVisible: false,
|
|
15969
|
+
});
|
|
15970
|
+
case 'Histogram':
|
|
15971
|
+
return blank(series, {
|
|
15972
|
+
color: TRANSPARENT,
|
|
15973
|
+
});
|
|
15974
|
+
default:
|
|
15975
|
+
return blank(series, { visible: false });
|
|
15976
|
+
}
|
|
15977
|
+
}
|
|
15978
|
+
function blank(series, paint) {
|
|
15979
|
+
const patch = {
|
|
15980
|
+
...paint,
|
|
15981
|
+
lastValueVisible: false,
|
|
15982
|
+
priceLineVisible: false,
|
|
15983
|
+
};
|
|
15984
|
+
const before = series.options();
|
|
15985
|
+
const snapshot = {};
|
|
15986
|
+
for (const key of Object.keys(patch)) {
|
|
15987
|
+
snapshot[key] = before[key];
|
|
15988
|
+
}
|
|
15989
|
+
series.applyOptions(patch);
|
|
15990
|
+
return () => {
|
|
15991
|
+
series.applyOptions(snapshot);
|
|
15992
|
+
};
|
|
15993
|
+
}
|
|
15994
|
+
|
|
15916
15995
|
/**
|
|
15917
15996
|
* Pins a bounded indicator (RSI, Stochastic…) to a fixed price range.
|
|
15918
15997
|
*
|
|
@@ -17609,9 +17688,9 @@ function calculateHeikinAshi(bars) {
|
|
|
17609
17688
|
* Draw a source series as Heikin Ashi candles.
|
|
17610
17689
|
*
|
|
17611
17690
|
* The source series is left in place holding its real prices — it is only
|
|
17612
|
-
*
|
|
17613
|
-
*
|
|
17614
|
-
* chart-type toggle:
|
|
17691
|
+
* painted transparent — so indicators bound to it keep computing on the true
|
|
17692
|
+
* OHLC, its price lines and primitives stay on screen, and `remove()` puts the
|
|
17693
|
+
* chart back exactly as it was. That makes this usable as a chart-type toggle:
|
|
17615
17694
|
*
|
|
17616
17695
|
* ```js
|
|
17617
17696
|
* const ha = applyHeikinAshi(candleSeries, chart);
|
|
@@ -17653,10 +17732,16 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17653
17732
|
priceScaleId: sourceOptions.priceScaleId,
|
|
17654
17733
|
priceFormat: sourceOptions.priceFormat,
|
|
17655
17734
|
}, resolved.paneIndex);
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17735
|
+
let restoreSourcePaint = null;
|
|
17736
|
+
const blankSource = (blank) => {
|
|
17737
|
+
if (blank && restoreSourcePaint === null) {
|
|
17738
|
+
restoreSourcePaint = hideSeriesPaint(series);
|
|
17739
|
+
}
|
|
17740
|
+
else if (!blank && restoreSourcePaint !== null) {
|
|
17741
|
+
restoreSourcePaint();
|
|
17742
|
+
restoreSourcePaint = null;
|
|
17743
|
+
}
|
|
17744
|
+
};
|
|
17660
17745
|
const runtime = bindIndicator({
|
|
17661
17746
|
_internal_source: series,
|
|
17662
17747
|
_internal_chart: chart,
|
|
@@ -17680,9 +17765,7 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17680
17765
|
wickUpColor: current.wickUpColor,
|
|
17681
17766
|
wickDownColor: current.wickDownColor,
|
|
17682
17767
|
});
|
|
17683
|
-
|
|
17684
|
-
visible: current.hideSource === true ? false : sourceWasVisible,
|
|
17685
|
-
});
|
|
17768
|
+
blankSource(current.hideSource === true);
|
|
17686
17769
|
},
|
|
17687
17770
|
});
|
|
17688
17771
|
const handle = {
|
|
@@ -17692,10 +17775,10 @@ function applyHeikinAshi(series, chart, options = {}) {
|
|
|
17692
17775
|
recalculate: runtime.recalculate,
|
|
17693
17776
|
remove: () => {
|
|
17694
17777
|
runtime.remove();
|
|
17695
|
-
// The source outlives the indicator, so its
|
|
17778
|
+
// The source outlives the indicator, so its paint is ours to put
|
|
17696
17779
|
// back — otherwise removing a Heikin Ashi overlay leaves a blank chart.
|
|
17697
17780
|
try {
|
|
17698
|
-
|
|
17781
|
+
blankSource(false);
|
|
17699
17782
|
}
|
|
17700
17783
|
catch (error) {
|
|
17701
17784
|
// The series may already be gone if the chart was disposed
|
|
@@ -20322,6 +20405,9 @@ class DrawingToolBase {
|
|
|
20322
20405
|
get type() {
|
|
20323
20406
|
return this._type;
|
|
20324
20407
|
}
|
|
20408
|
+
isComplete() {
|
|
20409
|
+
return true;
|
|
20410
|
+
}
|
|
20325
20411
|
/**
|
|
20326
20412
|
* Lets a tool hand the base its own options object, once, in the constructor.
|
|
20327
20413
|
*
|
|
@@ -20649,6 +20735,7 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
20649
20735
|
this._private__dragStartPoint2 = null;
|
|
20650
20736
|
// Interactive mode
|
|
20651
20737
|
this._private__isComplete = false;
|
|
20738
|
+
this._private__interactive = null;
|
|
20652
20739
|
this._private__previewPoint = null;
|
|
20653
20740
|
this._private__trendOptions = {
|
|
20654
20741
|
lineColor: '#2962ff',
|
|
@@ -20696,7 +20783,7 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
20696
20783
|
this._private__isComplete = true;
|
|
20697
20784
|
}
|
|
20698
20785
|
});
|
|
20699
|
-
|
|
20786
|
+
this._private__interactive = manager;
|
|
20700
20787
|
manager._internal_startDrawing();
|
|
20701
20788
|
}
|
|
20702
20789
|
_private__createPrimitive() {
|
|
@@ -21026,7 +21113,14 @@ class TrendLineTool extends DrawingToolBase {
|
|
|
21026
21113
|
_update() {
|
|
21027
21114
|
this._private__requestUpdate();
|
|
21028
21115
|
}
|
|
21116
|
+
isComplete() {
|
|
21117
|
+
return this._private__isComplete;
|
|
21118
|
+
}
|
|
21029
21119
|
remove() {
|
|
21120
|
+
if (this._private__interactive) {
|
|
21121
|
+
this._private__interactive._internal_destroy();
|
|
21122
|
+
this._private__interactive = null;
|
|
21123
|
+
}
|
|
21030
21124
|
if (this._private__primitive) {
|
|
21031
21125
|
// Detach from series
|
|
21032
21126
|
this._series.detachPrimitive(this._private__primitive);
|
|
@@ -21933,6 +22027,9 @@ class PolygonTool extends DrawingToolBase {
|
|
|
21933
22027
|
points() {
|
|
21934
22028
|
return this._private__points;
|
|
21935
22029
|
}
|
|
22030
|
+
isComplete() {
|
|
22031
|
+
return this._private__isComplete;
|
|
22032
|
+
}
|
|
21936
22033
|
remove() {
|
|
21937
22034
|
this._private__stopDrawing();
|
|
21938
22035
|
if (this._private__primitive) {
|
|
@@ -22403,6 +22500,9 @@ class ParallelChannelTool extends DrawingToolBase {
|
|
|
22403
22500
|
isHovered() {
|
|
22404
22501
|
return this._private__isHovered;
|
|
22405
22502
|
}
|
|
22503
|
+
isComplete() {
|
|
22504
|
+
return this._private__isComplete;
|
|
22505
|
+
}
|
|
22406
22506
|
remove() {
|
|
22407
22507
|
this._private__stopDrawing();
|
|
22408
22508
|
if (this._private__primitive) {
|
|
@@ -22867,6 +22967,9 @@ class PitchforkTool extends DrawingToolBase {
|
|
|
22867
22967
|
isHovered() {
|
|
22868
22968
|
return this._private__isHovered;
|
|
22869
22969
|
}
|
|
22970
|
+
isComplete() {
|
|
22971
|
+
return this._private__isComplete;
|
|
22972
|
+
}
|
|
22870
22973
|
remove() {
|
|
22871
22974
|
this._private__stopDrawing();
|
|
22872
22975
|
if (this._private__primitive) {
|
|
@@ -23797,6 +23900,9 @@ class FibonacciTool extends DrawingToolBase {
|
|
|
23797
23900
|
}
|
|
23798
23901
|
return false;
|
|
23799
23902
|
}
|
|
23903
|
+
isComplete() {
|
|
23904
|
+
return this._private__isComplete;
|
|
23905
|
+
}
|
|
23800
23906
|
remove() {
|
|
23801
23907
|
if (this._private__primitive) {
|
|
23802
23908
|
this._series.detachPrimitive(this._private__primitive);
|
|
@@ -24687,6 +24793,9 @@ class FibonacciFanTool extends DrawingToolBase {
|
|
|
24687
24793
|
_update() {
|
|
24688
24794
|
this._private__requestUpdate();
|
|
24689
24795
|
}
|
|
24796
|
+
isComplete() {
|
|
24797
|
+
return !this._private__isDrawing;
|
|
24798
|
+
}
|
|
24690
24799
|
remove() {
|
|
24691
24800
|
if (this._private__clickHandler) {
|
|
24692
24801
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -25230,6 +25339,9 @@ class RectangleTool extends DrawingToolBase {
|
|
|
25230
25339
|
_update() {
|
|
25231
25340
|
this._private__requestUpdate();
|
|
25232
25341
|
}
|
|
25342
|
+
isComplete() {
|
|
25343
|
+
return !this._private__isDrawing;
|
|
25344
|
+
}
|
|
25233
25345
|
remove() {
|
|
25234
25346
|
if (this._private__clickHandler) {
|
|
25235
25347
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -25693,6 +25805,9 @@ class CircleTool extends DrawingToolBase {
|
|
|
25693
25805
|
_update() {
|
|
25694
25806
|
this._private__requestUpdate();
|
|
25695
25807
|
}
|
|
25808
|
+
isComplete() {
|
|
25809
|
+
return !this._private__isDrawing;
|
|
25810
|
+
}
|
|
25696
25811
|
remove() {
|
|
25697
25812
|
if (this._private__clickHandler) {
|
|
25698
25813
|
this._chart.unsubscribeClick(this._private__clickHandler);
|
|
@@ -26235,6 +26350,9 @@ class ArrowTool extends DrawingToolBase {
|
|
|
26235
26350
|
_update() {
|
|
26236
26351
|
this._private__requestUpdate();
|
|
26237
26352
|
}
|
|
26353
|
+
isComplete() {
|
|
26354
|
+
return !this._private__isDrawing;
|
|
26355
|
+
}
|
|
26238
26356
|
remove() {
|
|
26239
26357
|
// Clean up click handler
|
|
26240
26358
|
if (this._private__clickHandler) {
|
|
@@ -26801,7 +26919,7 @@ class TextTool extends DrawingToolBase {
|
|
|
26801
26919
|
}
|
|
26802
26920
|
_private__setupClickOutsideHandler() {
|
|
26803
26921
|
// Set up click handler to finish editing when clicking outside
|
|
26804
|
-
|
|
26922
|
+
const handler = (param) => {
|
|
26805
26923
|
if (!this._private__isEditing)
|
|
26806
26924
|
return;
|
|
26807
26925
|
// Get click coordinates
|
|
@@ -26817,7 +26935,9 @@ class TextTool extends DrawingToolBase {
|
|
|
26817
26935
|
this.remove();
|
|
26818
26936
|
}
|
|
26819
26937
|
}
|
|
26820
|
-
}
|
|
26938
|
+
};
|
|
26939
|
+
this._private__clickOutsideHandler = handler;
|
|
26940
|
+
this._chart.subscribeClick(handler);
|
|
26821
26941
|
}
|
|
26822
26942
|
_private__createPrimitive() {
|
|
26823
26943
|
this._private__paneView = this._private__createPaneView();
|
|
@@ -28966,6 +29086,9 @@ class DrawingToolsManager {
|
|
|
28966
29086
|
this._private__selectionChanged = new Delegate();
|
|
28967
29087
|
this._private__isDragging = false;
|
|
28968
29088
|
this._private__draggedToolId = null;
|
|
29089
|
+
this._private__pendingToolIds = new Set();
|
|
29090
|
+
this._private__completionCheck = null;
|
|
29091
|
+
this._private__drawingCompleted = new Delegate();
|
|
28969
29092
|
this._private__chart = chart;
|
|
28970
29093
|
this._private__series = series;
|
|
28971
29094
|
this._private__options = {
|
|
@@ -29004,9 +29127,63 @@ class DrawingToolsManager {
|
|
|
29004
29127
|
addTool(tool, id) {
|
|
29005
29128
|
const toolId = id ?? tool.id;
|
|
29006
29129
|
this._private__tools.set(toolId, tool);
|
|
29130
|
+
if (!tool.isComplete()) {
|
|
29131
|
+
this._private__pendingToolIds.add(toolId);
|
|
29132
|
+
}
|
|
29007
29133
|
this.recordChange();
|
|
29008
29134
|
return toolId;
|
|
29009
29135
|
}
|
|
29136
|
+
hasPendingDrawing() {
|
|
29137
|
+
return this._private__pendingToolIds.size > 0;
|
|
29138
|
+
}
|
|
29139
|
+
/** Removes every tool still waiting for points; returns how many were dropped. */
|
|
29140
|
+
cancelPendingDrawings() {
|
|
29141
|
+
if (this._private__pendingToolIds.size === 0) {
|
|
29142
|
+
return 0;
|
|
29143
|
+
}
|
|
29144
|
+
let cancelled = 0;
|
|
29145
|
+
for (const id of Array.from(this._private__pendingToolIds)) {
|
|
29146
|
+
const tool = this._private__tools.get(id);
|
|
29147
|
+
if (tool) {
|
|
29148
|
+
if (this._private__selectedToolId === id) {
|
|
29149
|
+
this._private__applySelection(null);
|
|
29150
|
+
}
|
|
29151
|
+
tool.remove();
|
|
29152
|
+
this._private__tools.delete(id);
|
|
29153
|
+
cancelled++;
|
|
29154
|
+
}
|
|
29155
|
+
}
|
|
29156
|
+
this._private__pendingToolIds.clear();
|
|
29157
|
+
if (cancelled > 0) {
|
|
29158
|
+
this.recordChange();
|
|
29159
|
+
}
|
|
29160
|
+
return cancelled;
|
|
29161
|
+
}
|
|
29162
|
+
subscribeDrawingCompleted(handler) {
|
|
29163
|
+
this._private__drawingCompleted._internal_subscribe(handler);
|
|
29164
|
+
}
|
|
29165
|
+
unsubscribeDrawingCompleted(handler) {
|
|
29166
|
+
this._private__drawingCompleted._internal_unsubscribe(handler);
|
|
29167
|
+
}
|
|
29168
|
+
_private__scheduleCompletionCheck() {
|
|
29169
|
+
if (this._private__pendingToolIds.size === 0 || this._private__completionCheck !== null) {
|
|
29170
|
+
return;
|
|
29171
|
+
}
|
|
29172
|
+
this._private__completionCheck = setTimeout(() => {
|
|
29173
|
+
this._private__completionCheck = null;
|
|
29174
|
+
for (const id of Array.from(this._private__pendingToolIds)) {
|
|
29175
|
+
const tool = this._private__tools.get(id);
|
|
29176
|
+
if (!tool) {
|
|
29177
|
+
this._private__pendingToolIds.delete(id);
|
|
29178
|
+
continue;
|
|
29179
|
+
}
|
|
29180
|
+
if (tool.isComplete()) {
|
|
29181
|
+
this._private__pendingToolIds.delete(id);
|
|
29182
|
+
this._private__drawingCompleted._internal_fire(id);
|
|
29183
|
+
}
|
|
29184
|
+
}
|
|
29185
|
+
}, 0);
|
|
29186
|
+
}
|
|
29010
29187
|
/**
|
|
29011
29188
|
* Remove a tool by ID
|
|
29012
29189
|
*/
|
|
@@ -29018,6 +29195,7 @@ class DrawingToolsManager {
|
|
|
29018
29195
|
}
|
|
29019
29196
|
tool.remove();
|
|
29020
29197
|
this._private__tools.delete(id);
|
|
29198
|
+
this._private__pendingToolIds.delete(id);
|
|
29021
29199
|
this.recordChange();
|
|
29022
29200
|
return true;
|
|
29023
29201
|
}
|
|
@@ -29217,6 +29395,7 @@ class DrawingToolsManager {
|
|
|
29217
29395
|
this._private__applySelection(null);
|
|
29218
29396
|
this._private__tools.forEach((tool) => tool.remove());
|
|
29219
29397
|
this._private__tools.clear();
|
|
29398
|
+
this._private__pendingToolIds.clear();
|
|
29220
29399
|
this.recordChange();
|
|
29221
29400
|
}
|
|
29222
29401
|
/**
|
|
@@ -29437,6 +29616,11 @@ class DrawingToolsManager {
|
|
|
29437
29616
|
* Destroy the manager and cleanup
|
|
29438
29617
|
*/
|
|
29439
29618
|
destroy() {
|
|
29619
|
+
if (this._private__completionCheck !== null) {
|
|
29620
|
+
clearTimeout(this._private__completionCheck);
|
|
29621
|
+
this._private__completionCheck = null;
|
|
29622
|
+
}
|
|
29623
|
+
this._private__drawingCompleted._internal_destroy();
|
|
29440
29624
|
this.clearAll();
|
|
29441
29625
|
this._private__detachEventHandlers();
|
|
29442
29626
|
}
|
|
@@ -29456,8 +29640,8 @@ class DrawingToolsManager {
|
|
|
29456
29640
|
const chartElement = this._private__chart.chartElement();
|
|
29457
29641
|
if (chartElement) {
|
|
29458
29642
|
this._private__pointerDownHandler = (event) => this._private__handlePointerDown(event);
|
|
29459
|
-
this._private__pointerUpHandler = (event) => this._private__handlePointerUp();
|
|
29460
|
-
this._private__pointerCancelHandler = (event) => this._private__handlePointerUp();
|
|
29643
|
+
this._private__pointerUpHandler = (event) => this._private__handlePointerUp(event);
|
|
29644
|
+
this._private__pointerCancelHandler = (event) => this._private__handlePointerUp(event);
|
|
29461
29645
|
chartElement.addEventListener('pointerdown', this._private__pointerDownHandler);
|
|
29462
29646
|
chartElement.addEventListener('pointerup', this._private__pointerUpHandler);
|
|
29463
29647
|
chartElement.addEventListener('pointercancel', this._private__pointerCancelHandler);
|
|
@@ -29500,6 +29684,7 @@ class DrawingToolsManager {
|
|
|
29500
29684
|
}
|
|
29501
29685
|
}
|
|
29502
29686
|
_private__handleClick(param) {
|
|
29687
|
+
this._private__scheduleCompletionCheck();
|
|
29503
29688
|
if (!param.point) {
|
|
29504
29689
|
return;
|
|
29505
29690
|
}
|
|
@@ -29579,6 +29764,9 @@ class DrawingToolsManager {
|
|
|
29579
29764
|
return null;
|
|
29580
29765
|
}
|
|
29581
29766
|
_private__handlePointerDown(event) {
|
|
29767
|
+
if (this._private__isDragging) {
|
|
29768
|
+
return;
|
|
29769
|
+
}
|
|
29582
29770
|
// Cleared for every press, then raised only if this one grabs a drawing
|
|
29583
29771
|
setInputClaim(this._private__chart, false);
|
|
29584
29772
|
const chartElement = this._private__chart.chartElement();
|
|
@@ -29621,10 +29809,13 @@ class DrawingToolsManager {
|
|
|
29621
29809
|
// mouse events, and those are what drive the crosshair the drag reads.
|
|
29622
29810
|
this._private__disableChartInteractions();
|
|
29623
29811
|
}
|
|
29624
|
-
_private__handlePointerUp() {
|
|
29812
|
+
_private__handlePointerUp(event) {
|
|
29625
29813
|
if (!this._private__isDragging || this._private__draggedToolId === null) {
|
|
29626
29814
|
return;
|
|
29627
29815
|
}
|
|
29816
|
+
if (event && this._private__pointerId !== null && event.pointerId !== this._private__pointerId) {
|
|
29817
|
+
return;
|
|
29818
|
+
}
|
|
29628
29819
|
const tool = this._private__tools.get(this._private__draggedToolId);
|
|
29629
29820
|
if (tool) {
|
|
29630
29821
|
tool.stopDrag();
|
|
@@ -29682,6 +29873,9 @@ class DrawingToolsManager {
|
|
|
29682
29873
|
this._private__pointerId = null;
|
|
29683
29874
|
}
|
|
29684
29875
|
_private__disableChartInteractions() {
|
|
29876
|
+
if (this._private__interactionsBeforeDrag !== null) {
|
|
29877
|
+
return;
|
|
29878
|
+
}
|
|
29685
29879
|
const options = this._private__chart.options();
|
|
29686
29880
|
this._private__interactionsBeforeDrag = {
|
|
29687
29881
|
_internal_handleScroll: options.handleScroll,
|
|
@@ -29706,6 +29900,14 @@ class DrawingToolsManager {
|
|
|
29706
29900
|
});
|
|
29707
29901
|
}
|
|
29708
29902
|
_private__handleKeyboard(event) {
|
|
29903
|
+
const target = event.target;
|
|
29904
|
+
const typing = !!target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable);
|
|
29905
|
+
if (typing) {
|
|
29906
|
+
return;
|
|
29907
|
+
}
|
|
29908
|
+
if (event.key === 'Enter') {
|
|
29909
|
+
this._private__scheduleCompletionCheck();
|
|
29910
|
+
}
|
|
29709
29911
|
// Delete or Backspace to remove selected tool
|
|
29710
29912
|
if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
29711
29913
|
if (this.deleteSelected()) {
|
|
@@ -29726,8 +29928,8 @@ class DrawingToolsManager {
|
|
|
29726
29928
|
}
|
|
29727
29929
|
return;
|
|
29728
29930
|
}
|
|
29729
|
-
// Escape to deselect
|
|
29730
29931
|
if (event.key === 'Escape') {
|
|
29932
|
+
this.cancelPendingDrawings();
|
|
29731
29933
|
this._private__handlePointerUp();
|
|
29732
29934
|
this._private__deselectAll();
|
|
29733
29935
|
this.stopDrawing();
|
|
@@ -29763,7 +29965,7 @@ const customSeriesDefaultOptions = {
|
|
|
29763
29965
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
29764
29966
|
*/
|
|
29765
29967
|
function version() {
|
|
29766
|
-
return "2.1
|
|
29968
|
+
return "2.2.1";
|
|
29767
29969
|
}
|
|
29768
29970
|
|
|
29769
|
-
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 };
|
|
29971
|
+
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 };
|