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

feat: Hide Wakatime languages #1212

Merged

Conversation

Morphclue
Copy link
Contributor

@Morphclue Morphclue commented Jul 27, 2021

Description

I've added a new query-parameter hide to hide specific languages you don't want to display. This was also requested in #1138.
Because some values will be hidden I've recalculated the percentages to correctly display the percentage of each language (they add up back to ~100%, values are rounded).

Code

  • Added hide param in wakatime.js and wakatime-card.js
  • Added a method that recalculates the percentages for each item

Types of changes

  • Enhancement
  • Refactor

Reference

The following cards are an example using this new feature.

Full Card

image

Javascript, Python, CSV and Testing hidden

image

@vercel
Copy link

vercel bot commented Jul 27, 2021

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

A member of the Team first needs to authorize it.

@Morphclue Morphclue marked this pull request as draft July 27, 2021 14:46
@Morphclue Morphclue marked this pull request as ready for review July 27, 2021 14:53
Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
@github-actions github-actions bot added the doc-translation README doc translations. label Aug 27, 2021
@anuraghazra anuraghazra changed the base branch from master to updated-theme-readme August 27, 2021 19:03
@anuraghazra anuraghazra changed the base branch from updated-theme-readme to master August 27, 2021 19:03
@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #1212 (a841f3c) into master (8f31634) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1212      +/-   ##
==========================================
+ Coverage   94.18%   94.27%   +0.08%     
==========================================
  Files          22       22              
  Lines         705      716      +11     
  Branches      195      197       +2     
==========================================
+ Hits          664      675      +11     
  Misses         37       37              
  Partials        4        4              
Impacted Files Coverage Δ
src/cards/top-languages-card.js 100.00% <100.00%> (ø)
src/cards/wakatime-card.js 98.75% <100.00%> (+0.19%) ⬆️
src/common/utils.js 97.67% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f31634...a841f3c. Read the comment docs.

@anuraghazra
Copy link
Owner

Hi @Morphclue thanks for the PR and sorry for the delay. I've done some changes and we can merge this now. :)

@anuraghazra anuraghazra merged commit 1a3edca into anuraghazra:master Aug 27, 2021
@Morphclue Morphclue deleted the feature/hide-wakatime-language branch August 28, 2021 08:27
@Morphclue
Copy link
Contributor Author

Hi @Morphclue thanks for the PR and sorry for the delay. I've done some changes and we can merge this now. :)

No problem! Thanks for having a look and improving the code.

