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 trame-colormaps module

Note: This pull request will fail until trame-colormaps is at PyPI it is currently at trame-colormaps

QuickView previously contained ~1,400 lines of hand-rolled colormap
state management, color transfer function algorithms, log/symlog/discrete
transforms, tick computation, and colorbar/control-panel UI spread across
view_manager.py, components/view.py, app.py, utils/color.py, and
utils/math.py.

All of that functionality is now provided by the external trame-colormaps
package (pip-installable). The integration reduces to a handful of imports
and a single widget call per view:

  • ColormapController wires the VTK mapper, manages presets and range
  • create_colorbar(orientation='horizontal') renders the full colorbar
    with its popup control panel

Removed colormap functionality from:

  • view_manager.py (-800 lines): colormap state, controller wiring, range/preset logic
  • components/view.py (-209 lines): create_bottom_bar colorbar widget
  • utils/color.py (-125 lines, deleted): color transfer function helpers
  • utils/math.py (-265 lines): tick computation and scale transform math
  • app.py (-25 lines): colormap initialization and state serialization

Added:

  • pyproject.toml: trame-colormaps>=0.1.0 dependency
  • ViewConfiguration fields matching the trame-colormaps API

@patrickoleary patrickoleary requested a review from jourdain May 12, 2026 15:19
@patrickoleary patrickoleary self-assigned this May 12, 2026
QuickView previously contained ~1,400 lines of hand-rolled colormap
state management, color transfer function algorithms, log/symlog/discrete
transforms, tick computation, and colorbar/control-panel UI spread across
view_manager.py, components/view.py, app.py, utils/color.py, and
utils/math.py.

All of that functionality is now provided by the external trame-colormaps
package (pip-installable). The integration reduces to a handful of imports
and a single widget call per view:

  - ColormapController wires the VTK mapper, manages presets and range
  - create_colorbar(orientation='horizontal') renders the full colorbar
    with its popup control panel

Removed colormap functionality from:
  - view_manager.py (-800 lines): colormap state, controller wiring, range/preset logic
  - components/view.py (-209 lines): create_bottom_bar colorbar widget
  - utils/color.py (-125 lines, deleted): color transfer function helpers
  - utils/math.py (-265 lines): tick computation and scale transform math
  - app.py (-25 lines): colormap initialization and state serialization

Added:
  - pyproject.toml: trame-colormaps>=0.1.0 dependency
  - ViewConfiguration fields matching the trame-colormaps API
@patrickoleary patrickoleary force-pushed the refactor/color-module branch from cc66b4c to bdc32ec Compare May 13, 2026 21:54
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