10000 Fix `heatmap` text color and `texttemplate` on cells with missing data by archmoj · Pull Request #6924 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Fix heatmap text color an 8000 d texttemplate on cells with missing data #6924

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 6 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
avoid formatting missing data in texttemplate
  • Loading branch information
archmoj committed Mar 14, 2024
commit ff62258169802b23d92a68500a2531e0e9104870
4 changes: 3 additions & 1 deletion src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,9 @@ function templateFormatString(string, labels, d3locale) {
var fmt;
if(format[0] === ':') {
fmt = d3locale ? d3locale.numberFormat : lib.numberFormat;
value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
if(value !== '') { // e.g. skip missing data on heatmap
value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
}
}

if(format[0] === '|') {
Expand Down
Binary file modified test/image/baselines/heatmap_xyz-gaps-on-sides.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0