fix: linter

This commit is contained in:
Simon Lecoq
2023-03-15 19:42:53 -04:00
parent 479e6e9a87
commit 566ee2075b
4 changed files with 18 additions and 12 deletions

View File

@@ -126,7 +126,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
].map(({type, data, high, low, ticks, colors = null, labels = null, half = false}) => {
const width = 480 * (half ? 0.45 : 1)
const height = 160
if (type === "line")
if (type === "line")
return imports.Graph.line(Object.entries(data).map(([x, y]) => ({x:+x, y})), {low, high, ticks, labels, width, height})
console.log(data)
if (type === "pie")

View File

@@ -67,7 +67,7 @@ export default async function({login, graphql, data, imports, q, queries, accoun
let charts = _charts ? true : null
if ((["graph", "chartist"].includes(_charts_type)) && (imports.metadata.plugins.stargazers.extras("charts.type", {extras}))) {
console.debug(`metrics/compute/${login}/plugins > stargazers > generating charts`)
charts = await Promise.all([{data: total, low: total.min, high: total.max}, {data: increments, low: 0, high: increments.max, sign: true}].map(({data: {dates: set}, low, high, sign = false}) =>
charts = await Promise.all([{data: total, low: total.min, high: total.max}, {data: increments, low: 0, high: increments.max, sign: true}].map(({data: {dates: set}, low, high, sign = false}) =>
imports.Graph.timeline(Object.entries(set).map(([x, y]) => ({x:new Date(x), y, text:imports.format(y, {sign})})), {low, high,
match:(data, ticks) => data.filter(([x]) => ticks.map(t => t.toISOString().slice(0, 10)).includes(x.toISOString().slice(0, 10))),
})