feat: scanpy UMAP support + palette= kwarg (closes #11) - #26
Open
symoon9 wants to merge 4 commits into
Open
Conversation
- Extend _continuous_artists to detect unlabeled/nolegend PathCollections (scanpy continuous UMAP with set_array()) - Extend _labeled_artists with no-legend fallback for scanpy categorical UMAP (multiple PathCollections per category, no ax.legend()) - Add palette: dict | None to _PanelCtx and studio() signature - Colors section shows "Custom" mode when palette= is provided; pre-fills Manual pickers from the palette dict Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Demonstrates categorical UMAP with palette= kwarg, continuous UMAP colormap controls, mixed figure, and the programmatic style API. Falls back to synthetic data when scanpy is not installed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…API sections Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was
linked to
issues
Apr 27, 2026
This was
unlinked from
issues
Apr 27, 2026
This was
linked to
issues
Apr 27, 2026
…ion (#29) - _artists.py: _set_artist_color preserves facecolor alpha and only syncs edgecolor when originally visible — fixes color change on scanpy scatters - _opacity.py: use facecolor RGBA as alpha source of truth for PathCollection; set_alpha(None) after to prevent double-multiplication (artist×face alpha) - colors.py: remove Smart from ToggleButtons options (code preserved) - style/_ticks.py + widget/_sections/ticks.py: new Ticks section with x/y label visibility, x-tick rotation, x/y tick interval controls - scanpy_umap.ipynb: require scanpy; drop HAS_SCANPY synthetic fallbacks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scanpy UMAP support + palette= kwarg, plus three follow-up fixes.
Core (closes #11)
_artists.py:_continuous_artistsdetects unlabeled/_nolegend_PathCollectionwithset_array()(continuous UMAP);_labeled_artistsfalls back to direct collection scan when noax.legend()(categorical UMAP)_ctx.py/_studio.py:palette: dict[str, str] | None = Noneparameter onstudio()→ forwarded to_PanelCtxcolors.py: Custom mode whenpalette=is supplied — applies label→hex mapping, pre-fills Manual pickersPathCollection color/alpha fix (closes #27)
_set_artist_color: preserves existing facecolor alpha; only syncs edgecolor when originally visible_opacity.py: reads effective alpha from facecolor RGBA channel (not artist-level) forPathCollection; clears artist-level alpha after setting to prevent double-multiplicationSmart mode hidden (closes #28)
Ticks section (closes #29)
style/_ticks.py:set_tick_labels_visible,set_xtick_rotation,set_tick_intervalwidget/_sections/ticks.py: X/Y label On/Off toggles, x-rotation slider (0°–90°, step 15°), X/Y interval text inputsNotebook
examples/scanpy_umap.ipynb: requires scanpy (removed synthetic fallback); covers categorical UMAP +palette=, continuous UMAP colormap, heatmap, violinTest plan
pytest tests/ -q)_set_artist_colorpreserves alpha; no double-alpha afterset_series_alpha🤖 Generated with Claude Code