openalgo-charts 1.0.25 → 1.0.27

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/README.md CHANGED
@@ -102,7 +102,7 @@ draw.setTool('trend-line'); // the next two clicks place it
102
102
  Headless by design — no toolbar, no dialogs. Placement with live preview, selection, whole-shape and per-anchor dragging, magnet snap to O/H/L/C, undo/redo (a drag is one step), and persistence. Anchors are `{ time, price }`, never pixels, so they survive zoom and resolve inside collapsed session gaps and past the last bar.
103
103
 
104
104
  ### Panes & legends
105
- Draggable pane dividers, move / maximize / remove, and TradingView-style pane legends showing one reading per plot in that plot's own colour, with inline show-hide / settings / move / delete controls revealed on hover.
105
+ Draggable pane dividers, move / maximize / remove, and pane legends showing one reading per plot in that plot's own colour, with inline show-hide / settings / move / delete controls revealed on hover.
106
106
 
107
107
  ### Trading
108
108
  Order, position, and bracket lines with live P&L, one-click and drag-to-modify, OCO, validation, an order state machine, analyzer (sandbox) mode, and a depth-of-market ladder (5 to 200 levels).
@@ -145,7 +145,7 @@ cd website && npm install && npm run dev # http://localhost:3000/openalgo-cha
145
145
 
146
146
  ## Examples
147
147
 
148
- Runnable demos in [`examples/`](./examples), including a full **yfinance terminal** ([`examples/yfinance`](./examples/yfinance)) with a TradingView-style shell: symbol search, interval pills, chart-type picker, indicator menu, a vertical drawing rail, a floating properties bar, generated indicator settings, and layout persistence.
148
+ Runnable demos in [`examples/`](./examples), including a full **yfinance terminal** ([`examples/yfinance`](./examples/yfinance)) with a full terminal shell: symbol search, interval pills, chart-type picker, indicator menu, a vertical drawing rail, a floating properties bar, generated indicator settings, and layout persistence.
149
149
 
150
150
  ```bash
151
151
  npm run build
package/dist/index.d.ts CHANGED
@@ -128,6 +128,14 @@ declare const DEFAULT_PRICE_SCALE_OPTIONS: PriceScaleOptions;
128
128
  /**
129
129
  * Pure: compute a price range from data extremes plus top/bottom margins.
130
130
  * Returns a padded [min,max]; widens a degenerate (flat) range so it's drawable.
131
+ *
132
+ * The margins are fractions of the **pane height**, so the data band occupies
133
+ * the `1 - marginTop - marginBottom` left between them. Padding the data span
134
+ * by the margin instead — which is what this did — makes the reserved space
135
+ * depend on how tall the data happens to be: an overlay asking for `0.82` to
136
+ * sit in the bottom 18% got `high + 0.82 * span`, leaving its bars 55% of the
137
+ * pane. The difference only shows at large margins; at the 0.1 default the two
138
+ * readings land within a few percent of each other.
131
139
  */
132
140
  declare function autoscaleRange(low: number, high: number, marginTop: number, marginBottom: number): PriceRange;
133
141
  declare class PriceScale {
@@ -1045,6 +1053,16 @@ declare class PriceLine implements IPrimitive {
1045
1053
  setPrice(price: number): void;
1046
1054
  /** Update the info segment text (e.g. live position P&L); repaints. */
1047
1055
  setLeftLabel(text: string): void;
1056
+ /**
1057
+ * Restyle in place; repaints. `id` is the hit-test handle the chart routes
1058
+ * clicks and drags through, so it is not patchable — swapping it under a
1059
+ * live drag would strand the gesture.
1060
+ *
1061
+ * A last-price line is the case this exists for: it has to follow the tick
1062
+ * direction, and only `setPrice` was updatable, so the colour was stuck at
1063
+ * whatever it was constructed with.
1064
+ */
1065
+ setOptions(patch: Partial<Omit<PriceLineOptions, 'id'>>): void;
1048
1066
  /**
1049
1067
  * Show a dimmed reference line at the pre-drag price while the user drags
1050
1068
  * (pass the original price on drag start, null on drag end to clear).
@@ -1061,7 +1079,7 @@ declare class PriceLine implements IPrimitive {
1061
1079
  }
1062
1080
 
1063
1081
  /**
1064
- * Pane legend (ARCHITECTURE.md §8) — the TradingView-style row at the top-left
1082
+ * Pane legend (ARCHITECTURE.md §8) — the row at the top-left
1065
1083
  * of a pane: a color swatch, the source's name, its parameters, the value under
1066
1084
  * the crosshair, and inline action buttons on the right.
1067
1085
  *
@@ -1808,7 +1826,7 @@ interface ChartOptions {
1808
1826
  */
1809
1827
  timeFormatter?: (utcSeconds: number, tickMark?: TickMarkType) => string;
1810
1828
  /**
1811
- * Hover-revealed zoom / step controls above the time axis (TradingView-style).
1829
+ * Hover-revealed zoom / step controls above the time axis, as terminals show.
1812
1830
  * `true` by default — they stay invisible until the pointer nears the bottom
1813
1831
  * of the chart. Pass `false` to drop them, or an options object to restyle.
1814
1832
  */
@@ -2587,7 +2605,7 @@ declare class LogoWatermark implements IPrimitive {
2587
2605
  }
2588
2606
 
2589
2607
  /**
2590
- * Inline Buy/Sell button panel (ARCHITECTURE.md §9). A TradingView-style trade
2608
+ * Inline Buy/Sell button panel (ARCHITECTURE.md §9). An on-chart trade
2591
2609
  * panel docked inside the plot: a SELL button (bid), a quantity chip, and a BUY
2592
2610
  * button (ask), drawn on the overlay canvas so it stays fixed while the chart
2593
2611
  * pans/zooms. Clicks hit-test to `${id}:sell` / `${id}:buy` / `${id}:qty`, which