hyperprop-charting-library 0.1.127 → 0.1.128

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,3 +1,12 @@
1
+ /**
2
+ * Main series rendering style. "candles" is the classic filled candlestick;
3
+ * "hollow-candles" strokes up-closing bodies instead of filling them;
4
+ * "heikin-ashi" renders smoothed HA candles derived from the raw OHLC series
5
+ * (indicators, drawings, order lines and the ticker line keep using raw
6
+ * prices); "bars" is OHLC bars; "line"/"area" plot closes; "baseline" splits
7
+ * the close line around `baselinePrice` (up/down colored halves).
8
+ */
9
+ type ChartType = "candles" | "hollow-candles" | "heikin-ashi" | "bars" | "line" | "area" | "baseline";
1
10
  interface ChartOptions {
2
11
  width?: number;
3
12
  height?: number;
@@ -27,6 +36,19 @@ interface ChartOptions {
27
36
  tickSize?: number;
28
37
  candleColorMode?: "openClose" | "prevClose";
29
38
  candleColorEpsilon?: number;
39
+ /** Main series style. Defaults to "candles". */
40
+ chartType?: ChartType;
41
+ /** Stroke color for "line" and "area" chart types. */
42
+ lineColor?: string;
43
+ /** Stroke width for "line", "area" and "baseline" chart types. */
44
+ lineWidth?: number;
45
+ /** Fill opacity under the line for the "area" chart type. */
46
+ areaFillOpacity?: number;
47
+ /**
48
+ * Anchor price for the "baseline" chart type. null (default) anchors to the
49
+ * midpoint of the visible price range, matching TradingView's default.
50
+ */
51
+ baselinePrice?: number | null;
30
52
  autoScaleSmoothing?: number;
31
53
  autoScaleIgnoreLatestCandle?: boolean;
32
54
  /**
@@ -460,6 +482,9 @@ interface LabelsOptions {
460
482
  }
461
483
  interface ChartInstance {
462
484
  updateOptions: (options: ChartOptions) => void;
485
+ /** Switch the main series rendering style (candles, bars, line, ...). */
486
+ setChartType: (type: ChartType) => void;
487
+ getChartType: () => ChartType;
463
488
  setData: (data: OhlcDataPoint[]) => void;
464
489
  /**
465
490
  * Incrementally upsert a single bar: O(1) update-in-place for the live
@@ -547,4 +572,4 @@ interface ViewportState {
547
572
  }
548
573
  declare function createChart(element: HTMLElement, options?: ChartOptions): ChartInstance;
549
574
 
550
- export { type AxisOptions, type BuiltInIndicatorInfo, type ChartClickEvent, type ChartInstance, type ChartOptions, type CrosshairMoveEvent, type CrosshairOptions, type CrosshairPriceActionEvent, type DashPatternOptions, type DrawingDefaults, type DrawingHoverEvent, type DrawingObjectOptions, type DrawingPoint, type DrawingSelectEvent, type DrawingToolType, FIB_DEFAULT_PALETTE, type GridOptions, type IndicatorInstanceOptions, type IndicatorPane, type IndicatorPaneAxisOptions, type IndicatorPaneGuideLine, type IndicatorPaneRenderInfo, type IndicatorPaneValue, type IndicatorPaneValueLabel, type IndicatorPlugin, type IndicatorRenderContext, type LabelsOptions, type OhlcDataPoint, type OrderActionButton, type OrderActionEvent, type OrderLineOptions, POSITION_DEFAULT_COLORS, type PriceLineOptions, type TickerLineOptions, type TradeMarkerOptions, type ViewportState, type WatermarkOptions, createChart };
575
+ export { type AxisOptions, type BuiltInIndicatorInfo, type ChartClickEvent, type ChartInstance, type ChartOptions, type ChartType, type CrosshairMoveEvent, type CrosshairOptions, type CrosshairPriceActionEvent, type DashPatternOptions, type DrawingDefaults, type DrawingHoverEvent, type DrawingObjectOptions, type DrawingPoint, type DrawingSelectEvent, type DrawingToolType, FIB_DEFAULT_PALETTE, type GridOptions, type IndicatorInstanceOptions, type IndicatorPane, type IndicatorPaneAxisOptions, type IndicatorPaneGuideLine, type IndicatorPaneRenderInfo, type IndicatorPaneValue, type IndicatorPaneValueLabel, type IndicatorPlugin, type IndicatorRenderContext, type LabelsOptions, type OhlcDataPoint, type OrderActionButton, type OrderActionEvent, type OrderLineOptions, POSITION_DEFAULT_COLORS, type PriceLineOptions, type TickerLineOptions, type TradeMarkerOptions, type ViewportState, type WatermarkOptions, createChart };