@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/dist/typings.d.ts CHANGED
@@ -15,6 +15,7 @@ declare abstract class DrawingToolBase implements IDrawingTool {
15
15
  private _generateId;
16
16
  get id(): string;
17
17
  get type(): string;
18
+ isComplete(): boolean;
18
19
  /**
19
20
  * Lets a tool hand the base its own options object, once, in the constructor.
20
21
  *
@@ -139,6 +140,7 @@ export declare class ArrowTool extends DrawingToolBase {
139
140
  protected _serializeShape(): SerializedDrawingTool;
140
141
  private _requestUpdate;
141
142
  protected _update(): void;
143
+ isComplete(): boolean;
142
144
  remove(): void;
143
145
  }
144
146
  /**
@@ -258,6 +260,7 @@ export declare class CircleTool extends DrawingToolBase {
258
260
  protected _serializeShape(): SerializedDrawingTool;
259
261
  private _requestUpdate;
260
262
  protected _update(): void;
263
+ isComplete(): boolean;
261
264
  remove(): void;
262
265
  }
263
266
  /**
@@ -384,6 +387,9 @@ export declare class DrawingToolsManager {
384
387
  private readonly _selectionChanged;
385
388
  private _isDragging;
386
389
  private _draggedToolId;
390
+ private _pendingToolIds;
391
+ private _completionCheck;
392
+ private readonly _drawingCompleted;
387
393
  constructor(chart: IChartApi, series: ISeriesApi<any>, options?: DrawingToolsManagerOptions);
388
394
  /**
389
395
  * Start drawing a new tool of the specified type
@@ -404,6 +410,12 @@ export declare class DrawingToolsManager {
404
410
  * were different, and neither survived a restore.
405
411
  */
406
412
  addTool(tool: DrawingToolBase, id?: string): string;
413
+ hasPendingDrawing(): boolean;
414
+ /** Removes every tool still waiting for points; returns how many were dropped. */
415
+ cancelPendingDrawings(): number;
416
+ subscribeDrawingCompleted(handler: (toolId: string) => void): void;
417
+ unsubscribeDrawingCompleted(handler: (toolId: string) => void): void;
418
+ private _scheduleCompletionCheck;
407
419
  /**
408
420
  * Remove a tool by ID
409
421
  */
@@ -687,6 +699,7 @@ export declare class FibonacciFanTool extends DrawingToolBase {
687
699
  protected _serializeShape(): SerializedDrawingTool;
688
700
  private _requestUpdate;
689
701
  protected _update(): void;
702
+ isComplete(): boolean;
690
703
  remove(): void;
691
704
  }
692
705
  export declare class FibonacciTool extends DrawingToolBase {
@@ -747,6 +760,7 @@ export declare class FibonacciTool extends DrawingToolBase {
747
760
  */
748
761
  private _hitTestPrimitive;
749
762
  hitTest(x: number, y: number): boolean;
763
+ isComplete(): boolean;
750
764
  remove(): void;
751
765
  destroy(): void;
752
766
  private _requestUpdate;
@@ -933,6 +947,7 @@ export declare class ParallelChannelTool extends DrawingToolBase {
933
947
  isSelected(): boolean;
934
948
  setHovered(hovered: boolean): void;
935
949
  isHovered(): boolean;
950
+ isComplete(): boolean;
936
951
  remove(): void;
937
952
  protected _serializeShape(): SerializedDrawingTool;
938
953
  }
@@ -990,6 +1005,7 @@ export declare class PitchforkTool extends DrawingToolBase {
990
1005
  isSelected(): boolean;
991
1006
  setHovered(hovered: boolean): void;
992
1007
  isHovered(): boolean;
1008
+ isComplete(): boolean;
993
1009
  remove(): void;
994
1010
  protected _serializeShape(): SerializedDrawingTool;
995
1011
  }
@@ -1051,6 +1067,7 @@ export declare class PolygonTool extends DrawingToolBase {
1051
1067
  isHovered(): boolean;
1052
1068
  /** The corners, for callers that need the shape rather than its picture. */
1053
1069
  points(): readonly PolygonVertex[];
1070
+ isComplete(): boolean;
1054
1071
  remove(): void;
1055
1072
  protected _serializeShape(): SerializedDrawingTool;
1056
1073
  }
@@ -1269,6 +1286,7 @@ export declare class RectangleTool extends DrawingToolBase {
1269
1286
  protected _serializeShape(): SerializedDrawingTool;
1270
1287
  private _requestUpdate;
1271
1288
  protected _update(): void;
1289
+ isComplete(): boolean;
1272
1290
  remove(): void;
1273
1291
  }
1274
1292
  export declare class RulerCalculator {
@@ -1495,6 +1513,7 @@ export declare class TrendLineTool extends DrawingToolBase {
1495
1513
  private _dragStartPoint1;
1496
1514
  private _dragStartPoint2;
1497
1515
  private _isComplete;
1516
+ private _interactive;
1498
1517
  private _previewPoint;
1499
1518
  constructor(context: DrawingContext, options: TrendLineToolOptions);
1500
1519
  private _initializeInteractiveMode;
@@ -1543,6 +1562,7 @@ export declare class TrendLineTool extends DrawingToolBase {
1543
1562
  protected _serializeShape(): SerializedDrawingTool;
1544
1563
  private _requestUpdate;
1545
1564
  protected _update(): void;
1565
+ isComplete(): boolean;
1546
1566
  remove(): void;
1547
1567
  }
1548
1568
  export declare class VerticalLineTool extends DrawingToolBase {
@@ -1906,9 +1926,9 @@ export declare function applyEMA(series: ISeriesApi<SeriesType>, chart: IChartAp
1906
1926
  * Draw a source series as Heikin Ashi candles.
1907
1927
  *
1908
1928
  * The source series is left in place holding its real prices — it is only
1909
- * hidden — so indicators bound to it keep computing on the true OHLC, and
1910
- * `remove()` puts the chart back exactly as it was. That makes this usable as a
1911
- * chart-type toggle:
1929
+ * painted transparent — so indicators bound to it keep computing on the true
1930
+ * OHLC, its price lines and primitives stay on screen, and `remove()` puts the
1931
+ * chart back exactly as it was. That makes this usable as a chart-type toggle:
1912
1932
  *
1913
1933
  * ```js
1914
1934
  * const ha = applyHeikinAshi(candleSeries, chart);
@@ -2474,6 +2494,21 @@ export declare function defaultHorzScaleBehavior(): new () => IHorzScaleBehavior
2474
2494
  * Now ignores symbol and uses price-based detection
2475
2495
  */
2476
2496
  export declare function getPipConfig(symbolOrPrice: string | number, price?: number): PipConfig;
2497
+ /**
2498
+ * Take a series off the screen without hiding it.
2499
+ *
2500
+ * `visible: false` takes down everything hung off the series as well: its
2501
+ * price lines, primitives and price-axis label stop rendering. A transform
2502
+ * that only wants the bars themselves out of the way — Heikin Ashi drawing
2503
+ * over its source — needs the series to stay visible to the engine, so its
2504
+ * paint is made transparent instead and the last-value label and price line
2505
+ * are switched off. Custom series have no known colours; those fall back to
2506
+ * `visible: false`.
2507
+ *
2508
+ * @param series - Series to blank out.
2509
+ * @returns Puts back the options the series had when it was blanked.
2510
+ */
2511
+ export declare function hideSeriesPaint(series: ISeriesApi<SeriesType>): () => void;
2477
2512
  /**
2478
2513
  * Check if a time value is a business day object.
2479
2514
  *
@@ -3680,8 +3715,11 @@ export interface HeikinAshiOptions {
3680
3715
  /** Wick color of falling candles. */
3681
3716
  wickDownColor?: string;
3682
3717
  /**
3683
- * Hide the source series while the Heikin Ashi candles are shown, so the two
3684
- * do not overlap. The original visibility is restored by `remove()`.
3718
+ * Blank out the source series while the Heikin Ashi candles are shown, so
3719
+ * the two do not overlap. The source is painted transparent rather than
3720
+ * hidden: it stays visible to the engine, so its price lines, primitives
3721
+ * and everything else hung off it keep rendering. `remove()` puts its paint
3722
+ * back.
3685
3723
  *
3686
3724
  * @defaultValue `true`
3687
3725
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.0",
2
+ "version": "2.2.1",
3
3
  "name": "@pipsend/charts",
4
4
  "author": "Pipsend",
5
5
  "license": "SEE LICENSE IN LICENSE",