-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add [PUB] popularity badge #7920
Conversation
This PR depends on #7921. |
return { | ||
label: 'popularity', | ||
message: `${Math.round(popularityScore * 100)}%`, | ||
color: 'brightgreen', |
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.
As with #7918 there is the opportunity to convey some useful information using color here rather than just make everything brightgreen
even if your score is low. Same question here really. Is there any existing community norm for what represents a "good" score we can represent here?
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.
For now, I have added the blue color for popularity scores as there are no such norms for scores.
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.
OK. Most of our rating badges are for star ratings (out of 5). Translating the splits we use there to percentages would give us
const roundedScore = Math.round(popularityScore * 100)
return {
label: 'popularity',
message: `${roundedScore}%`,
color: floorCount(roundedScore, 40, 60, 80),
}
I reckon lets go with that. It seems like popularity is a pretty straightforward scale and this will be consistent with other rating badges.
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.
Done.
PUB
to show the popularity forDart/Flutter
packages and plugins.