openalgo-charts 1.0.24 → 1.0.26
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
|
|
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
|
|
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 {
|
|
@@ -1061,7 +1069,7 @@ declare class PriceLine implements IPrimitive {
|
|
|
1061
1069
|
}
|
|
1062
1070
|
|
|
1063
1071
|
/**
|
|
1064
|
-
* Pane legend (ARCHITECTURE.md §8) — the
|
|
1072
|
+
* Pane legend (ARCHITECTURE.md §8) — the row at the top-left
|
|
1065
1073
|
* of a pane: a color swatch, the source's name, its parameters, the value under
|
|
1066
1074
|
* the crosshair, and inline action buttons on the right.
|
|
1067
1075
|
*
|
|
@@ -1808,7 +1816,7 @@ interface ChartOptions {
|
|
|
1808
1816
|
*/
|
|
1809
1817
|
timeFormatter?: (utcSeconds: number, tickMark?: TickMarkType) => string;
|
|
1810
1818
|
/**
|
|
1811
|
-
* Hover-revealed zoom / step controls above the time axis
|
|
1819
|
+
* Hover-revealed zoom / step controls above the time axis, as terminals show.
|
|
1812
1820
|
* `true` by default — they stay invisible until the pointer nears the bottom
|
|
1813
1821
|
* of the chart. Pass `false` to drop them, or an options object to restyle.
|
|
1814
1822
|
*/
|
|
@@ -2507,6 +2515,19 @@ interface LogoWatermarkOptions {
|
|
|
2507
2515
|
borderColor?: string;
|
|
2508
2516
|
/** Plate corner radius in media px. Default 6. */
|
|
2509
2517
|
radius?: number;
|
|
2518
|
+
/**
|
|
2519
|
+
* Plate padding around the lockup, in media px. A number pads both axes;
|
|
2520
|
+
* `{ x, y }` pads them separately. Default `{ x: 7, y: 4 }`, which keeps the
|
|
2521
|
+
* revealed label clear of the plate edge.
|
|
2522
|
+
*
|
|
2523
|
+
* Use it to size the resting plate exactly: a 40px mark with `padding: 2.5`
|
|
2524
|
+
* sits in a 45x45 square. The plate widens as the label unrolls; the padding
|
|
2525
|
+
* is what stays constant.
|
|
2526
|
+
*/
|
|
2527
|
+
padding?: number | {
|
|
2528
|
+
x: number;
|
|
2529
|
+
y: number;
|
|
2530
|
+
};
|
|
2510
2531
|
/**
|
|
2511
2532
|
* Where the mark points. A canvas cannot hold an anchor, so this only marks
|
|
2512
2533
|
* it as clickable — the hit reports a pointer cursor, and the host opens
|
|
@@ -2574,7 +2595,7 @@ declare class LogoWatermark implements IPrimitive {
|
|
|
2574
2595
|
}
|
|
2575
2596
|
|
|
2576
2597
|
/**
|
|
2577
|
-
* Inline Buy/Sell button panel (ARCHITECTURE.md §9).
|
|
2598
|
+
* Inline Buy/Sell button panel (ARCHITECTURE.md §9). An on-chart trade
|
|
2578
2599
|
* panel docked inside the plot: a SELL button (bid), a quantity chip, and a BUY
|
|
2579
2600
|
* button (ask), drawn on the overlay canvas so it stays fixed while the chart
|
|
2580
2601
|
* pans/zooms. Clicks hit-test to `${id}:sell` / `${id}:buy` / `${id}:qty`, which
|