Skip to content

Commit

Permalink
Assign recent colors to all colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova authored Aug 13, 2021
1 parent 40afc09 commit adb935b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions source/plugins/languages/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default async function({login, data, imports, q, rest, account}, {enabled
if ((sections.includes("recently-used"))&&(context.mode === "user")) {
console.debug(`metrics/compute/${login}/plugins > languages > using recent analyzer`)
languages["stats.recent"] = await recent_analyzer({login, data, imports, rest, account}, {skipped, days:_recent_days, load:_recent_load})
Object.assign(languages.colors, languages["stats.recent"].colors)
}

//Indepth mode
Expand All @@ -76,21 +77,10 @@ export default async function({login, data, imports, q, rest, account}, {enabled
console.debug(`metrics/compute/${login}/plugins > languages > computing stats ${section}`)
languages[section] = Object.entries(stats).filter(([name]) => !ignored.includes(name.toLocaleLowerCase())).sort(([_an, a], [_bn, b]) => b - a).slice(0, limit).map(([name, value]) => ({name, value, size:value, color:languages.colors[name], x:0})).filter(({value}) => value / total > threshold)
const visible = {total:Object.values(languages[section]).map(({size}) => size).reduce((a, b) => a + b, 0)}
console.warn("DEBUG>index:77", {"languages[section]":languages[section]})
for (let i = 0; i < languages[section].length; i++) {
languages[section][i].value /= visible.total
languages[section][i].x = (languages[section][i - 1]?.x ?? 0) + (languages[section][i - 1]?.value ?? 0)
languages[section][i].lines = lines[languages[section][i].name] ?? 0
console.warn("DEBUG>index:82>", {
name:languages[section][i].name,
colorI:colors[i],
colorsNameLC:colors[languages[section][i].name.toLocaleLowerCase()],
colorsNameNoLC:colors[languages[section][i].name],
curColor__isnull:languages[section][i].color,
ifStatementColor:colors[i],
language_colors:languages.colors,
elseStatementColor:languages.colors[languages[section][i].name] ?? "#ededed"
})
if ((colors[i]) && (!colors[languages[section][i].name.toLocaleLowerCase()]))
languages[section][i].color = colors[i]
else
Expand Down

0 comments on commit adb935b

Please sign in to comment.