Skip to content

Periodic table UX improvements #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 22, 2023
Merged

Periodic table UX improvements #95

merged 12 commits into from
Oct 22, 2023

Conversation

janosh
Copy link
Owner

@janosh janosh commented Oct 22, 2023

E.g. auto-pick text color to maximize contrast with heatmap color of element tiles. Example:

ptable-elem-counts-mp

ae77997 fix invalid count_mode ValueError err msg
bc64aa7 annotate_bars add keyword adjust_test_pos: bool = False (#94)
15f6596 ptable_heatmap add keywords label_font_size: int = 16, value_font_size: int = 12
0600a76 move keyword zero_color to zero_symbol
18a6869 rename ptable_heatmap cmap keyword to colorscale
7e82aae fix ptable_heatmap_plotly only compute log_cbar if needed
9658431 ptable_heatmap_plotly improve 'Log color scale requires all heat map values to be > 1' error message
bd068e4 add special value auto_reverse for ptable_heatmap text_color (later reverted)
96e3580 count_elements auto-convert exclude_elements to list if str or tuple
e0ddbe9 ptable_heatmap add keyword tile_size: float | tuple[float, float] = 0.9
c348662 utils.py add functions luminance() and pick_bw_for_contrast()
7327af6 use pick_bw_for_contrast for auto text_color in ptable_heatmap
241aa68 ptable change default colorscale="summer_r" to "viridis"
b47815b test_utils.py add test_luminance and test_pick_bw_for_contrast

@janosh janosh added matplotlib Concerning matplotlib-powered functions ux User experience ptable Periodic table labels Oct 22, 2023
@janosh janosh temporarily deployed to github-pages October 22, 2023 23:07 — with GitHub Actions Inactive
@janosh janosh merged commit 930a544 into main Oct 22, 2023
@janosh janosh deleted the ptable-ux-improvements branch October 22, 2023 23:09
janosh added a commit that referenced this pull request Mar 28, 2025
* ptable_heatmap() add keywords label_font_size: int = 16, value_font_size: int = 12

* move keyword zero_color to zero_symbol

* rename ptable cmap keyword to colorscale

* fix ptable_heatmap_plotly only compute log_cbar if needed

* ptable_heatmap_plotly improve 'Log color scale requires all heat map values to be > 1' error message

* add special value auto_reverse for ptable_heatmap text_color

* count_elements auto-convert exclude_elements to list if str or tuple

* ptable_heatmap add keyword tile_size: float | tuple[float, float] = 0.9

* utils.py add functions luminance() and pick_bw_for_contrast()

* use pick_bw_for_contrast for auto text_color in ptable_heatmap

* ptable change default colorscale="summer_r" to "viridis"

change default zero_color="#eee" to "#eff"

* test_utils.py add test_luminance and test_pick_bw_for_contrast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
matplotlib Concerning matplotlib-powered functions ptable Periodic table ux User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant