github-profile-3d-contrib icon indicating copy to clipboard operation
github-profile-3d-contrib copied to clipboard

Feature Request: Separate contribution plot and language breakdown

Open EleoXDA opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. I love your 3D contribution graph. My request is kinda simple. Is it possible to make 2 separate images for the radar chart and pie chart for ReadMe?

Describe the solution you'd like I would like to be able to add radar chart and pie chart separately without a contribution graph.

Describe alternatives you've considered A separate workflow that can add radar chart and pie chart separately

Additional context Explanation in screenshots IMG_20220713_132449 IMG_20220714_003159.jpg

EleoXDA avatar Jul 13 '22 11:07 EleoXDA

Hi EleoXDA. Thank you for your proposal.

I made the following changes In version 0.7.0.

  • #35
  • #36
  • #39
[
  {
    "type": "pie_lang_only",
    "fileName": "pie_lang_only.svg",
    "backgroundColor": "#ffffff",
    "foregroundColor": "#00000f"
  },
  {
    "type": "radar_contrib_only",
    "fileName": "radar_contrib_only.svg",
    "backgroundColor": "#ffffff",
    "foregroundColor": "#00000f",
    "weakColor": "gray",
    "radarColor": "#47a042"
  }
]

yoshi389111 avatar Aug 09 '22 23:08 yoshi389111

Thanks very much. One question though. We need to add custom settings into profile-3d.yml. What should it have to get only pie chart for example? Is this correct?

SETTING_JSON: ${{ pie_lang_only }}

EleoXDA avatar Aug 11 '22 04:08 EleoXDA

Add the configuration file to your repository. For example, create it with the name conf/setting.json .

{
  "type": "pie_lang_only",
  "fileName": "pie_lang_only.svg",
  "backgroundColor": "#ffffff",
  "foregroundColor": "#00000f"
}

Please refer to sample-settings/*.json for how to write the configuration file.

In the yaml file, define the path of the above configuration file in the environment variable SETTING_JSON .

  name: GitHub-Profile-3D-Contrib
  
  on:
    schedule: # 03:00 JST == 18:00 UTC
      - cron: "0 18 * * *"
    workflow_dispatch:
  
  jobs:
    build:
      runs-on: ubuntu-latest
      name: generate-github-profile-3d-contrib
      steps:
        - uses: actions/checkout@v2
        - uses: yoshi389111/[email protected]
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            USERNAME: ${{ github.repository_owner }}
+           SETTING_JSON : conf/setting.json
        - name: Commit & Push
          run: |
            git config user.name github-actions
            git config user.email [email protected]
            git add -A .
            git commit -m "generated"
            git push

yoshi389111 avatar Aug 11 '22 13:08 yoshi389111

Thanks again, I just tried with your setup and it resulted with this SVG image (profile_customize.svg). Is this expected? https://github.com/EleoXDA/EleoXDA/blob/main/profile-3d-contrib/profile-customize.svg

EleoXDA avatar Aug 11 '22 18:08 EleoXDA

Please use version 0.7.0.

  name: GitHub-Profile-3D-Contrib
  
  on:
    schedule: # 03:00 JST == 18:00 UTC
      - cron: "0 18 * * *"
    workflow_dispatch:
  
  jobs:
    build:
      runs-on: ubuntu-latest
      name: generate-github-profile-3d-contrib
      steps:
        - uses: actions/checkout@v2
-       - uses: yoshi389111/[email protected]
+       - uses: yoshi389111/[email protected]
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            USERNAME: ${{ github.repository_owner }}
            SETTING_JSON : conf/setting.json
        - name: Commit & Push
          run: |
            git config user.name github-actions
            git config user.email [email protected]
            git add -A .
            git commit -m "generated"
            git push

yoshi389111 avatar Aug 11 '22 22:08 yoshi389111

Ah perfect, now works fine! One last question:

  • Is it possible to make both radar_commit and pie_lang separately? I tried to join in settings.json with a comma:
  {
    "type": "pie_lang_only",
    "fileName": "pie_lang_only.svg",
    "backgroundColor": "#ffffff",
    "foregroundColor": "#000000"
  },
  {
    "type": "radar_contrib_only",
    "fileName": "radar_contrib_only.svg",
    "backgroundColor": "#ffffff",
    "foregroundColor": "#000000",
    "weakColor": "gray",
    "radarColor": "#47a042"
  }

But it gave an error at comma:

SyntaxError: Unexpected token , in JSON at position 140
Error: error
    at JSON.parse (<anonymous>)
    at Object.readSettingJson (/home/runner/work/_actions/yoshi389111/github-profile-3d-contrib/0.[7](https://github.com/EleoXDA/EleoXDA/runs/7801258951?check_suite_focus=true#step:3:8).0/dist/index.js:1559:17)
    at Object.main (/home/runner/work/_actions/yoshi3[8](https://github.com/EleoXDA/EleoXDA/runs/7801258951?check_suite_focus=true#step:3:9)[9](https://github.com/EleoXDA/EleoXDA/runs/7801258951?check_suite_focus=true#step:3:10)111/github-profile-3d-contrib/0.7.0/dist/index.js:15[10](https://github.com/EleoXDA/EleoXDA/runs/7801258951?check_suite_focus=true#step:3:11):35)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

EleoXDA avatar Aug 12 '22 06:08 EleoXDA

To specify more than one, enclose them all in [ and ].

See sample-settings/multiple.json .

yoshi389111 avatar Aug 12 '22 17:08 yoshi389111