@tradecanvas/core 1.20.0 → 1.22.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 +1 -1
- package/dist/finance/BarChartRenderer.d.ts +39 -0
- package/dist/finance/BarChartRenderer.d.ts.map +1 -0
- package/dist/finance/BaseFinanceChart.d.ts +2 -0
- package/dist/finance/BaseFinanceChart.d.ts.map +1 -1
- package/dist/finance/CalendarRenderer.d.ts +53 -0
- package/dist/finance/CalendarRenderer.d.ts.map +1 -0
- package/dist/finance/CounterClockRenderer.d.ts +45 -0
- package/dist/finance/CounterClockRenderer.d.ts.map +1 -0
- package/dist/finance/DonutRenderer.d.ts +33 -0
- package/dist/finance/DonutRenderer.d.ts.map +1 -0
- package/dist/finance/HeatmapLayout.d.ts +31 -0
- package/dist/finance/HeatmapLayout.d.ts.map +1 -1
- package/dist/finance/HeatmapRenderer.d.ts +2 -2
- package/dist/finance/HeatmapRenderer.d.ts.map +1 -1
- package/dist/finance/HistogramRenderer.d.ts +37 -0
- package/dist/finance/HistogramRenderer.d.ts.map +1 -0
- package/dist/finance/MatrixRenderer.d.ts +56 -0
- package/dist/finance/MatrixRenderer.d.ts.map +1 -0
- package/dist/finance/ScatterRenderer.d.ts +32 -0
- package/dist/finance/ScatterRenderer.d.ts.map +1 -0
- package/dist/finance/chartKit.d.ts +67 -0
- package/dist/finance/chartKit.d.ts.map +1 -0
- package/dist/finance/colorScale.d.ts +25 -0
- package/dist/finance/colorScale.d.ts.map +1 -0
- package/dist/finance/index.d.ts +20 -2
- package/dist/finance/index.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3622 -1885
- package/dist/index.js.map +1 -1
- package/dist/indicators/overlay/DeMarkRange.d.ts +14 -0
- package/dist/indicators/overlay/DeMarkRange.d.ts.map +1 -0
- package/dist/indicators/overlay/MARainbow.d.ts +16 -0
- package/dist/indicators/overlay/MARainbow.d.ts.map +1 -0
- package/dist/indicators/overlay/PriceAverages.d.ts +5 -0
- package/dist/indicators/overlay/PriceAverages.d.ts.map +1 -1
- package/dist/indicators/overlay/TimeSeriesForecast.d.ts +12 -0
- package/dist/indicators/overlay/TimeSeriesForecast.d.ts.map +1 -0
- package/dist/indicators/panel/ABRatio.d.ts +16 -0
- package/dist/indicators/panel/ABRatio.d.ts.map +1 -0
- package/dist/indicators/panel/BinaryWave.d.ts +17 -0
- package/dist/indicators/panel/BinaryWave.d.ts.map +1 -0
- package/dist/indicators/panel/IntradayIntensity.d.ts +16 -0
- package/dist/indicators/panel/IntradayIntensity.d.ts.map +1 -0
- package/dist/indicators/panel/PsychologicalLine.d.ts +24 -0
- package/dist/indicators/panel/PsychologicalLine.d.ts.map +1 -0
- package/dist/indicators/panel/RSquared.d.ts +13 -0
- package/dist/indicators/panel/RSquared.d.ts.map +1 -0
- package/dist/indicators/panel/RandomWalkIndex.d.ts +15 -0
- package/dist/indicators/panel/RandomWalkIndex.d.ts.map +1 -0
- package/dist/indicators/panel/Sigma.d.ts +13 -0
- package/dist/indicators/panel/Sigma.d.ts.map +1 -0
- package/dist/indicators/panel/SmoothedROC.d.ts +12 -0
- package/dist/indicators/panel/SmoothedROC.d.ts.map +1 -0
- package/dist/indicators/panel/Sonar.d.ts +13 -0
- package/dist/indicators/panel/Sonar.d.ts.map +1 -0
- package/dist/indicators/panel/TrueRange.d.ts +9 -0
- package/dist/indicators/panel/TrueRange.d.ts.map +1 -0
- package/dist/indicators/panel/VerticalHorizontalFilter.d.ts +13 -0
- package/dist/indicators/panel/VerticalHorizontalFilter.d.ts.map +1 -0
- package/dist/indicators/panel/VolumeComparisons.d.ts +25 -0
- package/dist/indicators/panel/VolumeComparisons.d.ts.map +1 -0
- package/dist/indicators/panel/VolumeIndexes.d.ts +26 -0
- package/dist/indicators/panel/VolumeIndexes.d.ts.map +1 -0
- package/dist/indicators/panel/VolumeRatio.d.ts +14 -0
- package/dist/indicators/panel/VolumeRatio.d.ts.map +1 -0
- package/dist/indicators/registry.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Two stacked canvases — a hover repaints only the thin top one:
|
|
|
34
34
|
|
|
35
35
|
Data transforms: `toHeikinAshi`, `toRenko`, `toLineBreak`, `toKagi`, `toPointAndFigure`, `toRangeBars`
|
|
36
36
|
|
|
37
|
-
### Indicators (
|
|
37
|
+
### Indicators (133 built-in)
|
|
38
38
|
|
|
39
39
|
Moving averages, bands and channels, trend and stops, VWAPs and profiles on the price pane; oscillators, volume and volatility indicators in panes of their own. Every id with its inputs, lines and levels is in the [indicator catalog](https://bonguynvan.github.io/tradecanvas/docs/indicators). Four more read a second symbol's bars (`compareSymbol`, `spread`, `correlation`, `correlationlog`); `@tradecanvas/chart`'s `Chart` registers them with its symbol store.
|
|
40
40
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BarChartOptions, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { LegendLayout, Measure, NiceScale, Rect } from './chartKit.js';
|
|
3
|
+
export interface BarRect {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
category: string;
|
|
9
|
+
series: string;
|
|
10
|
+
value: number;
|
|
11
|
+
/** The category's index. */
|
|
12
|
+
index: number;
|
|
13
|
+
color: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BarLayout {
|
|
16
|
+
plot: Rect;
|
|
17
|
+
scale: NiceScale;
|
|
18
|
+
orientation: 'vertical' | 'horizontal';
|
|
19
|
+
/** The zero line: a y for vertical bars, an x for horizontal ones. */
|
|
20
|
+
zero: number;
|
|
21
|
+
/** Bars series by series, each in category order. */
|
|
22
|
+
bars: BarRect[];
|
|
23
|
+
/** Where each category's band starts along the category axis, and how long it is. */
|
|
24
|
+
bandStart: number;
|
|
25
|
+
band: number;
|
|
26
|
+
legend: LegendLayout | null;
|
|
27
|
+
legendY: number;
|
|
28
|
+
}
|
|
29
|
+
/** Where the bars go, for a chart `width` × `height`. */
|
|
30
|
+
export declare function computeBarLayout(options: BarChartOptions, width: number, height: number, theme: Theme, measure: Measure): BarLayout;
|
|
31
|
+
/** The bar under (x, y); a bar at least a few pixels thick, so a thin one can be found. */
|
|
32
|
+
export declare function hitBar(layout: BarLayout, x: number, y: number): BarRect | null;
|
|
33
|
+
/** The category whose band holds (x, y) inside the plot; -1 outside it. */
|
|
34
|
+
export declare function hitCategory(layout: BarLayout, x: number, y: number, count: number): number;
|
|
35
|
+
export declare function renderBarChart(ctx: CanvasRenderingContext2D, width: number, height: number, options: BarChartOptions, theme: Theme, pointer: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
} | null, layout?: BarLayout): BarLayout;
|
|
39
|
+
//# sourceMappingURL=BarChartRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChartRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/BarChartRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAcL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EAEV,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAwCD,yDAAyD;AACzD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,CA0DnI;AAED,2FAA2F;AAC3F,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAM9E;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM1F;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,SAAsF,GAC7F,SAAS,CAiDX"}
|
|
@@ -13,6 +13,8 @@ export declare abstract class BaseFinanceChart {
|
|
|
13
13
|
private updateSize;
|
|
14
14
|
requestRender(): void;
|
|
15
15
|
protected abstract renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
16
|
+
/** What the chart shows, for screen readers (the canvas's aria-label). */
|
|
17
|
+
setLabel(label: string): void;
|
|
16
18
|
setTheme(theme: ThemeName | Theme): void;
|
|
17
19
|
destroy(): void;
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseFinanceChart.d.ts","sourceRoot":"","sources":["../../src/finance/BaseFinanceChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAS7D,8BAAsB,gBAAgB;IACpC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACpC,SAAS,CAAC,GAAG,EAAE,wBAAwB,CAAC;IACxC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,KAAK,SAAK;IACpB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"BaseFinanceChart.d.ts","sourceRoot":"","sources":["../../src/finance/BaseFinanceChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAS7D,8BAAsB,gBAAgB;IACpC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACpC,SAAS,CAAC,GAAG,EAAE,wBAAwB,CAAC;IACxC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,KAAK,SAAK;IACpB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK;IAuB7D,OAAO,CAAC,UAAU;IASlB,aAAa,IAAI,IAAI;IAiBrB,SAAS,CAAC,QAAQ,CAAC,WAAW,CAC5B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAEP,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI;IAKxC,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CalendarChartOptions, CalendarDay, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { Measure, Rect } from './chartKit.js';
|
|
3
|
+
import { ResolvedScale } from './colorScale.js';
|
|
4
|
+
/** Calendar years shown at most: a longer range keeps its last ones. */
|
|
5
|
+
export declare const MAX_CALENDAR_YEARS = 10;
|
|
6
|
+
/** The day number (days since 1 January 1970) of a `YYYY-MM-DD` date, or null if it isn't one. */
|
|
7
|
+
export declare function parseDay(date: string): number | null;
|
|
8
|
+
export declare function dayToIso(day: number): string;
|
|
9
|
+
export interface CalendarCell {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
size: number;
|
|
13
|
+
date: string;
|
|
14
|
+
/** The data for the day, if there is any. */
|
|
15
|
+
day?: CalendarDay;
|
|
16
|
+
color: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface CalendarLayout {
|
|
19
|
+
cells: CalendarCell[];
|
|
20
|
+
months: {
|
|
21
|
+
label: string;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}[];
|
|
25
|
+
weekdays: {
|
|
26
|
+
label: string;
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}[];
|
|
30
|
+
years: {
|
|
31
|
+
label: string;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}[];
|
|
35
|
+
scale: ResolvedScale;
|
|
36
|
+
/** Where the colour bar goes; null without one. */
|
|
37
|
+
bar: Rect | null;
|
|
38
|
+
pitch: number;
|
|
39
|
+
/** How a day reads in the tooltip. */
|
|
40
|
+
formatDate: (date: string) => string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Days in week columns and weekday rows, a calendar year to a band, for a
|
|
44
|
+
* chart `width` × `height`; the cells stay square and no larger than 28 px.
|
|
45
|
+
*/
|
|
46
|
+
export declare function computeCalendarLayout(options: CalendarChartOptions, width: number, height: number, theme: Theme, measure: Measure): CalendarLayout;
|
|
47
|
+
/** The day under the pointer. */
|
|
48
|
+
export declare function hitDay(layout: CalendarLayout, x: number, y: number): CalendarCell | null;
|
|
49
|
+
export declare function renderCalendar(ctx: CanvasRenderingContext2D, width: number, height: number, options: CalendarChartOptions, theme: Theme, pointer: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
} | null, layout?: CalendarLayout): CalendarLayout;
|
|
53
|
+
//# sourceMappingURL=CalendarRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/CalendarRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAiE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAoB,MAAM,eAAe,CAAC;AACzI,OAAO,EAA+D,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGlH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AASrC,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQpD;AAED,wBAAgB,QAAQ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,CAKxF;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,cAAgG,GACvG,cAAc,CAiDhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CounterClockOptions, CounterClockPoint, OHLCBar, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { Measure, NiceScale, Rect } from './chartKit.js';
|
|
3
|
+
/** Points drawn at most. */
|
|
4
|
+
export declare const MAX_CLOCK_POINTS = 2000;
|
|
5
|
+
/**
|
|
6
|
+
* Average volume and average close over each run of `period` bars, one point
|
|
7
|
+
* per bar from the first full run: the path a counter-clock chart draws.
|
|
8
|
+
* `last` keeps only the newest points. Each run is summed afresh, so equal
|
|
9
|
+
* closes give equal averages, with no rounding drift between them.
|
|
10
|
+
*/
|
|
11
|
+
export declare function counterClockPoints(data: readonly OHLCBar[], period: number, last?: number): CounterClockPoint[];
|
|
12
|
+
/**
|
|
13
|
+
* The direction of the last move, as one of eight phases counter-clockwise
|
|
14
|
+
* from volume rising at a steady price: 1 volume up, 2 both up, 3 price up,
|
|
15
|
+
* 4 price up on falling volume, 5 volume down, 6 both down, 7 price down,
|
|
16
|
+
* 8 price down on rising volume. Moves are read against the points' ranges,
|
|
17
|
+
* so a phase doesn't depend on the units. Null without a move.
|
|
18
|
+
*/
|
|
19
|
+
export declare function counterClockPhase(points: readonly CounterClockPoint[]): number | null;
|
|
20
|
+
export interface PlacedClockPoint {
|
|
21
|
+
px: number;
|
|
22
|
+
py: number;
|
|
23
|
+
alpha: number;
|
|
24
|
+
point: CounterClockPoint;
|
|
25
|
+
}
|
|
26
|
+
export interface CounterClockLayout {
|
|
27
|
+
plot: Rect;
|
|
28
|
+
xScale: NiceScale;
|
|
29
|
+
yScale: NiceScale;
|
|
30
|
+
points: PlacedClockPoint[];
|
|
31
|
+
/** The newest move's phase, 1–8, or null. */
|
|
32
|
+
phase: number | null;
|
|
33
|
+
color: string;
|
|
34
|
+
}
|
|
35
|
+
/** The plot and the newest points' places, for a chart `width` × `height`. */
|
|
36
|
+
export declare function computeCounterClockLayout(options: CounterClockOptions, width: number, height: number, _theme: Theme, measure: Measure): CounterClockLayout;
|
|
37
|
+
/** How many of the newest points a chart shows: `points`, 2 to MAX_CLOCK_POINTS. */
|
|
38
|
+
export declare function shownCount(options: Pick<CounterClockOptions, 'points'>): number;
|
|
39
|
+
/** The point nearest the pointer, within reach; the newest wins a tie. */
|
|
40
|
+
export declare function nearestCounterClockPoint(layout: CounterClockLayout, x: number, y: number): PlacedClockPoint | null;
|
|
41
|
+
export declare function renderCounterClock(ctx: CanvasRenderingContext2D, width: number, height: number, options: CounterClockOptions, theme: Theme, pointer: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
} | null, layout?: CounterClockLayout): CounterClockLayout;
|
|
45
|
+
//# sourceMappingURL=CounterClockRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CounterClockRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/CounterClockRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnG,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AASvB,4BAA4B;AAC5B,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAIrC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAW,GAAG,iB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AAwG,GAC/G,kBAAkB,CAuDpB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DonutChartOptions, DonutSlice, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { LegendLayout, Measure } from './chartKit.js';
|
|
3
|
+
export interface SliceArc {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
/** Its part of the whole, 0–1. */
|
|
7
|
+
share: number;
|
|
8
|
+
/** Angles in radians, clockwise from three o'clock; the first starts at twelve. */
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
color: string;
|
|
12
|
+
slice: DonutSlice;
|
|
13
|
+
}
|
|
14
|
+
export interface DonutLayout {
|
|
15
|
+
cx: number;
|
|
16
|
+
cy: number;
|
|
17
|
+
radius: number;
|
|
18
|
+
inner: number;
|
|
19
|
+
total: number;
|
|
20
|
+
slices: SliceArc[];
|
|
21
|
+
legend: LegendLayout | null;
|
|
22
|
+
legendX: number;
|
|
23
|
+
legendY: number;
|
|
24
|
+
}
|
|
25
|
+
/** The ring and its slices, for a chart `width` × `height`. */
|
|
26
|
+
export declare function computeDonutLayout(options: DonutChartOptions, width: number, height: number, _theme: Theme, measure: Measure): DonutLayout;
|
|
27
|
+
/** The slice under (x, y): on the ring, not in the hole or outside. */
|
|
28
|
+
export declare function hitSlice(layout: DonutLayout, x: number, y: number): SliceArc | null;
|
|
29
|
+
export declare function renderDonut(ctx: CanvasRenderingContext2D, width: number, height: number, options: DonutChartOptions, theme: Theme, pointer: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
} | null, layout?: DonutLayout): DonutLayout;
|
|
33
|
+
//# sourceMappingURL=DonutRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/DonutRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,E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,IAAI,EACxC,MAAM,GAAE,WAA0F,GACjG,WAAW,CAuCb"}
|
|
@@ -20,5 +20,36 @@ export declare function layoutSquarifiedTreemap(cells: readonly {
|
|
|
20
20
|
id: string;
|
|
21
21
|
weight: number;
|
|
22
22
|
}[], bounds: Bounds, padding: number): LayoutRect[];
|
|
23
|
+
export interface GroupRect {
|
|
24
|
+
name: string;
|
|
25
|
+
/** The group's whole tile, its name strip included. */
|
|
26
|
+
rect: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
32
|
+
/** The height of the name strip at the top of `rect`, px: 0 where it doesn't fit. */
|
|
33
|
+
header: number;
|
|
34
|
+
/** The cells' values averaged by weight. */
|
|
35
|
+
value: number;
|
|
36
|
+
count: number;
|
|
37
|
+
}
|
|
38
|
+
/** The strip a group's name takes at the top of its tile, px. */
|
|
39
|
+
export declare const GROUP_HEADER = 18;
|
|
40
|
+
/**
|
|
41
|
+
* Groups as tiles sized by their cells' weights, and each group's cells
|
|
42
|
+
* squarified inside its tile, under a `header`-px strip for the group's name
|
|
43
|
+
* where the tile is tall enough. Cells with no group make one named ''.
|
|
44
|
+
*/
|
|
45
|
+
export declare function layoutGroupedTreemap(cells: readonly {
|
|
46
|
+
id: string;
|
|
47
|
+
weight: number;
|
|
48
|
+
group?: string;
|
|
49
|
+
value: number;
|
|
50
|
+
}[], bounds: Bounds, padding: number, header?: number): {
|
|
51
|
+
groups: GroupRect[];
|
|
52
|
+
cells: LayoutRect[];
|
|
53
|
+
};
|
|
23
54
|
export {};
|
|
24
55
|
//# sourceMappingURL=HeatmapLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapLayout.d.ts","sourceRoot":"","sources":["../../src/finance/HeatmapLayout.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE;QAAE,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yHD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,EAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,UAAU,EAAE,CAcd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAID,iEAAiE;AACjE,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EAC/E,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,SAAe,GACpB;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CAkC9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HeatmapCell, HeatmapOptions, Theme } from '@tradecanvas/commons';
|
|
2
|
-
import { LayoutRect } from './HeatmapLayout.js';
|
|
2
|
+
import { GroupRect, LayoutRect } from './HeatmapLayout.js';
|
|
3
3
|
export interface HeatmapHitResult {
|
|
4
4
|
cell: HeatmapCell;
|
|
5
5
|
rect: LayoutRect;
|
|
@@ -7,5 +7,5 @@ export interface HeatmapHitResult {
|
|
|
7
7
|
export declare function renderHeatmap(ctx: CanvasRenderingContext2D, width: number, height: number, cells: readonly HeatmapCell[], layoutRects: readonly LayoutRect[], options: HeatmapOptions, theme: Theme, crosshairPos: {
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
|
-
} | null): HeatmapHitResult | null;
|
|
10
|
+
} | null, groups?: readonly GroupRect[]): HeatmapHitResult | null;
|
|
11
11
|
//# sourceMappingURL=HeatmapRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/HeatmapRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"HeatmapRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/HeatmapRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAoDhE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;CAClB;AA4FD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAC7C,MAAM,GAAE,SAAS,SAAS,EAAO,GAChC,gBAAgB,GAAG,IAAI,CA6EzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HistogramBin, HistogramOptions, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { Measure, NiceScale, Rect } from './chartKit.js';
|
|
3
|
+
/** No more bins than this, whatever the options ask: more can't be seen, and could run out of memory. */
|
|
4
|
+
export declare const MAX_BINS = 1000;
|
|
5
|
+
/**
|
|
6
|
+
* Values counted into equal bins: `bins` of them over the values' range, a
|
|
7
|
+
* `binWidth` on a grid from 0, or Sturges' count (`ceil(log2 n) + 1`).
|
|
8
|
+
* Each bin holds `from` up to `to`; the last one holds `to` too.
|
|
9
|
+
*/
|
|
10
|
+
export declare function histogramBins(values: readonly number[], options?: {
|
|
11
|
+
bins?: number | 'auto';
|
|
12
|
+
binWidth?: number;
|
|
13
|
+
}): HistogramBin[];
|
|
14
|
+
export interface HistogramBar {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
bin: HistogramBin;
|
|
20
|
+
color: string;
|
|
21
|
+
}
|
|
22
|
+
export interface HistogramLayout {
|
|
23
|
+
plot: Rect;
|
|
24
|
+
xScale: NiceScale;
|
|
25
|
+
yScale: NiceScale;
|
|
26
|
+
bars: HistogramBar[];
|
|
27
|
+
total: number;
|
|
28
|
+
}
|
|
29
|
+
/** The bins' bars on a value axis, for a chart `width` × `height`. */
|
|
30
|
+
export declare function computeHistogramLayout(options: HistogramOptions, width: number, height: number, theme: Theme, measure: Measure): HistogramLayout;
|
|
31
|
+
/** The bar whose bin holds the pointer's x, inside the plot. */
|
|
32
|
+
export declare function hitHistogramBar(layout: HistogramLayout, x: number, y: number): HistogramBar | null;
|
|
33
|
+
export declare function renderHistogram(ctx: CanvasRenderingContext2D, width: number, height: number, options: HistogramOptions, theme: Theme, pointer: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
} | null, layout?: HistogramLayout): HistogramLayout;
|
|
37
|
+
//# sourceMappingURL=HistogramRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistogramRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/HistogramRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElF,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAIvB,yGAAyG;AACzG,eAAO,MAAM,QAAQ,OAAO,CAAC;AAO7B;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,YAAY,EAAE,CAwCpI;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,YAAY,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAWD,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CAyBhJ;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAIlG;AAID,wBAAgB,eAAe,CAC7B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,eAAkG,GACzG,eAAe,CA0BjB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MatrixCell, MatrixChartOptions, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { Measure, Rect } from './chartKit.js';
|
|
3
|
+
import { ResolvedScale } from './colorScale.js';
|
|
4
|
+
/** Rows and columns past this many are left out: their cells would be under a pixel. */
|
|
5
|
+
export declare const MAX_MATRIX_SIZE = 200;
|
|
6
|
+
/**
|
|
7
|
+
* Pearson correlations between series, `[i][j]` for series i and j: pass
|
|
8
|
+
* returns (day-on-day changes), not prices. Each pair uses the positions
|
|
9
|
+
* where both have a finite value; fewer than three, or a series that never
|
|
10
|
+
* moves, gives NaN. It runs on the calling thread: 200 series of 1,000
|
|
11
|
+
* values take some tens of milliseconds. Colour the result with
|
|
12
|
+
* `colorScale: { min: -1, max: 1 }`, so 0.5 doesn't look like 1.
|
|
13
|
+
*/
|
|
14
|
+
export declare function correlationMatrix(series: readonly (readonly number[])[]): number[][];
|
|
15
|
+
export interface MatrixCellRect {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
size: number;
|
|
19
|
+
cell: MatrixCell;
|
|
20
|
+
color: string;
|
|
21
|
+
/** The value printed in the cell, when it fits. */
|
|
22
|
+
text: string | null;
|
|
23
|
+
textColor: string;
|
|
24
|
+
}
|
|
25
|
+
export interface MatrixLayout {
|
|
26
|
+
cells: MatrixCellRect[];
|
|
27
|
+
rowLabels: {
|
|
28
|
+
text: string;
|
|
29
|
+
index: number;
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}[];
|
|
33
|
+
columnLabels: {
|
|
34
|
+
text: string;
|
|
35
|
+
index: number;
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
rotated: boolean;
|
|
39
|
+
}[];
|
|
40
|
+
/** The whole grid, every row and column, empty cells included. */
|
|
41
|
+
grid: Rect;
|
|
42
|
+
pitch: number;
|
|
43
|
+
scale: ResolvedScale;
|
|
44
|
+
bar: Rect | null;
|
|
45
|
+
/** The cell at `[row][column]`, if one is drawn there. */
|
|
46
|
+
at: (MatrixCellRect | undefined)[][];
|
|
47
|
+
}
|
|
48
|
+
/** Square cells in rows and columns, named along the left and the top, for a chart `width` × `height`. */
|
|
49
|
+
export declare function computeMatrixLayout(options: MatrixChartOptions, width: number, height: number, theme: Theme, measure: Measure): MatrixLayout;
|
|
50
|
+
/** The cell under the pointer, if one is drawn there. */
|
|
51
|
+
export declare function hitMatrixCell(layout: MatrixLayout, x: number, y: number): MatrixCellRect | null;
|
|
52
|
+
export declare function renderMatrix(ctx: CanvasRenderingContext2D, width: number, height: number, options: MatrixChartOptions, theme: Theme, pointer: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
} | null, layout?: MatrixLayout): MatrixLayout;
|
|
56
|
+
//# sourceMappingURL=MatrixRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatrixRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/MatrixRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAA2D,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAA6E,KAAK,aAAa,EAAE,MAA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KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CA6E5I;AAED,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAI/F;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,YAA4F,GACnG,YAAY,CA4Dd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ScatterChartOptions, ScatterPoint, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { LegendLayout, Measure, NiceScale, Rect } from './chartKit.js';
|
|
3
|
+
export interface PlacedPoint {
|
|
4
|
+
px: number;
|
|
5
|
+
py: number;
|
|
6
|
+
r: number;
|
|
7
|
+
color: string;
|
|
8
|
+
/** Its fill, and its fill while hovered (worked out once, not each frame). */
|
|
9
|
+
fill: string;
|
|
10
|
+
hoverFill: string;
|
|
11
|
+
series: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
point: ScatterPoint;
|
|
14
|
+
}
|
|
15
|
+
export interface ScatterLayout {
|
|
16
|
+
plot: Rect;
|
|
17
|
+
xScale: NiceScale;
|
|
18
|
+
yScale: NiceScale;
|
|
19
|
+
points: PlacedPoint[];
|
|
20
|
+
/** Indexes into `points`, largest bubble first: small ones are drawn on top. */
|
|
21
|
+
drawOrder: number[];
|
|
22
|
+
legend: LegendLayout | null;
|
|
23
|
+
}
|
|
24
|
+
/** The plot and every point's place, for a chart `width` × `height`. */
|
|
25
|
+
export declare function computeScatterLayout(options: ScatterChartOptions, width: number, height: number, _theme: Theme, measure: Measure): ScatterLayout;
|
|
26
|
+
/** The point nearest (x, y) within reach of its edge; null when none is. */
|
|
27
|
+
export declare function nearestPoint(layout: ScatterLayout, x: number, y: number): PlacedPoint | null;
|
|
28
|
+
export declare function renderScatter(ctx: CanvasRenderingContext2D, width: number, height: number, options: ScatterChartOptions, theme: Theme, pointer: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
} | null, layout?: ScatterLayout): ScatterLayout;
|
|
32
|
+
//# sourceMappingURL=ScatterRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScatterRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/ScatterRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAaL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EAEV,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,gFAAgF;IAChF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B;AAUD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CAmEhJ;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAW5F;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,aAA8F,GACrG,aAAa,CAkDf"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Theme } from '@tradecanvas/commons';
|
|
2
|
+
/** How wide `text` is at a font size, px (the canvas's measureText, or a stand-in in tests). */
|
|
3
|
+
export type Measure = (text: string, size?: number) => number;
|
|
4
|
+
export interface Rect {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export interface NiceScale {
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
step: number;
|
|
14
|
+
ticks: number[];
|
|
15
|
+
}
|
|
16
|
+
/** Room for a label's text around it, px. */
|
|
17
|
+
export declare const LABEL_SIZE = 11;
|
|
18
|
+
/**
|
|
19
|
+
* A scale over `min`–`max` in whole steps of 1, 2, 2.5 or 5 times a power
|
|
20
|
+
* of ten, about `maxTicks` of them; a range of one value is opened up around it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function niceScale(min: number, max: number, maxTicks?: number): NiceScale;
|
|
23
|
+
/** Where `value` falls along a span of pixels, `start` at the scale's min (or max when `inverted`). */
|
|
24
|
+
export declare function scaleToPx(scale: NiceScale, value: number, start: number, length: number, inverted?: boolean): number;
|
|
25
|
+
/** Numbers as people read them: 1,234.5, and 12.3K past ten thousand. */
|
|
26
|
+
export declare function defaultFormat(value: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* How a scale's ticks read: as many decimals as its step needs, and 20K or
|
|
29
|
+
* 1.5M when that keeps every tick apart.
|
|
30
|
+
*/
|
|
31
|
+
export declare function axisFormat(scale: NiceScale): (value: number) => string;
|
|
32
|
+
/** A series' colour: its own, else the palette's in turn. */
|
|
33
|
+
export declare function seriesColor(index: number, color?: string): string;
|
|
34
|
+
export declare function fontOf(theme: Theme, size: number, weight?: string): string;
|
|
35
|
+
/** A Measure from a canvas, in the theme's font. */
|
|
36
|
+
export declare function canvasMeasure(ctx: CanvasRenderingContext2D, theme: Theme): Measure;
|
|
37
|
+
export interface LegendItem {
|
|
38
|
+
label: string;
|
|
39
|
+
color: string;
|
|
40
|
+
}
|
|
41
|
+
export interface LegendLayout {
|
|
42
|
+
items: (LegendItem & {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
})[];
|
|
46
|
+
rows: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}
|
|
49
|
+
/** Legend entries in rows that fit `maxWidth`, from (0, 0); `column`: one entry a row. */
|
|
50
|
+
export declare function layoutLegend(items: readonly LegendItem[], maxWidth: number, measure: Measure, column?: boolean): LegendLayout;
|
|
51
|
+
export declare function drawLegend(ctx: CanvasRenderingContext2D, layout: LegendLayout, ox: number, oy: number, theme: Theme): void;
|
|
52
|
+
export interface TooltipLine {
|
|
53
|
+
text: string;
|
|
54
|
+
/** A swatch before the text. */
|
|
55
|
+
color?: string;
|
|
56
|
+
bold?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** A box of lines by the pointer, kept inside `bounds`. */
|
|
59
|
+
export declare function drawTooltip(ctx: CanvasRenderingContext2D, lines: readonly TooltipLine[], anchor: {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
}, bounds: Rect, theme: Theme): void;
|
|
63
|
+
/** Grid lines and labels of a value scale along one side of the plot. */
|
|
64
|
+
export declare function drawValueAxis(ctx: CanvasRenderingContext2D, plot: Rect, scale: NiceScale, orientation: 'vertical' | 'horizontal', theme: Theme, format: (value: number) => string): void;
|
|
65
|
+
/** `text` cut with an ellipsis to fit `width`. */
|
|
66
|
+
export declare function fitText(text: string, width: number, measure: Measure, size?: number): string;
|
|
67
|
+
//# sourceMappingURL=chartKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartKit.d.ts","sourceRoot":"","sources":["../../src/finance/chartKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGlD,gGAAgG;AAChG,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE9D,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,6CAA6C;AAC7C,eAAO,MAAM,UAAU,KAAK,CAAC;AA2B7B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,SAAS,CA2B3E;AAED,uGAAuG;AACvG,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE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b,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CACzB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAChC,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,KAAK,GACX,IAAI,CAsCN;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,wBAAwB,EAC7B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,UAAU,GAAG,YAAY,EACtC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAChC,IAAI,CA4BN;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,SAAa,GAAG,MAAM,CAKhG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ColorScale, Theme } from '@tradecanvas/commons';
|
|
2
|
+
import { Rect } from './chartKit.js';
|
|
3
|
+
/** A colour scale with its range worked out. */
|
|
4
|
+
export interface ResolvedScale {
|
|
5
|
+
negative: string;
|
|
6
|
+
zero: string;
|
|
7
|
+
positive: string;
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
}
|
|
11
|
+
/** Room under a chart for its colour bar and the bar's labels, px. */
|
|
12
|
+
export declare const COLOR_BAR_ROOM = 28;
|
|
13
|
+
/**
|
|
14
|
+
* The scale a chart colours by: the one given, its range filled in from the
|
|
15
|
+
* values (either side of zero evenly when any is negative, else from zero up),
|
|
16
|
+
* and the theme's down and up colours by default.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveColorScale(values: Iterable<number>, theme: Theme, scale?: ColorScale): ResolvedScale;
|
|
19
|
+
/** The colour of `value`: the zero colour at 0, the end colours at the range's ends and past them. */
|
|
20
|
+
export declare function scaleColor(value: number, scale: ResolvedScale): string;
|
|
21
|
+
/** Near-white or near-black, whichever contrasts more with `color`. */
|
|
22
|
+
export declare function readableText(color: string): string;
|
|
23
|
+
/** The scale as a bar from its min to its max, the ends (and zero, inside them) labelled below. */
|
|
24
|
+
export declare function drawColorBar(ctx: CanvasRenderingContext2D, area: Rect, scale: ResolvedScale, format: (v: number) => string, theme: Theme): void;
|
|
25
|
+
//# sourceMappingURL=colorScale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorScale.d.ts","sourceRoot":"","sources":["../../src/finance/colorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAsB,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAE9D,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc,KAAK,CAAC;AAyCjC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,aAAa,CAsB3G;AAED,sGAAsG;AACtG,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAItE;AAMD,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD;AAED,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CA0B/I"}
|
package/dist/finance/index.d.ts
CHANGED
|
@@ -3,10 +3,28 @@ export { FinanceCrosshair } from './FinanceCrosshair.js';
|
|
|
3
3
|
export { renderSparkline } from './SparklineRenderer.js';
|
|
4
4
|
export { renderDepthChart } from './DepthChartRenderer.js';
|
|
5
5
|
export { renderEquityCurve } from './EquityCurveRenderer.js';
|
|
6
|
-
export { layoutUniformGrid, layoutSquarifiedTreemap } from './HeatmapLayout.js';
|
|
7
|
-
export type { LayoutRect } from './HeatmapLayout.js';
|
|
6
|
+
export { layoutUniformGrid, layoutSquarifiedTreemap, layoutGroupedTreemap, GROUP_HEADER } from './HeatmapLayout.js';
|
|
7
|
+
export type { LayoutRect, GroupRect } from './HeatmapLayout.js';
|
|
8
8
|
export { renderHeatmap } from './HeatmapRenderer.js';
|
|
9
9
|
export type { HeatmapHitResult } from './HeatmapRenderer.js';
|
|
10
10
|
export { renderWaterfall } from './WaterfallRenderer.js';
|
|
11
11
|
export { renderGauge } from './GaugeRenderer.js';
|
|
12
|
+
export { niceScale, layoutLegend, defaultFormat, axisFormat, canvasMeasure } from './chartKit.js';
|
|
13
|
+
export type { NiceScale, LegendLayout, Measure } from './chartKit.js';
|
|
14
|
+
export { renderBarChart, computeBarLayout, hitBar, hitCategory } from './BarChartRenderer.js';
|
|
15
|
+
export type { BarLayout, BarRect } from './BarChartRenderer.js';
|
|
16
|
+
export { renderDonut, computeDonutLayout, hitSlice } from './DonutRenderer.js';
|
|
17
|
+
export type { DonutLayout, SliceArc } from './DonutRenderer.js';
|
|
18
|
+
export { renderScatter, computeScatterLayout, nearestPoint } from './ScatterRenderer.js';
|
|
19
|
+
export type { ScatterLayout, PlacedPoint } from './ScatterRenderer.js';
|
|
20
|
+
export { renderHistogram, computeHistogramLayout, hitHistogramBar, histogramBins } from './HistogramRenderer.js';
|
|
21
|
+
export type { HistogramLayout, HistogramBar } from './HistogramRenderer.js';
|
|
22
|
+
export { resolveColorScale, scaleColor, readableText } from './colorScale.js';
|
|
23
|
+
export type { ResolvedScale } from './colorScale.js';
|
|
24
|
+
export { renderCalendar, computeCalendarLayout, hitDay, parseDay, dayToIso } from './CalendarRenderer.js';
|
|
25
|
+
export type { CalendarLayout, CalendarCell } from './CalendarRenderer.js';
|
|
26
|
+
export { renderMatrix, computeMatrixLayout, hitMatrixCell, correlationMatrix } from './MatrixRenderer.js';
|
|
27
|
+
export type { MatrixLayout, MatrixCellRect } from './MatrixRenderer.js';
|
|
28
|
+
export { renderCounterClock, computeCounterClockLayout, nearestCounterClockPoint, counterClockPoints, counterClockPhase, shownCount } from './CounterClockRenderer.js';
|
|
29
|
+
export type { CounterClockLayout, PlacedClockPoint } from './CounterClockRenderer.js';
|
|
12
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/finance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/finance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OA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