8000 unified hover: honor layout.hoverlabel by antoinerg · Pull Request #4687 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

unified hover: honor layout.hoverlabel #4687

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 9 commits into from
Mar 26, 2020
Merged
Prev Previous commit
Next Next commit
unified hover: remove extendFlat to handle falsy value for hoverlabel
  • Loading branch information
antoinerg committed Mar 25, 2020
commit 4ef8205120ced0858f0f2e7b2afc9a2347975f1d
7 changes: 6 additions & 1 deletion src/components/fx/hoverlabel_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts
if(!opts.bgcolor && contIn.legend) opts.bgcolor = contIn.legend.bgcolor;
if(!opts.bordercolor && contIn.legend) opts.bordercolor = contIn.legend.bordercolor;
// Merge in decreasing order of importance layout.font, layout.legend.font and hoverlabel.font
opts.font = Lib.extendFlat({}, contIn.font, contIn.legend ? contIn.legend.font : {}, opts.font);

var l = contIn.legend;
if(!opts.font) opts.font = {};
if(!opts.font.size) opts.font.size = l && l.size ? l.size : contIn.font.size;
if(!opts.font.family) opts.font.family = l && l.family ? l.family : contIn.font.family;
if(!opts.font.color) opts.font.color = l && l.color ? l.color : contIn.font.color;
}

coerce('hoverlabel.bgcolor', opts.bgcolor);
Expand Down
0