openalgo-charts 1.0.23 → 1.0.24
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/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Library version string. Matches package.json (published npm release). */
|
|
2
|
-
declare const VERSION = "1.0.
|
|
2
|
+
declare const VERSION = "1.0.24";
|
|
3
3
|
/** Returns the current library version. */
|
|
4
4
|
declare function version(): string;
|
|
5
5
|
|
|
@@ -2482,6 +2482,45 @@ interface LogoWatermarkOptions {
|
|
|
2482
2482
|
tint?: string;
|
|
2483
2483
|
/** Layer order vs the series. Default `top`. */
|
|
2484
2484
|
zOrder?: ZOrder;
|
|
2485
|
+
/**
|
|
2486
|
+
* Text revealed to the right of the mark on hover — "Chart by OpenAlgo".
|
|
2487
|
+
* The mark alone is what sits on the chart at rest; the wording is only
|
|
2488
|
+
* needed when someone looks at it, so it unrolls rather than occupying the
|
|
2489
|
+
* corner permanently. Omit for a plain, non-interactive mark.
|
|
2490
|
+
*/
|
|
2491
|
+
label?: string;
|
|
2492
|
+
/** Hit-test id, so the chart can report hover. Default `watermark`. */
|
|
2493
|
+
id?: string;
|
|
2494
|
+
/** Reveal duration in seconds. Default 0.18. */
|
|
2495
|
+
revealSeconds?: number;
|
|
2496
|
+
/** Label colour. Defaults to `tint`, then the theme's text. */
|
|
2497
|
+
labelColor?: string;
|
|
2498
|
+
/** Label size in media px. Default 12. */
|
|
2499
|
+
fontSize?: number;
|
|
2500
|
+
/**
|
|
2501
|
+
* Rounded plate behind the mark and label. Without one the wording sits
|
|
2502
|
+
* straight on the candles and is unreadable wherever the chart is busy.
|
|
2503
|
+
* Defaults to a translucent form of the theme background; `'none'` omits it.
|
|
2504
|
+
*/
|
|
2505
|
+
background?: string;
|
|
2506
|
+
/** Plate border. Defaults to the theme's axis line. `'none'` omits it. */
|
|
2507
|
+
borderColor?: string;
|
|
2508
|
+
/** Plate corner radius in media px. Default 6. */
|
|
2509
|
+
radius?: number;
|
|
2510
|
+
/**
|
|
2511
|
+
* Where the mark points. A canvas cannot hold an anchor, so this only marks
|
|
2512
|
+
* it as clickable — the hit reports a pointer cursor, and the host opens
|
|
2513
|
+
* {@link href} from its own click handler.
|
|
2514
|
+
*
|
|
2515
|
+
* Given a bare URL, `href()` appends UTM parameters naming the page the chart
|
|
2516
|
+
* is embedded in, so the referral is attributable. Pass a URL that already
|
|
2517
|
+
* has a query string to compose your own and skip that entirely.
|
|
2518
|
+
*/
|
|
2519
|
+
href?: string;
|
|
2520
|
+
/** `utm_medium` for the composed link. Default `oac-link`. */
|
|
2521
|
+
utmMedium?: string;
|
|
2522
|
+
/** `utm_campaign` for the composed link. Default `oac-chart`. */
|
|
2523
|
+
utmCampaign?: string;
|
|
2485
2524
|
}
|
|
2486
2525
|
/** Top-left placement (in media px) of a `w x h` logo within a `plotW x plotH` plot. */
|
|
2487
2526
|
declare function watermarkRect(position: WatermarkPosition, margin: number, w: number, h: number, plotW: number, plotH: number): {
|
|
@@ -2492,6 +2531,12 @@ declare function watermarkRect(position: WatermarkPosition, margin: number, w: n
|
|
|
2492
2531
|
};
|
|
2493
2532
|
declare class LogoWatermark implements IPrimitive {
|
|
2494
2533
|
private _opts;
|
|
2534
|
+
/** 0..1 reveal progress, eased toward hover state each frame. */
|
|
2535
|
+
private _reveal;
|
|
2536
|
+
private _lastFrameMs;
|
|
2537
|
+
/** Label width in media px, measured once the font is known. */
|
|
2538
|
+
private _labelW;
|
|
2539
|
+
private readonly _now;
|
|
2495
2540
|
private _host;
|
|
2496
2541
|
private _img;
|
|
2497
2542
|
private _ready;
|
|
@@ -2504,7 +2549,26 @@ declare class LogoWatermark implements IPrimitive {
|
|
|
2504
2549
|
autoscaleInfo(): null;
|
|
2505
2550
|
/** Live restyle. Pass a new `src`/`image` to swap the logo. */
|
|
2506
2551
|
setOptions(patch: Partial<LogoWatermarkOptions>): void;
|
|
2552
|
+
/**
|
|
2553
|
+
* The mark's box, in media px. The label unrolls to its right, so the hit
|
|
2554
|
+
* area is the mark alone — hovering the revealed text keeps it open because
|
|
2555
|
+
* the pointer is still within the widened box below.
|
|
2556
|
+
*/
|
|
2557
|
+
private _rect;
|
|
2558
|
+
/**
|
|
2559
|
+
* The link to open, with attribution appended. A caller who supplied their
|
|
2560
|
+
* own query string gets it back untouched.
|
|
2561
|
+
*/
|
|
2562
|
+
href(): string | undefined;
|
|
2563
|
+
hitTest(x: number, y: number, rc: PrimitiveRenderContext): PrimitiveHit | null;
|
|
2507
2564
|
draw(ctx: CanvasRenderingContext2D, rc: PrimitiveRenderContext): void;
|
|
2565
|
+
/**
|
|
2566
|
+
* The single colour the mark and its label share. Either option can set it;
|
|
2567
|
+
* they follow each other so the pair never renders in two shades.
|
|
2568
|
+
*/
|
|
2569
|
+
private _ink;
|
|
2570
|
+
/** Ease the reveal toward the hover state, asking for frames while moving. */
|
|
2571
|
+
private _advanceReveal;
|
|
2508
2572
|
/** Recolor the opaque logo pixels to `color` at (dw x dh) device px, cached. */
|
|
2509
2573
|
private _tinted;
|
|
2510
2574
|
}
|