github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

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

Open rickstaa opened this issue 4 years ago • 12 comments

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

rickstaa avatar Mar 16 '22 06:03 rickstaa

is there any way to hide rank?

dmdhrumilmistry avatar Jun 08 '22 20:06 dmdhrumilmistry

@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.

rickstaa avatar Jun 09 '22 19:06 rickstaa

Thanks, It worked!

dmdhrumilmistry avatar Jun 10 '22 08:06 dmdhrumilmistry

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

adi-uchiha avatar Oct 01 '22 19:10 adi-uchiha

@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 avatar Oct 01 '22 20:10 rickstaa

@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.

rickstaa avatar Oct 21 '22 22:10 rickstaa

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

adi-uchiha avatar Oct 22 '22 05:10 adi-uchiha

@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.

rickstaa avatar Oct 24 '22 07:10 rickstaa

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

Jaya-sys avatar Oct 25 '22 14:10 Jaya-sys

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

rickstaa avatar Oct 25 '22 19:10 rickstaa

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

Jaya-sys avatar Oct 26 '22 15:10 Jaya-sys

@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.

rickstaa avatar Oct 27 '22 07:10 rickstaa

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

iwbc-mzk avatar Jun 21 '23 11:06 iwbc-mzk

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

rickstaa avatar Jun 22 '23 10:06 rickstaa