heatmaps: part 3

This commit is contained in:
nym21
2026-05-30 11:36:46 +02:00
parent 6938204a24
commit e43b53b429
3 changed files with 33 additions and 0 deletions
+2
View File
@@ -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"
*
*
+4
View File
@@ -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
*
+27
View File
@@ -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 {};