Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ckiss committed Jul 5, 2017
1 parent ac2f7f4 commit 8a308a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/fx/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
valType: 'number',
min: 0,
dflt: 15,
arrayOk: true,
role: 'style',
description: 'Sets the length (in number of characters) of the hover labels for this trace'
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,9 @@ function createHoverText(hoverData, opts, gd) {
// strip out our pseudo-html elements from d.name (if it exists at all)
name = svgTextUtils.plainText(d.name || '');

if(name.length > commonLabelOpts.namelength && commonLabelOpts.namelength > 0) name = name.substr(0, commonLabelOpts.namelength - 3) + '...';
if(commonLabelOpts.namelength > 0 && name.length > commonLabelOpts.namelength) {
name = name.substr(0, commonLabelOpts.namelength - 3) + '...';
}
}

// used by other modules (initially just ternary) that
Expand Down

0 comments on commit 8a308a8

Please sign in to comment.