@pipsend/charts 2.3.1 → 2.3.2

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.1
3
+ * Pipsend Charts v2.3.2
4
4
  * Copyright (c) 2026 Pipsend
5
5
  * Licensed under MIT License
6
6
  * Built on TradingView Lightweight Charts™ (Apache 2.0)
@@ -27190,7 +27190,7 @@ class BrushTool extends DrawingToolBase {
27190
27190
  if (this._private__isOverAnotherDrawing()) {
27191
27191
  return;
27192
27192
  }
27193
- const point = this._private__toPanePoint(event);
27193
+ const point = this._private__toPanePoint(event, false);
27194
27194
  if (point === null) {
27195
27195
  return;
27196
27196
  }
@@ -27209,7 +27209,7 @@ class BrushTool extends DrawingToolBase {
27209
27209
  if (!this._private__isDrawing) {
27210
27210
  return;
27211
27211
  }
27212
- const point = this._private__toPanePoint(event);
27212
+ const point = this._private__toPanePoint(event, true);
27213
27213
  if (point === null) {
27214
27214
  return;
27215
27215
  }
@@ -27280,13 +27280,51 @@ class BrushTool extends DrawingToolBase {
27280
27280
  }
27281
27281
  this._private__pointerId = null;
27282
27282
  }
27283
- _private__toPanePoint(event) {
27283
+ /**
27284
+ * Where a press lands relative to the drawing area, or null if it lands
27285
+ * outside it. `clamp` pins the point to the edge instead, for a stroke that
27286
+ * is already under way.
27287
+ */
27288
+ _private__toPanePoint(event, clamp) {
27289
+ const area = this._private__drawArea();
27290
+ if (area === null) {
27291
+ return null;
27292
+ }
27293
+ const x = event.clientX - area._internal_left;
27294
+ const y = event.clientY - area._internal_top;
27295
+ if (clamp) {
27296
+ return {
27297
+ _internal_x: Math.max(0, Math.min(area._internal_width, x)),
27298
+ _internal_y: Math.max(0, Math.min(area._internal_height, y)),
27299
+ };
27300
+ }
27301
+ if (x < 0 || x > area._internal_width || y < 0 || y > area._internal_height) {
27302
+ return null;
27303
+ }
27304
+ return { _internal_x: x, _internal_y: y };
27305
+ }
27306
+ /**
27307
+ * The pane's element is the whole row, price axis cells included, so its
27308
+ * bounds are not the drawing area's. Taking them for it is what let a press
27309
+ * on an axis start a stroke — and be swallowed, leaving the chart unable to
27310
+ * be stretched while the brush was armed.
27311
+ */
27312
+ _private__drawArea() {
27284
27313
  const paneElement = this._private__paneElement();
27285
27314
  if (paneElement === null) {
27286
27315
  return null;
27287
27316
  }
27288
27317
  const rect = paneElement.getBoundingClientRect();
27289
- return { _internal_x: event.clientX - rect.left, _internal_y: event.clientY - rect.top };
27318
+ let left = 0;
27319
+ let width = rect.width;
27320
+ // The time scale measures the drawing area; the left axis, when shown, is
27321
+ // what stands between it and the row's edge.
27322
+ const paneWidth = this._chart.timeScale().width();
27323
+ if (paneWidth > 0) {
27324
+ left = this._chart.priceScale('left').width();
27325
+ width = paneWidth;
27326
+ }
27327
+ return { _internal_left: rect.left + left, _internal_top: rect.top, _internal_width: width, _internal_height: rect.height };
27290
27328
  }
27291
27329
  _private__paneElement() {
27292
27330
  try {
@@ -30645,7 +30683,7 @@ const customSeriesDefaultOptions = {
30645
30683
  * Returns the current version as a string. For example `'1.0.0'`.
30646
30684
  */
30647
30685
  function version() {
30648
- return "2.3.1";
30686
+ return "2.3.2";
30649
30687
  }
30650
30688
 
30651
30689
  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 };