mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-08 14:11:56 -07:00
heatmaps: part 3
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
*
|
||||
* @import { Color } from "./utils/colors.js"
|
||||
*
|
||||
* @import { HeatmapDataSource, HeatmapCells, HeatmapColorFn, HeatmapTooltipFn } from "../src/heatmap/types.js"
|
||||
*
|
||||
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, AnySeriesBlueprint, SeriesType, AnyFetchedSeriesBlueprint, ExplorerOption, UrlOption, PartialOptionsGroup, OptionsGroup, PartialOptionsTree, UtxoCohortObject, AddrCohortObject, CohortObject, CohortGroupObject, FetchedLineSeriesBlueprint, FetchedBaselineSeriesBlueprint, FetchedHistogramSeriesBlueprint, FetchedDotsBaselineSeriesBlueprint, PatternAll, PatternFull, PatternWithAdjusted, PatternWithPercentiles, PatternBasic, PatternBasicWithMarketCap, PatternBasicWithoutMarketCap, PatternWithoutRelative, CohortAll, CohortFull, CohortWithAdjusted, CohortWithPercentiles, CohortBasic, CohortBasicWithMarketCap, CohortBasicWithoutMarketCap, CohortWithoutRelative, CohortAddr, CohortLongTerm, CohortAgeRange, CohortAgeRangeWithMatured, CohortGroupFull, CohortGroupWithAdjusted, CohortGroupWithPercentiles, CohortGroupLongTerm, CohortGroupAgeRange, CohortGroupBasic, CohortGroupBasicWithMarketCap, CohortGroupBasicWithoutMarketCap, CohortGroupWithoutRelative, CohortGroupAddr, UtxoCohortGroupObject, AddrCohortGroupObject, FetchedDotsSeriesBlueprint, HeatmapOption, FetchedCandlestickSeriesBlueprint, FetchedPriceSeriesBlueprint, AnyPricePattern, AnyValuePattern } from "./options/partial.js"
|
||||
*
|
||||
*
|
||||
|
||||
@@ -107,6 +107,10 @@
|
||||
* @typedef {Object} PartialHeatmapOptionSpecific
|
||||
* @property {"heatmap"} kind
|
||||
* @property {string} title
|
||||
* @property {HeatmapDataSource} data
|
||||
* @property {HeatmapCells} cells
|
||||
* @property {HeatmapColorFn} color
|
||||
* @property {HeatmapTooltipFn} [tooltip]
|
||||
*
|
||||
* @typedef {PartialOption & PartialHeatmapOptionSpecific} PartialHeatmapOption
|
||||
*
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @typedef {Object} HeatmapDataSource
|
||||
* @property {(signal: AbortSignal) => Promise<string[]>} list
|
||||
* @property {(date: string, signal: AbortSignal) => Promise<unknown>} fetch
|
||||
*
|
||||
* @typedef {Object} HeatmapCells
|
||||
* @property {(args: { dates: string[], width: number, height: number }) => unknown} create
|
||||
* @property {(grid: unknown, dateIndex: number, snapshot: unknown) => number | undefined} add
|
||||
* @property {(grid: unknown, col: number, row: number) => unknown} getValue
|
||||
*
|
||||
* @typedef {Object} HeatmapColorContext
|
||||
* @property {boolean} dark
|
||||
* @property {unknown} grid
|
||||
* @property {number} col
|
||||
* @property {number} row
|
||||
*
|
||||
* @typedef {(value: unknown, context: HeatmapColorContext) => number} HeatmapColorFn
|
||||
*
|
||||
* @typedef {Object} HeatmapTooltipContext
|
||||
* @property {unknown} grid
|
||||
* @property {number} col
|
||||
* @property {number} row
|
||||
*
|
||||
* @typedef {(context: HeatmapTooltipContext) => string} HeatmapTooltipFn
|
||||
*/
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user