developStorm pushed a commit to developStorm/github-readme-stats that referenced this pull request Dec 4, 2021
* docs: better navigation in readme (anuraghazra#1196)

* docs(cn): replace error picture (anuraghazra#1217)

env name should be PAT_1, but on the picture is GITHUB_TOKEN

* docs: fix grammar (anuraghazra#1242)

* fix: subfolder support for api_domain wakatime api (anuraghazra#1235)

* docs(theme): Auto update theme readme (anuraghazra#1263)

* feat: hide wakatime languages (anuraghazra#1212)

* feat: added option to hide languages

* feat: recalculate percentages for hidden languages

* refactor: reverted langs_count and did some formatting

* doc: added hide to readme

* feat: make languages var mutable and improve filter logic

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>

* refactor: improve code and added tests

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>

* fix: text overlap (anuraghazra#1207)

* feat(statCard): added more concise description

* fix: removed isLongLocale param

* Revert "fix: removed isLongLocale param"

This reverts commit 55f1e2d.

* feat: add de and nl to longLocal to fix padding

* chore: grammar error on CONTRIBUTING.md (anuraghazra#1272)

* chore: update funding link (anuraghazra#1289)

* chore: revert total stars naming

* chore: change `total stars` to `total stars earned` (anuraghazra#1293)

* docs: replace '?theme' with '&theme' (anuraghazra#1307)

* style(theme): added aura_dark themes (anuraghazra#1312)

* feat(layout): improve flexLayout & fixed layout overlaps (anuraghazra#1314)

* feat(layout): improve flexLayout & fixed layout overlaps

* chore: fix vercel build

* chore: added under-the-hood blogpost link in contributing.md

* style(theme): added panda theme (anuraghazra#1319)

* refactor: refactor repo card (anuraghazra#1325)

* refactor: refactored repo-card

* test: fix tests

* test: fixed tests

* fix: unprovided description error

* chore: update theme preview bot content (anuraghazra#1326)

* Change default stats card width with hide rank

* Add tests for stats card with card_width

* Add card_width Stats Card description to readme

* docs: match link with section title (anuraghazra#1341)

* Match link with section title

Match the link of Top Languages Card with the title of his section ("Tarjeta de Lenguajes Principales").

* Fix typo

* style(theme): added cobalt2 theme (anuraghazra#1343)

* style(theme): added noctis minimus theme (anuraghazra#1342)

* Add Noctis minimus theme

* Add Noctis minimus theme

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* chore: fix grammatical errors in the scripts (anuraghazra#1346)

* Fix grammatical errors

* Fix grammatical errors

* chore: reduce vercel memory & timeout duration (anuraghazra#1366)

* fix: change serverless function memory to 128mb

* chore: change maxDuration

* fix: wakatime card translations (anuraghazra#1363)

* refactor: jsdoc in utils & minor changes (anuraghazra#1377)

* refactor: jsdoc in utils & minor changes

* chore: jsdoc Card class

* chore: jsdoc for getStyles

* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)

* Revert "ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)"

This reverts commit 2723f00.

* chore: remove action cache

* style(theme): add gruvbox_light theme (anuraghazra#1379)

* docs(theme): Auto update theme readme (anuraghazra#1384)

Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>

* fix: word-wrap bug (anuraghazra#1378)

* Fixed word-wrap bug

* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)

* Revert "ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)"

This reverts commit 2723f00.

* chore: remove action cache

* chore: minor change

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>

* fix: hotfix for graphql api error (anuraghazra#1409)

* docs: add fork instructions (anuraghazra#1418)

* docs: add fork instructions

* chore: revert toc

* fix: add icon width to stats-card min width calculation

* fix: fixes rank circle padding problem

This commit fixes a padding problem that was introduced in
f9c0e0b. In the new code, the padding
around the rank circle will be 50 when the stats card is bigger than
450. When it is smaller than 450 the left and right padding will shrink
equally.

* fix: bug where wakatime api returns undefined languages (anuraghazra#1403)

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>

* style(themes): aura theme (anuraghazra#1423)

* style(theme): added swift theme (anuraghazra#1395)

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* docs(theme): Auto update theme readme (anuraghazra#1440)

Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>

* feat(script): improved theme preview script (anuraghazra#1439)

* feat: improved theme preview script

* chore: add getPRNumber

* feat(theme-preview): added ability to upsert comments (anuraghazra#1442)

* chore: added ability upsert comments

* chore: new event

* chore: update github action trigger

* chore: remove edit event from action

* chore(deps): update axios to 0.24.0 (axios/axios#3410) (anuraghazra#1446)

* style: improve code structure

* fix: fix stats and language tests

* style(theme): add apprentice theme (anuraghazra#1466)

* fix: auth token header (anuraghazra#1474)

* feat(stats): add 'not_bold' option to stats card

* fix: decrease maxduration

Co-authored-by: OldWizard209 <68309049+OldWizard209@users.noreply.github.com>
Co-authored-by: XUQING <xuqing@mail.xqinger.com>
Co-authored-by: 김예환 Ye-Hwan Kim (Sam) <43813340+yehwankim23@users.noreply.github.com>
Co-authored-by: Alexandro Perez <apgfriend@gmail.com>
Co-authored-by: Masahiro Furudate <178inaba.git@gmail.com>
Co-authored-by: Julian Holfeld <julianholfeld@student.uni-kassel.de>
Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>
Co-authored-by: Philip Jake <philip@cldsi.de>
Co-authored-by: Moe Bachrouch <54571275+moebachrouch@users.noreply.github.com>
Co-authored-by: Horeb Parraud <44978959+HorebParraud@users.noreply.github.com>
Co-authored-by: Chandrika Deb <chandrikadeb7@gmail.com>
Co-authored-by: Artem Kostiuk <postatum@gmail.com>
Co-authored-by: Danix <78866931+Danix421@users.noreply.github.com>
Co-authored-by: Red Headphone <55500003+RedHeadphone@users.noreply.github.com>
Co-authored-by: Anant Mishra <84588156+Anant-mishra1729@users.noreply.github.com>
Co-authored-by: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com>
Co-authored-by: Julián Sanmartino <jjsanmartino03@gmail.com>
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
Co-authored-by: Michael Schnerring <3743342+schnerring@users.noreply.github.com>
Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>
Co-authored-by: Markus Tyrkkö <Marcholio@users.noreply.github.com>
Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
Co-authored-by: Tuhana GAYRETLİ <tuhana@tuta.io>
Co-authored-by: Eduardo Santi <santieduardo@users.noreply.github.com>
Co-authored-by: Abhijith N T <abhijithnt64@gmail.com>
Co-authored-by: Çınar Yılmaz <79412062+Camroku@users.noreply.github.com>
developStorm added a commit to developStorm/github-readme-stats that referenced this pull request Dec 4, 2021
* docs: better navigation in readme (anuraghazra#1196)

* docs(cn): replace error picture (anuraghazra#1217)

env name should be PAT_1, but on the picture is GITHUB_TOKEN

* docs: fix grammar (anuraghazra#1242)

* fix: subfolder support for api_domain wakatime api (anuraghazra#1235)

* docs(theme): Auto update theme readme (anuraghazra#1263)

* feat: hide wakatime languages (anuraghazra#1212)

* feat: added option to hide languages

* feat: recalculate percentages for hidden languages

* refactor: reverted langs_count and did some formatting

* doc: added hide to readme

* feat: make languages var mutable and improve filter logic

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>

* refactor: improve code and added tests

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>

* fix: text overlap (anuraghazra#1207)

* feat(statCard): added more concise description

* fix: removed isLongLocale param

* Revert "fix: removed isLongLocale param"

This reverts commit 55f1e2d.

* feat: add de and nl to longLocal to fix padding

* chore: grammar error on CONTRIBUTING.md (anuraghazra#1272)

* chore: update funding link (anuraghazra#1289)

* chore: revert total stars naming

* chore: change `total stars` to `total stars earned` (anuraghazra#1293)

* docs: replace '?theme' with '&theme' (anuraghazra#1307)

* style(theme): added aura_dark themes (anuraghazra#1312)

* feat(layout): improve flexLayout & fixed layout overlaps (anuraghazra#1314)

* feat(layout): improve flexLayout & fixed layout overlaps

* chore: fix vercel build

* chore: added under-the-hood blogpost link in contributing.md

* style(theme): added panda theme (anuraghazra#1319)

* refactor: refactor repo card (anuraghazra#1325)

* refactor: refactored repo-card

* test: fix tests

* test: fixed tests

* fix: unprovided description error

* chore: update theme preview bot content (anuraghazra#1326)

* docs: match link with section title (anuraghazra#1341)

* Match link with section title

Match the link of Top Languages Card with the title of his section ("Tarjeta de Lenguajes Principales").

* Fix typo

* style(theme): added cobalt2 theme (anuraghazra#1343)

* style(theme): added noctis minimus theme (anuraghazra#1342)

* Add Noctis minimus theme

* Add Noctis minimus theme

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* chore: fix grammatical errors in the scripts (anuraghazra#1346)

* Fix grammatical errors

* Fix grammatical errors

* chore: reduce vercel memory & timeout duration (anuraghazra#1366)

* fix: change serverless function memory to 128mb

* chore: change maxDuration

* fix: wakatime card translations (anuraghazra#1363)

* refactor: jsdoc in utils & minor changes (anuraghazra#1377)

* refactor: jsdoc in utils & minor changes

* chore: jsdoc Card class

* chore: jsdoc for getStyles

* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)

* Revert "ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)"

This reverts commit 2723f00.

* chore: remove action cache

* style(theme): add gruvbox_light theme (anuraghazra#1379)

* docs(theme): Auto update theme readme (anuraghazra#1384)

Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>

* fix: word-wrap bug (anuraghazra#1378)

* Fixed word-wrap bug

* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)

* Revert "ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (anuraghazra#1382)"

This reverts commit 2723f00.

* chore: remove action cache

* chore: minor change

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>

* fix: hotfix for graphql api error (anuraghazra#1409)

* docs: add fork instructions (anuraghazra#1418)

* docs: add fork instructions

* chore: revert toc

* fix: bug where wakatime api returns undefined languages (anuraghazra#1403)

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>

* style(themes): aura theme (anuraghazra#1423)

* style(theme): added swift theme (anuraghazra#1395)

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* docs(theme): Auto update theme readme (anuraghazra#1440)

Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>

* feat(script): improved theme preview script (anuraghazra#1439)

* feat: improved theme preview script

* chore: add getPRNumber

* feat(theme-preview): added ability to upsert comments (anuraghazra#1442)

* chore: added ability upsert comments

* chore: new event

* chore: update github action trigger

* chore: remove edit event from action

* chore(deps): update axios to 0.24.0 (axios/axios#3410) (anuraghazra#1446)

* style(theme): add apprentice theme (anuraghazra#1466)

* fix: auth token header (anuraghazra#1474)

* Include all repo w/ access to

* parameterize affiliation

* Use GraphQL variable syntax

* Custom ownerAffiliations for general stats

* Add default affiliation

* style: improve code structure

Co-authored-by: OldWizard209 <68309049+OldWizard209@users.noreply.github.com>
Co-authored-by: XUQING <xuqing@mail.xqinger.com>
Co-authored-by: 김예환 Ye-Hwan Kim (Sam) <43813340+yehwankim23@users.noreply.github.com>
Co-authored-by: Alexandro Perez <apgfriend@gmail.com>
Co-authored-by: Masahiro Furudate <178inaba.git@gmail.com>
Co-authored-by: Julian Holfeld <julianholfeld@student.uni-kassel.de>
Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>
Co-authored-by: Philip Jake <philip@cldsi.de>
Co-authored-by: Moe Bachrouch <54571275+moebachrouch@users.noreply.github.com>
Co-authored-by: Horeb Parraud <44978959+HorebParraud@users.noreply.github.com>
Co-authored-by: Chandrika Deb <chandrikadeb7@gmail.com>
Co-authored-by: Danix <78866931+Danix421@users.noreply.github.com>
Co-authored-by: Red Headphone <55500003+RedHeadphone@users.noreply.github.com>
Co-authored-by: Anant Mishra <84588156+Anant-mishra1729@users.noreply.github.com>
Co-authored-by: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com>
Co-authored-by: Julián Sanmartino <jjsanmartino03@gmail.com>
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
Co-authored-by: Michael Schnerring <3743342+schnerring@users.noreply.github.com>
Co-authored-by: Github Readme Stats Bot <no-reply@githubreadmestats.com>
Co-authored-by: Markus Tyrkkö <Marcholio@users.noreply.github.com>
Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
Co-authored-by: Tuhana GAYRETLİ <tuhana@tuta.io>
Co-authored-by: Eduardo Santi <santieduardo@users.noreply.github.com>
Co-authored-by: Abhijith N T <abhijithnt64@gmail.com>
Co-authored-by: Çınar Yılmaz <79412062+Camroku@users.noreply.github.com>
Co-authored-by: Raymond Nook <59678453+developStorm@users.noreply.github.com>
Kab1r pushed a commit to Kab1r/github-readme-stats that referenced this pull request Apr 4, 2022
* feat: added option to hide languages

* feat: recalculate percentages for hidden languages

* refactor: reverted langs_count and did some formatting

* doc: added hide to readme

* feat: make languages var mutable and improve filter logic

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>

* refactor: improve code and added tests

Co-authored-by: Adrian Kunz <clashsoft@hotmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>
@ricardocardoso-dev
Copy link

how to use this feature?

@Morphclue
Copy link
Contributor Author

@ricardocardoso-dev You can use the &hide= param to exclude the languages you don't want to see (comma-separated) as documented in the README.md.

Full List: https://github-readme-stats.vercel.app/api/wakatime?username=Morphclue
Some languages that should be excluded: https://github-readme-stats.vercel.app/api/wakatime?username=Morphclue&hide=Java,Tex,R,GDScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-translation README doc translations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants