Skip to content

Conversation

@birsenyrtds
Copy link
Collaborator

Summary

This PR adds a modular visualization stack under src/visualization/:

  • flexvis.py: Strategy Registry + Policy architecture for heatmaps and embeddings (UMAP/PCA), including normalization, ordering/clustering, colormap scaling, and multiple plotting backends (matplotlib/plotly/plotly.express).
  • plot.py: A Dash-based demo UI that renders a heatmap and a UMAP plot with interactive controls.

Also adds requirements.txt with the required dependencies: dash, plotly, umap-learn, scikit-learn, matplotlib.

What’s included?

  • CombinedPolicy to run heatmap + UMAP in a single call.
  • Pluggable backends:
    • Heatmap: matplotlib or plotly.
    • UMAP scatter: plotly.express, plotly, or matplotlib.
  • Parametric UMAP (via policy kwargs): n_neighbors, min_dist, metric, random_state, etc.
  • Optional pre-UMAP PCA (exposed via a Dash slider) to denoise and improve cluster separation.
  • Extensible Strategy Registry: add custom normalizers/clusterers/cmap scales/reducers/plotters by simple registration.

Why?

  • Reduces duplicated code by centralizing visualization logic.
  • Provides a clean, extensible architecture for adding new methods.
  • The Dash UI enables quick iteration and fast visual feedback for parameter tuning.

How to run

pip install -r requirements.txt
python -m src.visualization.plot
# If the browser doesn't open automatically:
# http://127.0.0.1:8050

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.

1 participant