Skip to content

Commit

Permalink
language ring bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gh0stintheshe11 committed Oct 30, 2024
1 parent aed44f0 commit 15e034d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.env
package-lock.json
README.md
package-lock.json
6 changes: 4 additions & 2 deletions src/render/render_github.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ async function calculateImagePosition(dimensions, language_ring_radius, language
}

async function renderLanguageRing(languagePercentages, languageRingConfig, elementsConfig) {
const totalSegments = languagePercentages.length;
// Take only top 20 languages
const topLanguages = languagePercentages.slice(0, 20);
const totalSegments = topLanguages.length;
let accumulatedOffset = 0;
let accumulatedPercentage = 0;

return languagePercentages.map((languageData, index) => {
return topLanguages.map((languageData, index) => {
const { name: language, percentage: value, color } = languageData;
accumulatedPercentage += value;

Expand Down

0 comments on commit 15e034d

Please sign in to comment.