Skip to content
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 pie chart layout to language card #2099

Merged
merged 22 commits into from
May 9, 2023
Merged

add pie chart layout to language card #2099

merged 22 commits into from
May 9, 2023

Conversation

arndom
Copy link
Contributor

@arndom arndom commented Oct 3, 2022

Added pie chart layout to language card, with some updates in the test script and readme.
I wasn't clear about the hide functionality so I left it out for now
Should resolve #1650

EDIT (rickstaa): This should be merged after #1046 is merged.

@vercel
Copy link

vercel bot commented Oct 3, 2022

@arndom is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@rickstaa
Copy link
Collaborator

rickstaa commented Oct 3, 2022

Great PR. I think this PR will be a great addition to the GRS ecosystem.

image

However, we might have to scale it down a bit since the card looks a bit large. I will take a look later.

Added pie chart layout to language card, with some updates in the test script and readme. I wasn't clear about the hide functionality so I left it out for now Should resolve #1650

The hide parameter is not needed with your implementation. For now, could you take a look at why the tests are failing (see https://github.com/anuraghazra/github-readme-stats/actions/runs/3172876819/jobs/5167845593)? I suspect it is because you are not waiting for some asynchronous action.

@arndom
Copy link
Contributor Author

arndom commented Oct 3, 2022

Thanks. I'll have a look at the failing tests later in the day, and maybe the scaling down as well.

@rickstaa
Copy link
Collaborator

rickstaa commented Oct 3, 2022

Great, thanks again! I think the most important thing is that the card should look nice next to the other cards and doesn't appear too big when the maximum number of languages is used.

image

image

Maybe we should limit the max number of languages when the pie chart is used. @anuraghazra, what do you think?

@arndom
Copy link
Contributor Author

arndom commented Oct 8, 2022

@rickstaa I've resolved the failing tests and scaled down the chart, left the decision of limiting languages up to you

readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 8, 2022

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.54 ⚠️

Comparison is base (daa1977) 97.35% compared to head (f1c67a5) 96.82%.

❗ Current head f1c67a5 differs from pull request most recent head e118943. Consider uploading reports for the commit e118943 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2099      +/-   ##
==========================================
- Coverage   97.35%   96.82%   -0.54%     
==========================================
  Files          24       22       -2     
  Lines        4311     4000     -311     
  Branches      393      344      -49     
==========================================
- Hits         4197     3873     -324     
- Misses        112      125      +13     
  Partials        2        2              
Impacted Files Coverage Δ
src/cards/top-languages-card.js 100.00% <100.00%> (ø)

... and 19 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@rickstaa rickstaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace JSDOM and d3 with pure javascript.

@rickstaa rickstaa mentioned this pull request Oct 11, 2022
@rickstaa
Copy link
Collaborator

@arndom Feel free to request my review if you have finished applying the requested changes to this PR 👍🏻.

@arndom arndom requested a review from rickstaa October 15, 2022 15:05
@arndom arndom requested review from anuraghazra and removed request for rickstaa October 21, 2022 06:54
@rickstaa
Copy link
Collaborator

@anuraghazra This PR now looks good to me. You can review and merge it later. There are two things we have to decide on before this can be merged:

  • Whether we want to rename the layout to doughnut or keep it as pie.
  • Whether we want to limit the number of languages on the Pie layout to 5 instead of 10.

@arndom
Copy link
Contributor Author

arndom commented Oct 24, 2022

@rickstaa Wow, that's some refactor, makes things easier to follow and the tests are pretty detailed, thanks

@rickstaa
Copy link
Collaborator

@anuraghazra This PR now looks good to me. You can review and merge it later. There are two things we have to decide on before this can be merged:

  • Whether we want to rename the layout to doughnut or keep it as pie.
  • Whether we want to limit the number of languages on the Pie layout to 5 instead of 10.

@anuraghazra I fixed this in f1c67a5. The pie chart is now correctly aligned for 5-10 languages.

image

image

image

@rickstaa
Copy link
Collaborator

@rickstaa Wow, that's some refactor, makes things easier to follow and the tests are pretty detailed, thanks

No problem. Thanks again for your pull request. I also added f1c67a5 to fix the pie chart align problem when more than 5 languages are used. Feel free to check it out.

@rickstaa rickstaa self-assigned this Jan 9, 2023
@rickstaa
Copy link
Collaborator

rickstaa commented Jan 10, 2023

@anuraghazra If you want another excellent PR to merge, I think this one should be it. One of our most requested features (see #1935). 🚀 Only thing that can still be added are animations for this new layout (See #1046). 🤔

@rickstaa
Copy link
Collaborator

rickstaa commented May 6, 2023

@arndom I just wanted to review your pull request again so that it can be merged. I, however, noticed that:

I will merge this pull request if those issues are fixed 👍🏻.

@arndom
Copy link
Contributor Author

arndom commented May 7, 2023

Alright @rickstaa I will make the changes

@rickstaa
Copy link
Collaborator

rickstaa commented May 7, 2023

Alright @rickstaa I will make the changes

Thanks, no rush. Please let me know when I have to review 👍🏻.

@github-actions github-actions bot added the documentation Improvements or additions to documentation. label May 9, 2023
@arndom
Copy link
Contributor Author

arndom commented May 9, 2023

Hey @rickstaa, I've made the changes

@rickstaa
Copy link
Collaborator

rickstaa commented May 9, 2023

Hey @rickstaa, I've made the changes

Great work. Thanks again! Will merge when tests are done 👍🏻.

@rickstaa rickstaa merged commit c5e7f7b into anuraghazra:master May 9, 2023
@rickstaa
Copy link
Collaborator

rickstaa commented May 9, 2023

@arndom merged. You can now use this on the main branch 🚀.

LucienZhang pushed a commit to LucienZhang/github-readme-stats that referenced this pull request Jun 5, 2023
* add pie chart layout to language card

* resolve failing top-lang card tests

* scale down pie chart

* update readme.md

* Update readme.md

Co-authored-by: Rick Staa <[email protected]>

* style: format code

* update donut layout to be created without dependencies

* minor update

* style: format readme

* resolve failing tests

* refactor: clean up code and add extra tests

This commit cleans up the pie chart generation code and adds additional
tests.

* feat: improve pie chart positioning

* rename layout pie to donut

* add animation to donut layout

* refactor: rename pie and doughnut to donut

* feat: decrease donus animation delay

---------

Co-authored-by: rickstaa <[email protected]>
devantler pushed a commit to devantler/github-readme-stats that referenced this pull request Sep 24, 2023
* add pie chart layout to language card

* resolve failing top-lang card tests

* scale down pie chart

* update readme.md

* Update readme.md

Co-authored-by: Rick Staa <[email protected]>

* style: format code

* update donut layout to be created without dependencies

* minor update

* style: format readme

* resolve failing tests

* refactor: clean up code and add extra tests

This commit cleans up the pie chart generation code and adds additional
tests.

* feat: improve pie chart positioning

* rename layout pie to donut

* add animation to donut layout

* refactor: rename pie and doughnut to donut

* feat: decrease donus animation delay

---------

Co-authored-by: rickstaa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation. hacktoberfest hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pie chart style to language card
3 participants