Runs a full Pareto (80/20) analysis over a list of items.
Steps: project each item to a number → sort descending → accumulate the cumulative share → classify each contributor as vital or trivial.
vital
trivial
The contributors to analyze (e.g. customers, products, rows).
How to read the ranking number from each item.
Optional
ParetoOptions controlling the split.
A ParetoResult with per-item classification and totals.
The input array is not mutated; items are copied before sorting.
const result = pareto(customers, (c) => c.revenue);const topCustomers = result.items.filter((i) => i.class === 'vital'); Copy
const result = pareto(customers, (c) => c.revenue);const topCustomers = result.items.filter((i) => i.class === 'vital');
Runs a full Pareto (80/20) analysis over a list of items.
Steps: project each item to a number → sort descending → accumulate the cumulative share → classify each contributor as
vitalortrivial.