-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Hover label namelength #1822
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
Hover label namelength #1822
Changes from 1 commit
e7aeee4
8abf2ea
ac2f7f4
8a308a8
94f660a
e937519
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,11 +57,18 @@ module.exports = { | |
color: extendFlat({}, fontAttrs.color) | ||
}, | ||
namelength: { | ||
valType: 'number', | ||
min: 0, | ||
valType: 'integer', | ||
min: -1, | ||
dflt: 15, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't you need to remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept only the global default, because the trace-level default inherits from the global so doesn't use a default of its own. You're right that we want a default - in fact, we need a default of 15 to preserve backward compatibility - this is just how that default gets propagated. |
||
role: 'style', | ||
description: 'Sets the length (in number of characters) of the hover labels for this trace' | ||
description: [ | ||
'Sets the default length (in number of characters) of the trace name in', | ||
'the hover labels for all traces. -1 shows the whole name', | ||
'regardless of length. 0-3 shows the first 0-3 characters, and', | ||
'an integer >3 will show the whole name if it is less than that', | ||
'many characters, but if it is longer, will truncate to', | ||
'`namelength - 3` characters and add an ellipsis.' | ||
].join(' ') | ||
} | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try adding
arrayOk
support here, so thatwould work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #1761 for an example on how to proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call - at first I was worried that this would just be confusing to look at ("I thought this was the same trace, why does it have a different name?") but it could actually come in handy for example if you vary the hover label font size, a bigger one may need more truncation of the name 👍