yoshi389111 / github-profile-3d-contrib

This GitHub Action creates a GitHub contribution calendar on a 3D profile image.
MIT License
1.11k stars 184 forks source link

How do the contribution circle calculated? #42

Closed dukechain2333 closed 2 years ago

dukechain2333 commented 2 years ago

Hi

I am not a front-end guy so I was really surprised when I see my circle here. Most of my repos are for Python and Jupyter-notebook. I really have no idea why the other part and html part took so much space.

Could you shed some light on how those contributions are calculated?

Thanks a lot!

image

dukechain2333 commented 2 years ago

To make some contrast, contribution statics from another tool is like this, which seems more fit to my status.

image

yoshi389111 commented 2 years ago

Hi dukechain2333. Thanks for visiting my repository.

What this chart represents is which languages your commits over the past year have contributed to. It does not represent the language used in your repository.

Each commit has a target repository. Each repository has a primary language.

Each commit is calculated as a contribution to the primary language of the target repository.

This information is retrieved via GitHub's GraphQL API.

The query is as follows:

query {
  user(login: "dukechain2333") {
    contributionsCollection {
      commitContributionsByRepository(maxRepositories: 100) {
        repository {
          nameWithOwner
          primaryLanguage {
            name
          }
        }
        contributions {
          totalCount
        }
      }
    }
  }
}

Results are as follows (public only):

{
  "data": {
    "user": {
      "contributionsCollection": {
        "commitContributionsByRepository": [
          {
            "repository": {
              "nameWithOwner": "enligencelab/enligencelab.github.io",
              "primaryLanguage": {
                "name": "HTML"
              }
            },
            "contributions": {
              "totalCount": 224
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/dukechain2333",
              "primaryLanguage": null
            },
            "contributions": {
              "totalCount": 179
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/BigData-Develop-Course",
              "primaryLanguage": {
                "name": "Scala"
              }
            },
            "contributions": {
              "totalCount": 4
            }
          },
          {
            "repository": {
              "nameWithOwner": "enligencelab/.github",
              "primaryLanguage": null
            },
            "contributions": {
              "totalCount": 3
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/IBM-Data-Science-Certificate-Capstone",
              "primaryLanguage": {
                "name": "Jupyter Notebook"
              }
            },
            "contributions": {
              "totalCount": 3
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/BigData-Develop-Course-ShortPeriod",
              "primaryLanguage": {
                "name": "Scala"
              }
            },
            "contributions": {
              "totalCount": 3
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/TranslHero",
              "primaryLanguage": {
                "name": "Python"
              }
            },
            "contributions": {
              "totalCount": 3
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/EasyVocab",
              "primaryLanguage": {
                "name": "HTML"
              }
            },
            "contributions": {
              "totalCount": 3
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/HBase-Develop-Course",
              "primaryLanguage": {
                "name": "Java"
              }
            },
            "contributions": {
              "totalCount": 2
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/OperationDash",
              "primaryLanguage": {
                "name": "Python"
              }
            },
            "contributions": {
              "totalCount": 1
            }
          },
          {
            "repository": {
              "nameWithOwner": "dukechain2333/BaiduTranslate-Terminal",
              "primaryLanguage": {
                "name": "Python"
              }
            },
            "contributions": {
              "totalCount": 1
            }
          },
          {
            "repository": {
              "nameWithOwner": "liyupi/rubbish-yingxiaohao",
              "primaryLanguage": {
                "name": "JavaScript"
              }
            },
            "contributions": {
              "totalCount": 1
            }
          }
        ]
      }
    }
  }
}
Repo Contrib Lang
enligencelab/enligencelab.github.io 224 HTML
dukechain2333/dukechain2333 179 null
dukechain2333/BigData-Develop-Course 4 Scale
enligencelab/.github 3 null
dukechain2333/IBM-Data-Science-Certificate-Capstone 3 Jupyter Notebook
dukechain2333/BigData-Develop-Course-ShortPeriod 3 Scala
dukechain2333/TranslHero 3 Python
dukechain2333/EasyVocab 3 HTML
dukechain2333/HBase-Develop-Course 2 Java
dukechain2333/OperationDash 1 Python
dukechain2333/BaiduTranslate-Terminal 1 Python
liyupi/rubbish-yingxiaohao 1 JavaScript
dukechain2333 commented 2 years ago

That helps a lot. Thank you