Skip to content

Commit 652f210

Browse files
committed
feat: Update default colormap to 'turbo' and enhance colormap documentation
1 parent 6ca48ff commit 652f210

2 files changed

Lines changed: 23 additions & 19 deletions

File tree

dvue/animator/multi_ui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class MultiGeoAnimatorManager(pn.viewable.Viewer):
283283
# ------------------------------------------------------------------
284284
vmin: Optional[float] = param.Number(default=None, allow_None=True)
285285
vmax: Optional[float] = param.Number(default=None, allow_None=True)
286-
colormap: str = param.Selector(default="rainbow", objects=CURATED_COLORMAPS)
286+
colormap: str = param.Selector(default="turbo", objects=CURATED_COLORMAPS)
287287
size: float = param.Number(default=6.0, bounds=(1.0, 50.0))
288288
show_diff: bool = param.Boolean(
289289
default=False, doc="Show A−B diff map instead of side-by-side."
@@ -305,7 +305,7 @@ def __init__(
305305
title_a: str = "Study A",
306306
title_b: str = "Study B",
307307
geo_id_column: str = "geo_id",
308-
colormap: str = "rainbow",
308+
colormap: str = "turbo",
309309
vmin=None,
310310
vmax=None,
311311
size: float = 6.0,

dvue/animator/ui.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,35 @@
3838

3939
# Flat list used by param.Selector for validation.
4040
CURATED_COLORMAPS: list[str] = [
41-
# Sequential — single-hue / perceptually uniform
42-
"viridis",
43-
"plasma",
44-
"inferno",
45-
"magma",
46-
"Blues",
47-
"YlOrRd",
48-
"turbo",
49-
"rainbow",
41+
# Sequential — perceptually uniform, colorblind-safe (recommended)
42+
"viridis", # perceptually uniform; safe for all dichromacy types
43+
"plasma", # warm alternative; high discrimination
44+
"cividis", # optimized specifically for deuteranopia (Nuñez et al. 2018)
45+
"inferno", # high contrast on dark backgrounds
46+
"magma", # high contrast on dark backgrounds
47+
# Sequential — domain-intuitive
48+
"cet_fire", # black→blue→orange→white; dark=fresh, bright=saline (EC)
49+
"cet_CET_L2", # blue→green→yellow; strong water-level intuition
50+
"Blues", # water-blue association; not perceptually uniform
51+
"YlOrRd", # warm; intuitive for heat / conductivity
52+
# Sequential — high-contrast (not colorblind-safe)
53+
"turbo", # good contrast; not perceptually uniform; not colorblind-safe
5054
# Diverging — two-hue, centred on a neutral midpoint
51-
"coolwarm",
52-
"RdBu_r",
53-
"RdYlBu_r",
54-
"PiYG",
55-
"bwr",
56-
"seismic",
55+
"coolwarm", # best general-purpose diverging; perceptually symmetric
56+
"RdBu_r", # blue=negative/upstream, red=positive/downstream convention
57+
"RdYlBu_r", # yellow midpoint aids near-zero discrimination
58+
"cet_CET_D9", # blue→yellow→red; colorblind-accessible diverging
59+
"PiYG", # pink/green; useful for anomaly-style differences
5760
]
5861

5962
# Flat list for pn.widgets.Select that includes a visual separator.
6063
# The separator string is not a valid colormap — callbacks guard against it.
6164
_COLORMAP_SEPARATOR = "── Diverging ──"
6265
CURATED_COLORMAPS_WITH_SEP: list = [
63-
"viridis", "plasma", "inferno", "magma", "Blues", "YlOrRd", "turbo", "rainbow",
66+
"viridis", "plasma", "cividis", "inferno", "magma",
67+
"cet_fire", "cet_CET_L2", "Blues", "YlOrRd", "turbo",
6468
_COLORMAP_SEPARATOR,
65-
"coolwarm", "RdBu_r", "RdYlBu_r", "PiYG", "bwr", "seismic",
69+
"coolwarm", "RdBu_r", "RdYlBu_r", "cet_CET_D9", "PiYG",
6670
]
6771

6872
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)