Docs: Update benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 23:31:52 +00:00
parent 341252fec1
commit 5855cf8a6f
76 changed files with 967 additions and 1046 deletions
@@ -0,0 +1,19 @@
export const processCSV = async (csvString, { filterColumn, filterValue, groupBy, aggregateColumn, operation }) => {
const [{ csvParse }, { rollup, sum, mean }] = await Promise.all([
import('https://esm.sh/d3-dsv'),
import('https://esm.sh/d3-array')
]);
const getValue = d => +(d[aggregateColumn]) || 0;
const grouped = rollup(
csvParse(csvString).filter(row => row[filterColumn] == filterValue),
group => operation === 'count'
? group.length
: (operation === 'sum' ? sum : mean)(group, getValue),
row => row[groupBy]
);
return Array.from(grouped, ([key, result]) => ({ [groupBy]: key, result }));
};
export default processCSV;