openalgo-charts 2.0.2 → 2.1.0
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 +29 -14
- package/dist/index.d.ts +1 -1
- package/dist/openalgo-charts.mjs +1 -1
- package/dist/openalgo-charts.profile.mjs +1 -1
- package/dist/openalgo-charts.profile.mjs.map +1 -1
- package/dist/openalgo-charts.standalone.js +1 -1
- package/dist/profile/index.d.ts +19 -5
- package/package.json +1 -1
package/dist/profile/index.d.ts
CHANGED
|
@@ -466,10 +466,11 @@ declare function rowOf(price: number, options: MarketProfileOptions): number;
|
|
|
466
466
|
*/
|
|
467
467
|
|
|
468
468
|
/**
|
|
469
|
-
* `auto` crossfades letters into bricks as rows get short (the default
|
|
470
|
-
*
|
|
469
|
+
* `auto` crossfades letters into bricks as rows get short (the default).
|
|
470
|
+
* `compact` keeps high-contrast letters, using a pixel font in short rows.
|
|
471
|
+
* The remaining modes pin the choice.
|
|
471
472
|
*/
|
|
472
|
-
type MpBlockDisplay = 'auto' | 'blocks+letters' | 'letters' | 'blocks';
|
|
473
|
+
type MpBlockDisplay = 'auto' | 'compact' | 'blocks+letters' | 'letters' | 'blocks';
|
|
473
474
|
/**
|
|
474
475
|
* What drives a block's colour.
|
|
475
476
|
* `period` — one hue per TPO period, so the session's shape over time is visible.
|
|
@@ -481,7 +482,7 @@ type MpColorMode = 'period' | 'valueArea' | 'count' | 'volume' | 'uniform';
|
|
|
481
482
|
/** Default period palette — 12 hues that stay distinct on a dark background. */
|
|
482
483
|
declare const TPO_PERIOD_COLORS: readonly string[];
|
|
483
484
|
interface MarketProfilePrimitiveOptions {
|
|
484
|
-
/**
|
|
485
|
+
/** `auto` fades letters to bricks; `compact` preserves small pixel glyphs. */
|
|
485
486
|
blockDisplay: MpBlockDisplay;
|
|
486
487
|
/** Row height (px) below which a letter no longer fits and bricks take over. */
|
|
487
488
|
minLetterHeight: number;
|
|
@@ -502,6 +503,12 @@ interface MarketProfilePrimitiveOptions {
|
|
|
502
503
|
zOrder: ZOrder;
|
|
503
504
|
/** Draw each period in its own column slot instead of packing rows left. */
|
|
504
505
|
split: boolean;
|
|
506
|
+
/** Lowercase `o` beside each session's opening-price row. */
|
|
507
|
+
showSessionOpen: boolean;
|
|
508
|
+
sessionOpenColor: string;
|
|
509
|
+
/** `#` beside the latest close, on the newest supplied session only. */
|
|
510
|
+
showLastPrice: boolean;
|
|
511
|
+
lastPriceColor: string;
|
|
505
512
|
/** Gap in px between session profiles. */
|
|
506
513
|
profileSpacing: number;
|
|
507
514
|
showPoc: boolean;
|
|
@@ -546,7 +553,7 @@ interface MarketProfilePrimitiveOptions {
|
|
|
546
553
|
volumeProfileWidth: number;
|
|
547
554
|
volumeProfileSide: 'left' | 'right';
|
|
548
555
|
volumeColor: string;
|
|
549
|
-
/** Print
|
|
556
|
+
/** Print volume per row; compact mode uses pixel digits down to 5 physical px. */
|
|
550
557
|
showVolumeValues: boolean;
|
|
551
558
|
}
|
|
552
559
|
declare const DEFAULT_MARKET_PROFILE_PRIMITIVE_OPTIONS: MarketProfilePrimitiveOptions;
|
|
@@ -568,6 +575,7 @@ declare class MarketProfile implements IPrimitive {
|
|
|
568
575
|
private _boxes;
|
|
569
576
|
private _rowH;
|
|
570
577
|
private _rc;
|
|
578
|
+
private readonly _sessionSplits;
|
|
571
579
|
constructor(result?: MarketProfileResult | null, opts?: Partial<MarketProfilePrimitiveOptions>);
|
|
572
580
|
attached(host: PrimitiveHost): void;
|
|
573
581
|
detached(): void;
|
|
@@ -579,6 +587,11 @@ declare class MarketProfile implements IPrimitive {
|
|
|
579
587
|
} | null;
|
|
580
588
|
setData(result: MarketProfileResult): void;
|
|
581
589
|
setOptions(patch: Partial<MarketProfilePrimitiveOptions>): void;
|
|
590
|
+
/** Effective display for an index in the current result; false if missing. */
|
|
591
|
+
isSessionSplit(sessionIndex: number): boolean;
|
|
592
|
+
/** Split/unsplit one session. Null restores its global default. */
|
|
593
|
+
setSessionSplit(sessionIndex: number, split: boolean | null): boolean;
|
|
594
|
+
private _sessionKey;
|
|
582
595
|
/** Report the session under the pointer so a host can show a tooltip. */
|
|
583
596
|
hitTest(x: number, y: number): PrimitiveHit | null;
|
|
584
597
|
/**
|
|
@@ -595,6 +608,7 @@ declare class MarketProfile implements IPrimitive {
|
|
|
595
608
|
private _letterAlpha;
|
|
596
609
|
private _blockColor;
|
|
597
610
|
private _drawSession;
|
|
611
|
+
private _drawPriceMarker;
|
|
598
612
|
private _drawVolume;
|
|
599
613
|
/** Step-plot one developing series across the session. */
|
|
600
614
|
private _drawDeveloping;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openalgo-charts",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "From-scratch, dependency-free canvas charting engine for OpenAlgo: professional-grade interactive rendering, advanced on-chart trading, and a one-call widget tier that adds the toolbar, drawing rail, dialogs and shortcuts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "marketcalls",
|