mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 22:08:12 +08:00
add/fix label tooltips (#1278)
* Move tooltip to right * Change function to only return truncated string * add tooltip to category label * use position instead of PopoutPosition
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
const maybeTruncateString = (str, maxLength) => {
|
||||
|
||||
let truncatedString = null;
|
||||
if (
|
||||
str.length > maxLength
|
||||
) {
|
||||
truncatedString = `${str.slice(
|
||||
0,
|
||||
maxLength / 2
|
||||
)}…${str.slice(
|
||||
if (str.length > maxLength) {
|
||||
truncatedString = `${str.slice(0, maxLength / 2)}…${str.slice(
|
||||
-maxLength / 2
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
|
||||
return truncatedString || str;
|
||||
}
|
||||
return truncatedString;
|
||||
};
|
||||
|
||||
export default maybeTruncateString;
|
||||
export default maybeTruncateString;
|
||||
|
||||
Reference in New Issue
Block a user