Skip to content

21 hover font color - #22

Merged
TammoReinders merged 6 commits into
mainfrom
21_hover_font_color
May 19, 2026
Merged

21 hover font color#22
TammoReinders merged 6 commits into
mainfrom
21_hover_font_color

Conversation

@stjeske

@stjeske stjeske commented May 8, 2026

Copy link
Copy Markdown
Contributor

Updated hover panels with improved color contrast and built-in sorting feature to move selected/highlighted/reference subgroups to the top

- add white border to hover/wellpanel
- change hover panel font/font-color/background color for better readability
-remove "List of" prefix when more than one subgroup is in hover range
-remove bullet points in hover panel and reduce space between subgroups
-remove SGID from hover
-use "font_color" function for labels to ensure readability when background color is bright
-remove bold font
-Updated hover panels with improved color contrast

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates hover panels (graph + bubble) to improve color contrast by dynamically selecting a readable font color and adds sorting so highlighted/selected/reference-like entries appear first in the hover list.

Changes:

  • Compute contrasting label/hover text colors based on point/fill color.
  • Rework hover HTML generation to include inline styling (font/background colors) and sort entries so highlighted ones appear at the top.
  • Adjust hover panel styling (e.g., border) in the graph module.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
R/mod_graph.R Adds computed label font colors and rewrites hover panel HTML/styling + sorting.
R/mod_bubble.R Rewrites hover panel HTML/styling + sorting to improve readability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/mod_graph.R
Comment on lines 752 to 760
style <- paste0(
"position:absolute;
z-index:100; pointer-events:none; background-color: rgba(",
grDevices::col2rgb(ColorBGplot())[1],",",
grDevices::col2rgb(ColorBGplot())[2],",",
grDevices::col2rgb(ColorBGplot())[3],",0.95); ",
"left:", left_px, "px; top:", top_px, "px; border: 0px;"
"left:", left_px, "px; top:", top_px, "px;
border: 1px solid #ffffff;"
)
Comment thread R/mod_graph.R Outdated
Comment thread R/mod_graph.R
":",
!!rlang::sym(y()),
"</br>",
tmp$text,
Comment thread R/mod_graph.R
Comment on lines +779 to +801
background_color = dplyr::case_when(
substr(ColorPoints(),1,7) != substr(font.col, 1,7) ~ substr(font.col, 1,7),
substr(ColorPoints(),1,7) == substr(font.col, 1,7) ~ ""
),
) %>%
dplyr::rowwise() %>%
dplyr::mutate(
font.col2 = dplyr::case_when(
substr(ColorPoints(),1,7) != substr(font.col, 1,7) ~ font_color(font.col),
substr(ColorPoints(),1,7) == substr(font.col, 1,7) ~ substr(font.col,1,7)
)
) %>%
dplyr::ungroup() %>%
dplyr::mutate(
html_text = paste0(
"<p style = 'color: ",
font.col2,
"; background-color:",
background_color,
"; border-color: #000; border-style: solid; border-width: 0.1px",
";'> ",
x(),
":",
Comment thread R/mod_bubble.R
background_color = dplyr::case_when(
substr(ColorPoints(),1,7) != substr(font.col, 1,7) ~ substr(font.col, 1,7),
substr(ColorPoints(),1,7) == substr(font.col, 1,7) ~ ""
),
Comment thread R/mod_bubble.R
!!rlang::sym(x()),
", ",
"</br>",
tmp$text,
Comment thread R/mod_bubble.R
Comment on lines +428 to +448
background_color = dplyr::case_when(
substr(ColorPoints(),1,7) != substr(font.col, 1,7) ~ substr(font.col, 1,7),
substr(ColorPoints(),1,7) == substr(font.col, 1,7) ~ ""
),
) %>%
dplyr::rowwise() %>%
dplyr::mutate(
font.col2 = dplyr::case_when(
substr(ColorPoints(),1,7) != substr(font.col, 1,7) ~ font_color(font.col),
substr(ColorPoints(),1,7) == substr(font.col, 1,7) ~ substr(font.col,1,7)
)
) %>%
dplyr::ungroup() %>%
dplyr::mutate(
html_text = paste0(
"<p style = 'color: ",
.data$font.col2,
"; background-color:",
.data$background_color,
"; border-color: #000; border-style: solid; border-width: 0.1px",
";'> ",
stjeske and others added 3 commits May 12, 2026 12:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@TammoReinders TammoReinders left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality of new color and sorting on hover tested. Everything works as intended.

@TammoReinders
TammoReinders merged commit 391438a into main May 19, 2026
8 checks passed
@TammoReinders
TammoReinders deleted the 21_hover_font_color branch May 19, 2026 11:31
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.

Font in hover window can be hard to read for specifc colors & Font of labels is not readable on bright colors

3 participants