@pipsend/charts 2.3.17 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @license
3
- * Pipsend Charts v2.3.17-dev+202610130113
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;
@@ -31485,7 +31606,7 @@
31485
31606
  * Returns the current version as a string. For example `'1.0.0'`.
31486
31607
  */
31487
31608
  function version() {
31488
- return "2.3.17-dev+202610130113";
31609
+ return "2.3.18-dev+202610170141";
31489
31610
  }
31490
31611
 
31491
31612
  var PipsendChartsModule = /*#__PURE__*/Object.freeze({
@@ -31587,6 +31708,7 @@
31587
31708
  createSeriesMarkers: createSeriesMarkers,
31588
31709
  createTextTool: createTextTool,
31589
31710
  createTextWatermark: createTextWatermark,
31711
+ createTimeLabels: createTimeLabels,
31590
31712
  createTradingLine: createTradingLine,
31591
31713
  createTradingSessionsIndicator: createTradingSessionsIndicator,
31592
31714
  createTrendLineTool: createTrendLineTool,
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @license
3
- * Pipsend Charts v2.3.17-dev+202610130113
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;
@@ -31482,7 +31603,7 @@ const customSeriesDefaultOptions = {
31482
31603
  * Returns the current version as a string. For example `'1.0.0'`.
31483
31604
  */
31484
31605
  function version() {
31485
- return "2.3.17-dev+202610130113";
31606
+ return "2.3.18-dev+202610170141";
31486
31607
  }
31487
31608
 
31488
- 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 };