diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ee529..56b2a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file, following t - Support for `Heatmap.createEmpty()` and setting data later - Can manipulate markers via `hm.extensions.marker?.drawMarkers({...})` +- Default coloring is "everything gray", even for numeric values ## [0.9.0] - 2024-04-29 diff --git a/src/heatmap-component/extensions/draw.ts b/src/heatmap-component/extensions/draw.ts index 52f37c3..212330b 100644 --- a/src/heatmap-component/extensions/draw.ts +++ b/src/heatmap-component/extensions/draw.ts @@ -1,6 +1,6 @@ import { clamp, isNil } from 'lodash'; import { Array2D } from '../data/array2d'; -import { Color, createColorScale } from '../data/color'; +import { Color } from '../data/color'; import { Downsampler } from '../data/downsampling'; import { Image } from '../data/image'; import { HeatmapExtension, HeatmapBehaviorBase } from '../extension'; @@ -11,7 +11,6 @@ import { Provider } from '../data/data-description'; const DefaultColor = Color.fromString('#888888'); export const DefaultColorProvider = () => DefaultColor; -export const DefaultNumericColorProviderFactory = (min: number, max: number) => createColorScale('YlOrRd', [min, max]); export interface VisualParams { diff --git a/src/heatmap-component/heatmap.ts b/src/heatmap-component/heatmap.ts index 254c285..bccd4ee 100644 --- a/src/heatmap-component/heatmap.ts +++ b/src/heatmap-component/heatmap.ts @@ -1,8 +1,7 @@ -import { Array2D } from './data/array2d'; import { Color } from './data/color'; import { DataDescription, Provider } from './data/data-description'; import { Behavior } from './extension'; -import { DefaultNumericColorProviderFactory, DrawExtension, DrawExtensionParams, VisualParams } from './extensions/draw'; +import { DrawExtension, DrawExtensionParams, VisualParams } from './extensions/draw'; import { MarkerBehavior, MarkerExtension } from './extensions/marker'; import { DefaultTooltipExtensionParams, TooltipExtension, TooltipExtensionParams } from './extensions/tooltip'; import { ZoomExtension, ZoomExtensionParams } from './extensions/zoom'; @@ -34,14 +33,9 @@ export class Heatmap extends HeatmapCore { static create(data: DataDescription): Heatmap { const heatmap = new this(data); - let colorProvider: Provider | undefined = undefined; - if (heatmap.state.dataArray.isNumeric) { - const dataRange = Array2D.getRange(heatmap.state.dataArray as Array2D); - colorProvider = DefaultNumericColorProviderFactory(dataRange.min, dataRange.max) as Provider; - } heatmap.extensions.marker = heatmap.registerExtension(MarkerExtension) as MarkerBehavior; heatmap.extensions.tooltip = heatmap.registerExtension(TooltipExtension); - heatmap.extensions.draw = heatmap.registerExtension(DrawExtension, { colorProvider }); + heatmap.extensions.draw = heatmap.registerExtension(DrawExtension); heatmap.extensions.zoom = heatmap.registerExtension(ZoomExtension); return heatmap;