@pipsend/charts 2.3.16 → 2.3.18
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/dist/pipsend-charts.development.mjs +170 -10
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +170 -9
- package/dist/pipsend-charts.standalone.development.mjs +170 -10
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +21 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v2.3.
|
|
3
|
+
* Pipsend Charts v2.3.18-dev+202610170141
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -15924,6 +15924,127 @@
|
|
|
15924
15924
|
return wrapper;
|
|
15925
15925
|
}
|
|
15926
15926
|
|
|
15927
|
+
const timeLabelsOptionsDefaults = {
|
|
15928
|
+
position: 'bottom',
|
|
15929
|
+
offset: 4,
|
|
15930
|
+
fontSize: 11,
|
|
15931
|
+
fontFamily: '',
|
|
15932
|
+
color: '#787B86',
|
|
15933
|
+
};
|
|
15934
|
+
|
|
15935
|
+
class TimeLabelsRenderer {
|
|
15936
|
+
constructor(data) {
|
|
15937
|
+
this._private__data = data;
|
|
15938
|
+
}
|
|
15939
|
+
draw(target) {
|
|
15940
|
+
const { _internal_items: items, _internal_position: position, _internal_offset: offset } = this._private__data;
|
|
15941
|
+
if (items.length === 0) {
|
|
15942
|
+
return;
|
|
15943
|
+
}
|
|
15944
|
+
target.useMediaCoordinateSpace(({ context: ctx, mediaSize }) => {
|
|
15945
|
+
const y = position === 'top' ? offset : mediaSize.height - offset;
|
|
15946
|
+
ctx.save();
|
|
15947
|
+
ctx.textAlign = 'center';
|
|
15948
|
+
ctx.textBaseline = position === 'top' ? 'top' : 'bottom';
|
|
15949
|
+
for (const item of items) {
|
|
15950
|
+
if (item._internal_x < -100 /* Constants.OffscreenMargin */ || item._internal_x > mediaSize.width + 100 /* Constants.OffscreenMargin */) {
|
|
15951
|
+
continue;
|
|
15952
|
+
}
|
|
15953
|
+
ctx.font = item._internal_font;
|
|
15954
|
+
ctx.fillStyle = item._internal_color;
|
|
15955
|
+
ctx.fillText(item._internal_text, item._internal_x, y);
|
|
15956
|
+
}
|
|
15957
|
+
ctx.restore();
|
|
15958
|
+
});
|
|
15959
|
+
}
|
|
15960
|
+
}
|
|
15961
|
+
class TimeLabelsPaneView {
|
|
15962
|
+
constructor() {
|
|
15963
|
+
this._private__data = { _internal_items: [], _internal_position: 'bottom', _internal_offset: 0 };
|
|
15964
|
+
}
|
|
15965
|
+
_internal_update(data) {
|
|
15966
|
+
this._private__data = data;
|
|
15967
|
+
}
|
|
15968
|
+
zOrder() {
|
|
15969
|
+
return 'top';
|
|
15970
|
+
}
|
|
15971
|
+
renderer() {
|
|
15972
|
+
return new TimeLabelsRenderer(this._private__data);
|
|
15973
|
+
}
|
|
15974
|
+
}
|
|
15975
|
+
class TimeLabelsPrimitive {
|
|
15976
|
+
constructor(options) {
|
|
15977
|
+
this._private__chart = null;
|
|
15978
|
+
this._private__requestUpdate = null;
|
|
15979
|
+
this._private__labels = [];
|
|
15980
|
+
this._private__paneView = new TimeLabelsPaneView();
|
|
15981
|
+
this._private__options = { ...timeLabelsOptionsDefaults, ...options };
|
|
15982
|
+
}
|
|
15983
|
+
attached(param) {
|
|
15984
|
+
this._private__chart = param.chart;
|
|
15985
|
+
this._private__requestUpdate = param.requestUpdate;
|
|
15986
|
+
this._private__requestUpdate();
|
|
15987
|
+
}
|
|
15988
|
+
detached() {
|
|
15989
|
+
this._private__chart = null;
|
|
15990
|
+
this._private__requestUpdate = null;
|
|
15991
|
+
}
|
|
15992
|
+
_internal_setLabels(labels) {
|
|
15993
|
+
this._private__labels = labels.slice();
|
|
15994
|
+
this._private__requestUpdate?.();
|
|
15995
|
+
}
|
|
15996
|
+
_internal_labels() {
|
|
15997
|
+
return this._private__labels;
|
|
15998
|
+
}
|
|
15999
|
+
_internal_applyOptions(options) {
|
|
16000
|
+
this._private__options = { ...this._private__options, ...options };
|
|
16001
|
+
this._private__requestUpdate?.();
|
|
16002
|
+
}
|
|
16003
|
+
updateAllViews() {
|
|
16004
|
+
const chart = this._private__chart;
|
|
16005
|
+
const options = this._private__options;
|
|
16006
|
+
if (chart === null) {
|
|
16007
|
+
this._private__paneView._internal_update({ _internal_items: [], _internal_position: options.position, _internal_offset: options.offset });
|
|
16008
|
+
return;
|
|
16009
|
+
}
|
|
16010
|
+
const timeScale = chart.timeScale();
|
|
16011
|
+
const family = options.fontFamily || chart.options().layout.fontFamily;
|
|
16012
|
+
const items = [];
|
|
16013
|
+
for (const label of this._private__labels) {
|
|
16014
|
+
const x = timeScale.timeToCoordinate(label.time);
|
|
16015
|
+
if (x === null) {
|
|
16016
|
+
continue;
|
|
16017
|
+
}
|
|
16018
|
+
items.push({
|
|
16019
|
+
_internal_x: x,
|
|
16020
|
+
_internal_text: label.text,
|
|
16021
|
+
_internal_color: label.color ?? options.color,
|
|
16022
|
+
_internal_font: makeFont(label.size ?? options.fontSize, family),
|
|
16023
|
+
});
|
|
16024
|
+
}
|
|
16025
|
+
this._private__paneView._internal_update({ _internal_items: items, _internal_position: options.position, _internal_offset: options.offset });
|
|
16026
|
+
}
|
|
16027
|
+
paneViews() {
|
|
16028
|
+
return [this._private__paneView];
|
|
16029
|
+
}
|
|
16030
|
+
}
|
|
16031
|
+
|
|
16032
|
+
class TimeLabelsPrimitiveWrapper extends SeriesPrimitiveAdapter {
|
|
16033
|
+
setLabels(labels) {
|
|
16034
|
+
this._internal__primitive._internal_setLabels(labels);
|
|
16035
|
+
}
|
|
16036
|
+
labels() {
|
|
16037
|
+
return this._internal__primitive._internal_labels();
|
|
16038
|
+
}
|
|
16039
|
+
}
|
|
16040
|
+
function createTimeLabels(series, labels, options) {
|
|
16041
|
+
const wrapper = new TimeLabelsPrimitiveWrapper(series, new TimeLabelsPrimitive(options));
|
|
16042
|
+
if (labels) {
|
|
16043
|
+
wrapper.setLabels(labels);
|
|
16044
|
+
}
|
|
16045
|
+
return wrapper;
|
|
16046
|
+
}
|
|
16047
|
+
|
|
15927
16048
|
class PositionMarkersManager {
|
|
15928
16049
|
constructor(series, options) {
|
|
15929
16050
|
this._private__markersPlugin = null;
|
|
@@ -20612,8 +20733,11 @@
|
|
|
20612
20733
|
* move — which is invisible, and cheaper than forcing a second pass.
|
|
20613
20734
|
*/
|
|
20614
20735
|
_internal_setClaims(ownerId, claims) {
|
|
20736
|
+
const previous = this._private__claims.get(ownerId);
|
|
20615
20737
|
this._private__claims.set(ownerId, claims);
|
|
20616
|
-
|
|
20738
|
+
if (previous === undefined || !sameClaims(previous, claims)) {
|
|
20739
|
+
this._private__invalidated = true;
|
|
20740
|
+
}
|
|
20617
20741
|
}
|
|
20618
20742
|
/** How far down a label has to move to clear the ones already placed. */
|
|
20619
20743
|
_internal_offsetFor(ownerId, level) {
|
|
@@ -20634,7 +20758,10 @@
|
|
|
20634
20758
|
// them only need the few pixels they are short of — stepping by a
|
|
20635
20759
|
// full gap each time is what made the fan look flung open.
|
|
20636
20760
|
let y = claim._internal_y;
|
|
20637
|
-
for (const other of
|
|
20761
|
+
for (const other of placed) {
|
|
20762
|
+
if (other._internal_y >= y + gap) {
|
|
20763
|
+
break;
|
|
20764
|
+
}
|
|
20638
20765
|
if (Math.abs(y - other._internal_y) < gap) {
|
|
20639
20766
|
y = other._internal_y + gap;
|
|
20640
20767
|
}
|
|
@@ -20645,7 +20772,7 @@
|
|
|
20645
20772
|
// no worse than before and keeps the pile from running off.
|
|
20646
20773
|
offset = 0;
|
|
20647
20774
|
}
|
|
20648
|
-
placed
|
|
20775
|
+
insertByY(placed, { _internal_y: claim._internal_y + offset, _internal_height: claim._internal_height });
|
|
20649
20776
|
offsets.set(key(ownerId, claim._internal_level), offset);
|
|
20650
20777
|
}
|
|
20651
20778
|
}
|
|
@@ -20663,8 +20790,30 @@
|
|
|
20663
20790
|
function minGap(height) {
|
|
20664
20791
|
return Math.max(9, Math.round(height * 0.4));
|
|
20665
20792
|
}
|
|
20666
|
-
function
|
|
20667
|
-
|
|
20793
|
+
function insertByY(placed, claim) {
|
|
20794
|
+
let low = 0;
|
|
20795
|
+
let high = placed.length;
|
|
20796
|
+
while (low < high) {
|
|
20797
|
+
const middle = (low + high) >> 1;
|
|
20798
|
+
if (placed[middle]._internal_y <= claim._internal_y) {
|
|
20799
|
+
low = middle + 1;
|
|
20800
|
+
}
|
|
20801
|
+
else {
|
|
20802
|
+
high = middle;
|
|
20803
|
+
}
|
|
20804
|
+
}
|
|
20805
|
+
placed.splice(low, 0, claim);
|
|
20806
|
+
}
|
|
20807
|
+
function sameClaims(a, b) {
|
|
20808
|
+
if (a.length !== b.length) {
|
|
20809
|
+
return false;
|
|
20810
|
+
}
|
|
20811
|
+
for (let i = 0; i < a.length; i++) {
|
|
20812
|
+
if (a[i]._internal_level !== b[i]._internal_level || a[i]._internal_y !== b[i]._internal_y || a[i]._internal_height !== b[i]._internal_height) {
|
|
20813
|
+
return false;
|
|
20814
|
+
}
|
|
20815
|
+
}
|
|
20816
|
+
return true;
|
|
20668
20817
|
}
|
|
20669
20818
|
const layouts = new WeakMap();
|
|
20670
20819
|
/** The layout is shared by every position line on the same chart. */
|
|
@@ -21019,6 +21168,7 @@
|
|
|
21019
21168
|
constructor(chart, series, options) {
|
|
21020
21169
|
this._private__paneView = new PositionLinePaneView();
|
|
21021
21170
|
this._private__colorParser = new ColorParser([]);
|
|
21171
|
+
this._private__axisLabels = new Map();
|
|
21022
21172
|
this._private__attached = false;
|
|
21023
21173
|
this._private__hoveredLevel = null;
|
|
21024
21174
|
this._private__hoveredPart = null;
|
|
@@ -21310,12 +21460,22 @@
|
|
|
21310
21460
|
return null;
|
|
21311
21461
|
}
|
|
21312
21462
|
const color = options.color ?? positionLineDefaultColors[level];
|
|
21313
|
-
|
|
21463
|
+
const formatter = this._private__series.priceFormatter();
|
|
21464
|
+
const cached = this._private__axisLabels.get(level);
|
|
21465
|
+
if (cached !== undefined && cached._internal_price === options.price && cached._internal_color === color && cached._internal_formatter === formatter) {
|
|
21466
|
+
if (cached._internal_label._internal_coordinate !== y) {
|
|
21467
|
+
cached._internal_label = { ...cached._internal_label, _internal_coordinate: y };
|
|
21468
|
+
}
|
|
21469
|
+
return cached._internal_label;
|
|
21470
|
+
}
|
|
21471
|
+
const label = {
|
|
21314
21472
|
_internal_coordinate: y,
|
|
21315
|
-
_internal_text:
|
|
21473
|
+
_internal_text: formatter.format(options.price),
|
|
21316
21474
|
_internal_color: color,
|
|
21317
21475
|
_internal_textColor: this._private__colorParser._internal_generateContrastColors(color)._internal_foreground,
|
|
21318
21476
|
};
|
|
21477
|
+
this._private__axisLabels.set(level, { _internal_price: options.price, _internal_color: color, _internal_formatter: formatter, _internal_label: label });
|
|
21478
|
+
return label;
|
|
21319
21479
|
}
|
|
21320
21480
|
_private__levelOptions(level) {
|
|
21321
21481
|
const options = level === 'entry' ? this._private__options.entry : this._private__options[level];
|
|
@@ -31446,7 +31606,7 @@
|
|
|
31446
31606
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
31447
31607
|
*/
|
|
31448
31608
|
function version() {
|
|
31449
|
-
return "2.3.
|
|
31609
|
+
return "2.3.18-dev+202610170141";
|
|
31450
31610
|
}
|
|
31451
31611
|
|
|
31452
31612
|
var PipsendChartsModule = /*#__PURE__*/Object.freeze({
|
|
@@ -31548,6 +31708,7 @@
|
|
|
31548
31708
|
createSeriesMarkers: createSeriesMarkers,
|
|
31549
31709
|
createTextTool: createTextTool,
|
|
31550
31710
|
createTextWatermark: createTextWatermark,
|
|
31711
|
+
createTimeLabels: createTimeLabels,
|
|
31551
31712
|
createTradingLine: createTradingLine,
|
|
31552
31713
|
createTradingSessionsIndicator: createTradingSessionsIndicator,
|
|
31553
31714
|
createTrendLineTool: createTrendLineTool,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v2.3.
|
|
3
|
+
* Pipsend Charts v2.3.18-dev+202610170141
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -15921,6 +15921,127 @@ function createUpDownMarkers(series, options = {}) {
|
|
|
15921
15921
|
return wrapper;
|
|
15922
15922
|
}
|
|
15923
15923
|
|
|
15924
|
+
const timeLabelsOptionsDefaults = {
|
|
15925
|
+
position: 'bottom',
|
|
15926
|
+
offset: 4,
|
|
15927
|
+
fontSize: 11,
|
|
15928
|
+
fontFamily: '',
|
|
15929
|
+
color: '#787B86',
|
|
15930
|
+
};
|
|
15931
|
+
|
|
15932
|
+
class TimeLabelsRenderer {
|
|
15933
|
+
constructor(data) {
|
|
15934
|
+
this._private__data = data;
|
|
15935
|
+
}
|
|
15936
|
+
draw(target) {
|
|
15937
|
+
const { _internal_items: items, _internal_position: position, _internal_offset: offset } = this._private__data;
|
|
15938
|
+
if (items.length === 0) {
|
|
15939
|
+
return;
|
|
15940
|
+
}
|
|
15941
|
+
target.useMediaCoordinateSpace(({ context: ctx, mediaSize }) => {
|
|
15942
|
+
const y = position === 'top' ? offset : mediaSize.height - offset;
|
|
15943
|
+
ctx.save();
|
|
15944
|
+
ctx.textAlign = 'center';
|
|
15945
|
+
ctx.textBaseline = position === 'top' ? 'top' : 'bottom';
|
|
15946
|
+
for (const item of items) {
|
|
15947
|
+
if (item._internal_x < -100 /* Constants.OffscreenMargin */ || item._internal_x > mediaSize.width + 100 /* Constants.OffscreenMargin */) {
|
|
15948
|
+
continue;
|
|
15949
|
+
}
|
|
15950
|
+
ctx.font = item._internal_font;
|
|
15951
|
+
ctx.fillStyle = item._internal_color;
|
|
15952
|
+
ctx.fillText(item._internal_text, item._internal_x, y);
|
|
15953
|
+
}
|
|
15954
|
+
ctx.restore();
|
|
15955
|
+
});
|
|
15956
|
+
}
|
|
15957
|
+
}
|
|
15958
|
+
class TimeLabelsPaneView {
|
|
15959
|
+
constructor() {
|
|
15960
|
+
this._private__data = { _internal_items: [], _internal_position: 'bottom', _internal_offset: 0 };
|
|
15961
|
+
}
|
|
15962
|
+
_internal_update(data) {
|
|
15963
|
+
this._private__data = data;
|
|
15964
|
+
}
|
|
15965
|
+
zOrder() {
|
|
15966
|
+
return 'top';
|
|
15967
|
+
}
|
|
15968
|
+
renderer() {
|
|
15969
|
+
return new TimeLabelsRenderer(this._private__data);
|
|
15970
|
+
}
|
|
15971
|
+
}
|
|
15972
|
+
class TimeLabelsPrimitive {
|
|
15973
|
+
constructor(options) {
|
|
15974
|
+
this._private__chart = null;
|
|
15975
|
+
this._private__requestUpdate = null;
|
|
15976
|
+
this._private__labels = [];
|
|
15977
|
+
this._private__paneView = new TimeLabelsPaneView();
|
|
15978
|
+
this._private__options = { ...timeLabelsOptionsDefaults, ...options };
|
|
15979
|
+
}
|
|
15980
|
+
attached(param) {
|
|
15981
|
+
this._private__chart = param.chart;
|
|
15982
|
+
this._private__requestUpdate = param.requestUpdate;
|
|
15983
|
+
this._private__requestUpdate();
|
|
15984
|
+
}
|
|
15985
|
+
detached() {
|
|
15986
|
+
this._private__chart = null;
|
|
15987
|
+
this._private__requestUpdate = null;
|
|
15988
|
+
}
|
|
15989
|
+
_internal_setLabels(labels) {
|
|
15990
|
+
this._private__labels = labels.slice();
|
|
15991
|
+
this._private__requestUpdate?.();
|
|
15992
|
+
}
|
|
15993
|
+
_internal_labels() {
|
|
15994
|
+
return this._private__labels;
|
|
15995
|
+
}
|
|
15996
|
+
_internal_applyOptions(options) {
|
|
15997
|
+
this._private__options = { ...this._private__options, ...options };
|
|
15998
|
+
this._private__requestUpdate?.();
|
|
15999
|
+
}
|
|
16000
|
+
updateAllViews() {
|
|
16001
|
+
const chart = this._private__chart;
|
|
16002
|
+
const options = this._private__options;
|
|
16003
|
+
if (chart === null) {
|
|
16004
|
+
this._private__paneView._internal_update({ _internal_items: [], _internal_position: options.position, _internal_offset: options.offset });
|
|
16005
|
+
return;
|
|
16006
|
+
}
|
|
16007
|
+
const timeScale = chart.timeScale();
|
|
16008
|
+
const family = options.fontFamily || chart.options().layout.fontFamily;
|
|
16009
|
+
const items = [];
|
|
16010
|
+
for (const label of this._private__labels) {
|
|
16011
|
+
const x = timeScale.timeToCoordinate(label.time);
|
|
16012
|
+
if (x === null) {
|
|
16013
|
+
continue;
|
|
16014
|
+
}
|
|
16015
|
+
items.push({
|
|
16016
|
+
_internal_x: x,
|
|
16017
|
+
_internal_text: label.text,
|
|
16018
|
+
_internal_color: label.color ?? options.color,
|
|
16019
|
+
_internal_font: makeFont(label.size ?? options.fontSize, family),
|
|
16020
|
+
});
|
|
16021
|
+
}
|
|
16022
|
+
this._private__paneView._internal_update({ _internal_items: items, _internal_position: options.position, _internal_offset: options.offset });
|
|
16023
|
+
}
|
|
16024
|
+
paneViews() {
|
|
16025
|
+
return [this._private__paneView];
|
|
16026
|
+
}
|
|
16027
|
+
}
|
|
16028
|
+
|
|
16029
|
+
class TimeLabelsPrimitiveWrapper extends SeriesPrimitiveAdapter {
|
|
16030
|
+
setLabels(labels) {
|
|
16031
|
+
this._internal__primitive._internal_setLabels(labels);
|
|
16032
|
+
}
|
|
16033
|
+
labels() {
|
|
16034
|
+
return this._internal__primitive._internal_labels();
|
|
16035
|
+
}
|
|
16036
|
+
}
|
|
16037
|
+
function createTimeLabels(series, labels, options) {
|
|
16038
|
+
const wrapper = new TimeLabelsPrimitiveWrapper(series, new TimeLabelsPrimitive(options));
|
|
16039
|
+
if (labels) {
|
|
16040
|
+
wrapper.setLabels(labels);
|
|
16041
|
+
}
|
|
16042
|
+
return wrapper;
|
|
16043
|
+
}
|
|
16044
|
+
|
|
15924
16045
|
class PositionMarkersManager {
|
|
15925
16046
|
constructor(series, options) {
|
|
15926
16047
|
this._private__markersPlugin = null;
|
|
@@ -20609,8 +20730,11 @@ class PositionLineLabelLayout {
|
|
|
20609
20730
|
* move — which is invisible, and cheaper than forcing a second pass.
|
|
20610
20731
|
*/
|
|
20611
20732
|
_internal_setClaims(ownerId, claims) {
|
|
20733
|
+
const previous = this._private__claims.get(ownerId);
|
|
20612
20734
|
this._private__claims.set(ownerId, claims);
|
|
20613
|
-
|
|
20735
|
+
if (previous === undefined || !sameClaims(previous, claims)) {
|
|
20736
|
+
this._private__invalidated = true;
|
|
20737
|
+
}
|
|
20614
20738
|
}
|
|
20615
20739
|
/** How far down a label has to move to clear the ones already placed. */
|
|
20616
20740
|
_internal_offsetFor(ownerId, level) {
|
|
@@ -20631,7 +20755,10 @@ class PositionLineLabelLayout {
|
|
|
20631
20755
|
// them only need the few pixels they are short of — stepping by a
|
|
20632
20756
|
// full gap each time is what made the fan look flung open.
|
|
20633
20757
|
let y = claim._internal_y;
|
|
20634
|
-
for (const other of
|
|
20758
|
+
for (const other of placed) {
|
|
20759
|
+
if (other._internal_y >= y + gap) {
|
|
20760
|
+
break;
|
|
20761
|
+
}
|
|
20635
20762
|
if (Math.abs(y - other._internal_y) < gap) {
|
|
20636
20763
|
y = other._internal_y + gap;
|
|
20637
20764
|
}
|
|
@@ -20642,7 +20769,7 @@ class PositionLineLabelLayout {
|
|
|
20642
20769
|
// no worse than before and keeps the pile from running off.
|
|
20643
20770
|
offset = 0;
|
|
20644
20771
|
}
|
|
20645
|
-
placed
|
|
20772
|
+
insertByY(placed, { _internal_y: claim._internal_y + offset, _internal_height: claim._internal_height });
|
|
20646
20773
|
offsets.set(key(ownerId, claim._internal_level), offset);
|
|
20647
20774
|
}
|
|
20648
20775
|
}
|
|
@@ -20660,8 +20787,30 @@ function key(ownerId, level) {
|
|
|
20660
20787
|
function minGap(height) {
|
|
20661
20788
|
return Math.max(9, Math.round(height * 0.4));
|
|
20662
20789
|
}
|
|
20663
|
-
function
|
|
20664
|
-
|
|
20790
|
+
function insertByY(placed, claim) {
|
|
20791
|
+
let low = 0;
|
|
20792
|
+
let high = placed.length;
|
|
20793
|
+
while (low < high) {
|
|
20794
|
+
const middle = (low + high) >> 1;
|
|
20795
|
+
if (placed[middle]._internal_y <= claim._internal_y) {
|
|
20796
|
+
low = middle + 1;
|
|
20797
|
+
}
|
|
20798
|
+
else {
|
|
20799
|
+
high = middle;
|
|
20800
|
+
}
|
|
20801
|
+
}
|
|
20802
|
+
placed.splice(low, 0, claim);
|
|
20803
|
+
}
|
|
20804
|
+
function sameClaims(a, b) {
|
|
20805
|
+
if (a.length !== b.length) {
|
|
20806
|
+
return false;
|
|
20807
|
+
}
|
|
20808
|
+
for (let i = 0; i < a.length; i++) {
|
|
20809
|
+
if (a[i]._internal_level !== b[i]._internal_level || a[i]._internal_y !== b[i]._internal_y || a[i]._internal_height !== b[i]._internal_height) {
|
|
20810
|
+
return false;
|
|
20811
|
+
}
|
|
20812
|
+
}
|
|
20813
|
+
return true;
|
|
20665
20814
|
}
|
|
20666
20815
|
const layouts = new WeakMap();
|
|
20667
20816
|
/** The layout is shared by every position line on the same chart. */
|
|
@@ -21016,6 +21165,7 @@ class PositionLine {
|
|
|
21016
21165
|
constructor(chart, series, options) {
|
|
21017
21166
|
this._private__paneView = new PositionLinePaneView();
|
|
21018
21167
|
this._private__colorParser = new ColorParser([]);
|
|
21168
|
+
this._private__axisLabels = new Map();
|
|
21019
21169
|
this._private__attached = false;
|
|
21020
21170
|
this._private__hoveredLevel = null;
|
|
21021
21171
|
this._private__hoveredPart = null;
|
|
@@ -21307,12 +21457,22 @@ class PositionLine {
|
|
|
21307
21457
|
return null;
|
|
21308
21458
|
}
|
|
21309
21459
|
const color = options.color ?? positionLineDefaultColors[level];
|
|
21310
|
-
|
|
21460
|
+
const formatter = this._private__series.priceFormatter();
|
|
21461
|
+
const cached = this._private__axisLabels.get(level);
|
|
21462
|
+
if (cached !== undefined && cached._internal_price === options.price && cached._internal_color === color && cached._internal_formatter === formatter) {
|
|
21463
|
+
if (cached._internal_label._internal_coordinate !== y) {
|
|
21464
|
+
cached._internal_label = { ...cached._internal_label, _internal_coordinate: y };
|
|
21465
|
+
}
|
|
21466
|
+
return cached._internal_label;
|
|
21467
|
+
}
|
|
21468
|
+
const label = {
|
|
21311
21469
|
_internal_coordinate: y,
|
|
21312
|
-
_internal_text:
|
|
21470
|
+
_internal_text: formatter.format(options.price),
|
|
21313
21471
|
_internal_color: color,
|
|
21314
21472
|
_internal_textColor: this._private__colorParser._internal_generateContrastColors(color)._internal_foreground,
|
|
21315
21473
|
};
|
|
21474
|
+
this._private__axisLabels.set(level, { _internal_price: options.price, _internal_color: color, _internal_formatter: formatter, _internal_label: label });
|
|
21475
|
+
return label;
|
|
21316
21476
|
}
|
|
21317
21477
|
_private__levelOptions(level) {
|
|
21318
21478
|
const options = level === 'entry' ? this._private__options.entry : this._private__options[level];
|
|
@@ -31443,7 +31603,7 @@ const customSeriesDefaultOptions = {
|
|
|
31443
31603
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
31444
31604
|
*/
|
|
31445
31605
|
function version() {
|
|
31446
|
-
return "2.3.
|
|
31606
|
+
return "2.3.18-dev+202610170141";
|
|
31447
31607
|
}
|
|
31448
31608
|
|
|
31449
|
-
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, PositionLine, 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, createPositionLine, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, hideSeriesPaint, isBusinessDay, isUTCTimestamp, setSeriesVolumes, setVolumeProfileData, timeFromCoordinate, version };
|
|
31609
|
+
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, PositionLine, 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, createPositionLine, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTimeLabels, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, hideSeriesPaint, isBusinessDay, isUTCTimestamp, setSeriesVolumes, setVolumeProfileData, timeFromCoordinate, version };
|