Skip to content

refactor: extract self-contained colormaps module#98

Open
patrickoleary wants to merge 1 commit into
masterfrom
refactor/color-module
Open

refactor: extract self-contained colormaps module#98
patrickoleary wants to merge 1 commit into
masterfrom
refactor/color-module

Conversation

@patrickoleary
Copy link
Copy Markdown
Member

@patrickoleary patrickoleary commented May 12, 2026

refactor: extract self-contained colormaps module

MIGHT BE NICE to extract to trame-colormaps

Extract all colormap logic from view_manager.py and utils/ into a self-contained colormaps/ module with clean layer separation.

Core (pure ParaView/VTK/numpy — zero Trame dependency)

  • core/presets.py: preset discovery, COLORBAR_CACHE, lut_to_img()
  • core/ticks.py: tick computation for linear, log, symlog scales
  • core/transforms.py: LUT transforms (linear, log, symlog, discrete)

Server / State / Controller

  • server.py: ColormapInitialize() — one-time Trame server setup
  • state.py: ColormapConfig reactive state model with full field docs
  • controller.py: ColormapController — owns LUT, wires mapper, manages presets/range/ticks

Widgets

  • widgets/colorbar.py: colorbar strip with tick overlay and range labels
  • widgets/control_panel.py: preset picker, scale, range, discrete settings

Documentation

  • README.md: public API, dependencies, numpy justification, module structure, layer separation, widget DOM tree, config fields, usage patterns

@patrickoleary patrickoleary requested a review from jourdain May 12, 2026 15:19
@patrickoleary patrickoleary self-assigned this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants