mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 01:13:48 +01:00
mmm matrix math yummy
This commit is contained in:
parent
af4a2f2313
commit
565630fff0
@ -43,6 +43,8 @@ const { handler: externalTooltipHandler } = useChartTooltip({
|
|||||||
position: "middle",
|
position: "middle",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const addArrays = (arr1: number[], arr2: number[], arr3: number[]) => (arr1.length === arr2.length && arr2.length === arr3.length) ? arr1.map((val, i) => val + arr2[i] + arr3[i]) : null;
|
||||||
|
|
||||||
async function renderChart() {
|
async function renderChart() {
|
||||||
if (chartInstance) {
|
if (chartInstance) {
|
||||||
chartInstance.destroy();
|
chartInstance.destroy();
|
||||||
@ -115,13 +117,7 @@ async function renderChart() {
|
|||||||
span: "day",
|
span: "day",
|
||||||
userId: $i.id,
|
userId: $i.id,
|
||||||
});
|
});
|
||||||
values = raw.diffs.normal.map((_, i) => ({
|
values = addArrays(raw.diffs.normal, raw.diffs.reply, raw.diffs.renote);
|
||||||
total:
|
|
||||||
raw.diffs.normal[i] + raw.diffs.reply[i] + raw.diffs.renote[i],
|
|
||||||
notes: raw.diffs.normal[i],
|
|
||||||
replies: raw.diffs.reply[i],
|
|
||||||
renotes: raw.diffs.renote[i],
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fetching = false;
|
fetching = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user