chore: code formatting
This commit is contained in:
@@ -109,6 +109,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
console.debug(`metrics/compute/${login}/plugins > habits > linguist not available`)
|
console.debug(`metrics/compute/${login}/plugins > habits > linguist not available`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Generating charts with chartist
|
//Generating charts with chartist
|
||||||
@@ -126,7 +127,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
|||||||
}
|
}
|
||||||
const values = {
|
const values = {
|
||||||
labels:Object.keys(data).map(key => labels[key] ?? key),
|
labels:Object.keys(data).map(key => labels[key] ?? key),
|
||||||
series:Object.values(data)
|
series:Object.values(data),
|
||||||
}
|
}
|
||||||
if (type === "line") {
|
if (type === "line") {
|
||||||
Object.assign(options, {
|
Object.assign(options, {
|
||||||
@@ -136,7 +137,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
|||||||
showArea:true,
|
showArea:true,
|
||||||
})
|
})
|
||||||
Object.assign(values, {
|
Object.assign(values, {
|
||||||
series:[Object.values(data)]
|
series:[Object.values(data)],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return imports.chartist(type, options, values)
|
return imports.chartist(type, options, values)
|
||||||
@@ -172,4 +173,4 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
|||||||
/**Initialize an empty object with values from 0 to n */
|
/**Initialize an empty object with values from 0 to n */
|
||||||
function empty(n) {
|
function empty(n) {
|
||||||
return Object.fromEntries(new Array(n).fill(0).map((_, i) => [i, 0]))
|
return Object.fromEntries(new Array(n).fill(0).map((_, i) => [i, 0]))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user