heatmaps: part 4

This commit is contained in:
nym21
2026-05-30 11:36:49 +02:00
parent e43b53b429
commit cc8fde59e8
11 changed files with 688 additions and 78 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
*
* @import { Color } from "./utils/colors.js"
*
* @import { HeatmapDataSource, HeatmapCells, HeatmapColorFn, HeatmapTooltipFn } from "../src/heatmap/types.js"
* @import { HeatmapPointSource, 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"
*
+6 -2
View File
@@ -8,7 +8,10 @@ import {
} from "./panes/chart.js";
import { init as initExplorer } from "./explorer/index.js";
import { init as initSearch } from "./panes/search.js";
import { init as initHeatmap } from "../src/heatmap/index.js";
import {
init as initHeatmap,
setOption as setHeatmapOption,
} from "../src/heatmap/index.js";
import { readStored, removeStored, writeToStorage } from "./utils/storage.js";
import {
asideElement,
@@ -153,9 +156,10 @@ function initSelected() {
element = heatmapElement;
if (firstTimeLoadingHeatmap) {
initHeatmap(option);
initHeatmap();
}
firstTimeLoadingHeatmap = false;
setHeatmapOption(option);
break;
}
+2 -7
View File
@@ -25,6 +25,7 @@ import { createNetworkSection } from "./network.js";
import { createMiningSection } from "./mining.js";
import { createCointimeSection } from "./cointime.js";
import { createInvestingSection } from "./investing.js";
import { demoHeatmapOption } from "../../src/heatmap/demo.js";
// Re-export types for external consumers
export * from "./types.js";
@@ -298,13 +299,7 @@ export function createPartialOptions() {
{
name: "Heatmaps",
tree: [
{
kind: "heatmap",
name: "Demo",
title: "Heatmap Demo",
},
],
tree: [demoHeatmapOption],
},
{
+2 -2
View File
@@ -107,14 +107,14 @@
* @typedef {Object} PartialHeatmapOptionSpecific
* @property {"heatmap"} kind
* @property {string} title
* @property {HeatmapDataSource} data
* @property {HeatmapPointSource} points
* @property {HeatmapCells} cells
* @property {HeatmapColorFn} color
* @property {HeatmapTooltipFn} [tooltip]
*
* @typedef {PartialOption & PartialHeatmapOptionSpecific} PartialHeatmapOption
*
* @typedef {Required<PartialHeatmapOption> & ProcessedOptionAddons} HeatmapOption
* @typedef {Required<Omit<PartialHeatmapOption, "tooltip">> & Pick<PartialHeatmapOption, "tooltip"> & ProcessedOptionAddons} HeatmapOption
*
* @typedef {Object} PartialUrlOptionSpecific
* @property {"link"} [kind]