-
Notifications
You must be signed in to change notification settings - Fork 351
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
Format node/relationship counts in sidebar, inspector and legend #1008
Conversation
… created. naming needs looking at.
@@ -64,7 +65,7 @@ const createItems = ( | |||
if (showStar) { | |||
let str = '*' | |||
if (count) { | |||
str = `${str}(${count})` | |||
str = `${str}(${thousandsCommaSeparatedNumber(count)})` |
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.
I did this here as I assume we would always want to comma separate whenever createItems
is called...
* | ||
*/ | ||
|
||
export default value => |
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.
Im going to have another look at this, but the general thought process is for defensive purposes but I dont know how defensive we need to be here
parseInt
to coerce everything to numbers, but need to do theisNaN
check for null etc
It reads a bit odd anyway but open to suggestions, I will take another look in a bit
…nd rework the function with logical operators
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.
Looks good! Just want one or two more tests and then 👍
…t path, added additional tests and reworked number-to-US-locale.js to allow 0 to be output as string to be consistent with other values
…l mock for node and relationship values
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.
LGTM 🎉
would it be possible to make the formatting rendering only? so that when someone copies the number it's just the raw number? also it would be amazing to add the counts to the other labels and rel-types too |
fixes: #953