anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes
https://github-readme-stats.vercel.app
MIT License
67.91k stars 22.25k forks source link

Stats card should resize when all metrics except the rank are hidden #1649

Closed rickstaa closed 1 year ago

rickstaa commented 2 years ago

Describe the bug

Currently, when people hide all items except the rank on the stats card, the card is not resized:

![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide=contribs,prs,stars,commits,issues)

Anurag's GitHub stats

This issue was flagged in https://github.com/anuraghazra/github-readme-stats/discussions/719 @zgosalvez.

Expected behavior

The stats card should resize to show only the rank. While fixing this bug, we should also create an error when all metrics and the rank are hidden.

image

dmdhrumilmistry commented 2 years ago

is there any way to hide rank?

rickstaa commented 2 years ago

@dmdhrumilmistry Yes, you can use the hide_Rank option (see https://github.com/anuraghazra/github-readme-stats#stats-card-exclusive-options).

[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide_rank=true)](https://github.com/anuraghazra/github-readme-stats)

Anurag's GitHub stats

I hope that helps.

dmdhrumilmistry commented 2 years ago

Thanks, It worked!

adi-uchiha commented 1 year ago

I want to work on this. Can i go ahead ?

rickstaa commented 1 year ago

@adi-uchiha, that would be great. 🚀 I assigned you to this issue. If you want this issue to count for your Hacktoberfest submission, please state it in your PR so I can tag it correctly. 👍🏻

rickstaa commented 1 year ago

@adi-uchiha How is your Hacktoberfest PR going? Feel free to let me know if you need any help or if something is unclear. No hurries.

adi-uchiha commented 1 year ago

Hey @rickstaa I am bit busy due to my college exams. If somebody comes up for this issue you can unassign me

rickstaa commented 1 year ago

@adi-uchiha No problem. Good luck with the exams 🚀. You still have seven days before Hacktoberfest ends. Feel free to ask to be reassigned if you find some time to create this PR.

Jaya-sys commented 1 year ago

Hey I want to work on this issue? Can you assign this issue to me?

rickstaa commented 1 year ago

@Jaya-sys, thanks for considering contributing to GRS! 🚀 I assigned you to this issue.

Jaya-sys commented 1 year ago

@rickstaa Hey can you explain the details like I have understood the issue if you could elaborate on the issue? Thank you

rickstaa commented 1 year ago

@Jaya-sys Yea, of course. Sorry for being unclear. This issue was flagged by @zgosalvez in https://github.com/anuraghazra/github-readme-stats/discussions/719, but I think the following was meant.

image

To create this card, the card size should be adjusted to width="290", height="180" when no stats are present. Further, the rank circle should be positioned in the middle. This can be done using transform="translate(165, 45)" instead of transform="translate(400, 25)" on the rank SVG. Lastly, the title should change to Anurag Hazra's GitHub Rank. I hope that helps! Feel free to ask if something is still unclear.

iwbc-mzk commented 1 year ago

@rickstaa I have tried to fix this problem. Please review the PR if you like. https://github.com/anuraghazra/github-readme-stats/pull/2868

rickstaa commented 1 year ago

@iwbc-mzk Amazing! I just merged it in the master branch.