d3_array library

d3-array 3.2.4 in native, fully statically typed Dart with no Flutter import (ADR 0011, D3 ADR 0017).

Exports every pure file of the port without show/hide combinators so it compiles for the Dart VM, AOT, JavaScript, and WebAssembly with zero runtime dependencies.

Classes

Adder
A full-precision IEEE-754 floating-point adder implementing Shewchuk's adaptive summation algorithm.
Bin<T>
A histogram bin containing elements of type T within [x0, x1).
BinGenerator<T>
A configurable, callable histogram bin generator for elements of type T.
Bisector<T, X>
A typed binary-search bisector over lists of T searched by keys of X.
Blur2Data
A 2D scalar grid for blur2.
BlurImageData
An RGBA pixel buffer for blurImage.
InternMap<K, V, I>
A typed Map that canonicalizes keys using a projection key from K to I, retaining the first K inserted for each canonical key I.
InternSet<T, I>
A typed Set that canonicalizes values using a projection key from T to I, retaining the first T inserted for each canonical key I.
Shuffler
A callable generic Fisher-Yates shuffler parameterized by a uniform random source returning doubles in [0, 1).

Constants

d3ArrayVersion → const String
The pinned upstream version of d3-array.

Functions

arrayConstant<T>(T x) → T Function()
Returns a function that always returns x.
arrayIdentity<T>(T x) → T
Returns x unchanged.
arrayNumber(num? x) → double
Converts a nullable numeric value x to double, returning double.nan for null.
arrayNumbers(Iterable<num?> values) → Iterable<double>
Yields non-null, non-NaN numeric values from values as double.
arrayNumbersBy<T>(Iterable<T> values, num? valueof(T value)) → Iterable<double>
Yields non-null, non-NaN numeric values extracted from values via valueof.
arrayNumbersByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → Iterable<double>
Yields non-null, non-NaN numeric values extracted from values via indexed valueof.
arraySlice<T>(List<T> list, [int start = 0, int? end]) → List<T>
Returns a shallow copy of list, optionally sliced from start to end.
ascending<T extends Comparable<Object>>(T? a, T? b) → double
Returns -1 if a is less than b, 1 if a is greater than b, 0 if equal, or double.nan if either value is null or NaN.
ascendingComparator<T extends Comparable<Object>>() → double Function(T? a, T? b)
Reference export kept for callers referencing ascending via sort.dart.
ascendingDefined<T extends Comparable<Object>>(T? a, T? b) → int
Total-order ascending comparator placing null and NaN values at the end.
ascendingDefinedDouble(double a, double b) → int
Fast ascending comparator for double values placing NaN at the end.
bin<T extends num?>({BinDomainAccessor? domain, BinThresholdCount? thresholdsCount, BinThresholdValues? thresholdsValues}) → BinGenerator<T>
Creates a numeric BinGenerator with default identity value, extent domain, and thresholdSturges thresholds.
binBy<T>(num? value(T value), {BinDomainAccessor? domain, BinThresholdCount? thresholdsCount, BinThresholdValues? thresholdsValues}) → BinGenerator<T>
Creates a BinGenerator for arbitrary data of type T using a 1-arg numeric value accessor.
binByIndexed<T>(BinValueAccessor<T> value, {BinDomainAccessor? domain, BinThresholdCount? thresholdsCount, BinThresholdValues? thresholdsValues}) → BinGenerator<T>
Creates a BinGenerator for arbitrary data of type T using an indexed numeric value accessor.
bisect<T extends Comparable<Object>>(List<T?> a, T? x, [int lo = 0, int? hi]) → int
Alias for bisectRight.
bisectCenter(List<num?> a, num? x, [int lo = 0, int? hi]) → int
Returns the index of the numeric value closest to x in sorted a.
bisectCenterDate(List<DateTime?> a, DateTime? x, [int lo = 0, int? hi]) → int
Returns the index of the DateTime closest to x in sorted a.
bisectLeft<T extends Comparable<Object>>(List<T?> a, T? x, [int lo = 0, int? hi]) → int
Returns the insertion point for x in sorted a before any existing equal entries.
bisector<T, X extends Comparable<Object>>(X? accessor(T d), {double delta(X? a, X? b)?}) → Bisector<T, X>
Creates a Bisector using a typed key accessor.
bisectorComparator<T>(num compare(T a, T b)) → Bisector<T, T>
Creates a Bisector using a symmetric comparator compare(a, b).
bisectorCompare<T, X>(num compare(T d, X x), {bool isDefined(X x)?}) → Bisector<T, X>
Creates a Bisector using an asymmetric comparator compare(d, x).
bisectorNullable<T, X extends Comparable<Object>>(X? accessor(T d), {double delta(X? a, X? b)?}) → Bisector<T, X?>
Creates a Bisector using a typed nullable key accessor.
bisectRight<T extends Comparable<Object>>(List<T?> a, T? x, [int lo = 0, int? hi]) → int
Returns the insertion point for x in sorted a after any existing equal entries.
blur(List<double> values, double r) → List<double>
Blurs values in-place with an approximate Gaussian kernel of radius r (3 box-blur passes) and returns values.
blur2(Blur2Data data, double rx, [double? ry]) → Blur2Data
Blurs a 2D scalar grid data in-place with horizontal radius rx and vertical radius ry (defaulting to rx) and returns data.
blurImage(BlurImageData data, double rx, [double? ry]) → BlurImageData
Blurs an RGBA image buffer data in-place with horizontal radius rx and vertical radius ry (defaulting to rx) and returns data.
clampBinIndex(int i, int m) → int
Ensures math import is used cleanly for bounds clamping if needed.
compareDefined<T>(num compare(T a, T b)) → int Function(T a, T b)
Promotes a partial comparator compare (which may return double.nan for unorderable elements) into a total-order comparator compatible with List.sort, placing unorderable elements at the end.
count(Iterable<num?> values) → int
Returns the number of valid (non-null, non-NaN) numeric values in values.
countBy<T>(Iterable<T> values, num? valueof(T value)) → int
Returns the number of valid numeric values extracted from values using valueof.
countByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → int
Returns the number of valid numeric values extracted from values using indexed valueof.
cross<A, B>(Iterable<A> a, Iterable<B> b) → List<(A, B)>
Returns the Cartesian product of a and b as (A, B) records.
cross3<A, B, C>(Iterable<A> a, Iterable<B> b, Iterable<C> c) → List<(A, B, C)>
Returns the 3-way Cartesian product of a, b, and c as (A, B, C) records.
cross3With<A, B, C, R>(Iterable<A> a, Iterable<B> b, Iterable<C> c, R reduce(A a, B b, C c)) → List<R>
Returns the 3-way Cartesian product of a, b, and c mapped through reduce.
crossAll<T>(Iterable<Iterable<T>> iterables) → List<List<T>>
Returns the homogeneous N-way Cartesian product of iterables.
crossAllWith<T, R>(Iterable<Iterable<T>> iterables, R reduce(List<T> tuple)) → List<R>
Returns the homogeneous N-way Cartesian product of iterables mapped through reduce.
crossWith<A, B, R>(Iterable<A> a, Iterable<B> b, R reduce(A a, B b)) → List<R>
Returns the Cartesian product of a and b mapped through reduce.
cumsum(Iterable<num?> values) → Float64List
Returns the cumulative sum of values as a Float64List of the same length, treating null and NaN as 0.0.
cumsumBy<T>(Iterable<T> values, num? valueof(T value)) → Float64List
Returns the cumulative sum of values extracted from values using valueof as a Float64List.
cumsumByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → Float64List
Returns the cumulative sum of values extracted from values using indexed valueof as a Float64List.
descending<T extends Comparable<Object>>(T? a, T? b) → double
Returns -1 if b is less than a, 1 if b is greater than a, 0 if equal, or double.nan if either value is null or NaN.
deviation(Iterable<num?> values) → double?
Returns the sample standard deviation (square root of variance) of values, or null if fewer than 2 valid numbers exist.
deviationBy<T>(Iterable<T> values, num? valueof(T value)) → double?
Returns the sample standard deviation of values extracted from values using valueof.
deviationByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double?
Returns the sample standard deviation of values extracted from values using indexed valueof.
difference<T>(Iterable<T> values, Iterable<Iterable<T>> others) → Set<T>
Returns a new Set containing every distinct value in values that does not appear in any iterable of others.
difference2<T>(Iterable<T> a, Iterable<T> b) → Set<T>
Returns a new Set containing every distinct value in a that is not in b.
disjoint<T>(Iterable<T> values, Iterable<T> other) → bool
Returns true if values and other have no shared elements (lazily consuming other until a match is found).
every<T>(Iterable<T> values, bool test(T value, int index, Iterable<T> values)) → bool
Returns true if test returns true for every element of values.
extent<T extends Comparable<Object>>(Iterable<T?> values) → (T, T)?
Returns the (min, max) record of values using natural order, ignoring null and NaN, or null if no valid comparable value exists.
extentBy<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value)) → (K, K)?
Returns the (min, max) record of values extracted from values using valueof, or null if no valid comparable value exists.
extentByIndexed<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → (K, K)?
Returns the (min, max) record of values extracted from values using indexed valueof, or null if no valid comparable value exists.
fcumsum(Iterable<num?> values) → Float64List
Returns the full-precision cumulative sum of values as a Float64List.
fcumsumBy<T>(Iterable<T> values, num? valueof(T value)) → Float64List
Returns the full-precision cumulative sum of values extracted from values using valueof as a Float64List.
fcumsumByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → Float64List
Returns the full-precision cumulative sum of values extracted from values using indexed valueof as a Float64List.
filter<T>(Iterable<T> values, bool test(T value, int index, Iterable<T> values)) → List<T>
Returns a new List containing the elements of values for which test returns true.
flatGroup<T, K>(Iterable<T> values, K key(T value)) → List<(K, List<T>)>
Returns a flat list of (key, group) records (1-level flatGroup).
flatGroup2<T, K1, K2>(Iterable<T> values, K1 key1(T value), K2 key2(T value)) → List<(K1, K2, List<T>)>
Groups values by key1 and key2 into flat (key1, key2, group) records.
flatGroup3<T, K1, K2, K3>(Iterable<T> values, K1 key1(T value), K2 key2(T value), K3 key3(T value)) → List<(K1, K2, K3, List<T>)>
Groups values by key1, key2, key3 into flat (key1, key2, key3, group) records.
flatRollup<T, K, R>(Iterable<T> values, R reduce(List<T> group), K key(T value)) → List<(K, R)>
Returns a flat list of (key, reduced) records (1-level flatRollup).
flatRollup2<T, K1, K2, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value)) → List<(K1, K2, R)>
Groups values by key1 and key2, reduces each leaf group with reduce, and returns flat (key1, key2, reduced) records.
flatRollup3<T, K1, K2, K3, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value), K3 key3(T value)) → List<(K1, K2, K3, R)>
Groups values by key1, key2, and key3, reduces each leaf group with reduce, and returns flat (key1, key2, key3, reduced) records.
fsum(Iterable<num?> values) → double
Returns a full-precision summation of values, ignoring null and NaN.
fsumBy<T>(Iterable<T> values, num? valueof(T value)) → double
Returns a full-precision summation of values extracted from values using valueof.
fsumByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double
Returns a full-precision summation of values extracted from values using indexed valueof.
greatest<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → T?
Returns the greatest element of values according to compare (defaulting to ascending), or null if no comparable element exists.
greatestBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → T?
Returns the element of values with the greatest key extracted by accessor, or null if no valid comparable key exists.
greatestIndex<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → int
Returns the index of the greatest element of values according to compare (defaulting to ascending), or -1 if no comparable element exists.
greatestIndexBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → int
Returns the index of the element of values with the greatest key extracted by accessor, or -1 if no valid comparable key exists.
greatestIndexWith<T>(Iterable<T> values, num compare(T a, T b)) → int
Returns the index of the greatest element of values according to compare, or -1 if no comparable element exists.
greatestWith<T>(Iterable<T> values, num compare(T a, T b)) → T?
Returns the greatest element of values according to compare, or null if no comparable element exists.
group<T, K>(Iterable<T> values, K key(T value)) → Map<K, List<T>>
Groups values into a Map keyed by key, preserving insertion order.
group2<T, K1, K2>(Iterable<T> values, K1 key1(T value), K2 key2(T value)) → Map<K1, Map<K2, List<T>>>
Groups values into a 2-level nested Map keyed by key1, then key2.
group3<T, K1, K2, K3>(Iterable<T> values, K1 key1(T value), K2 key2(T value), K3 key3(T value)) → Map<K1, Map<K2, Map<K3, List<T>>>>
Groups values into a 3-level nested Map keyed by key1, key2, key3.
groupIndexed<T, K>(Iterable<T> values, K key(T value, int index, Iterable<T> values)) → Map<K, List<T>>
Groups values using an indexed key accessor (value, index, values).
groups<T, K>(Iterable<T> values, K key(T value)) → List<(K, List<T>)>
Groups values by key and returns (key, group) entries.
groups2<T, K1, K2>(Iterable<T> values, K1 key1(T value), K2 key2(T value)) → List<(K1, List<(K2, List<T>)>)>
Groups values into a 2-level nested entry list keyed by key1, then key2.
groups3<T, K1, K2, K3>(Iterable<T> values, K1 key1(T value), K2 key2(T value), K3 key3(T value)) → List<(K1, List<(K2, List<(K3, List<T>)>)>)>
Groups values into a 3-level nested entry list keyed by key1, key2, key3.
groupsIndexed<T, K>(Iterable<T> values, K key(T value, int index, Iterable<T> values)) → List<(K, List<T>)>
Groups values by indexed key and returns (key, group) entries.
groupSort<T, K extends Comparable<Object>, R extends Comparable<Object>>(Iterable<T> values, R? reduce(List<T> group), K key(T value)) → List<K>
Groups values by key, reduces each group with reduce, and returns the keys sorted in ascending order of the reduced value (tie-breaking by ascending key).
groupSortCompare<T, K extends Comparable<Object>>(Iterable<T> values, num compare(List<T> a, List<T> b), K key(T value)) → List<K>
Groups values by key and returns the keys sorted according to compare on the grouped element lists (tie-breaking by ascending key).
histogram<T extends num?>({BinDomainAccessor? domain, BinThresholdCount? thresholdsCount, BinThresholdValues? thresholdsValues}) → BinGenerator<T>
Deprecated alias for bin.
index<T, K>(Iterable<T> values, K key(T value)) → Map<K, T>
Indexes values into a Map by unique key, throwing StateError on duplicate keys.
index2<T, K1, K2>(Iterable<T> values, K1 key1(T value), K2 key2(T value)) → Map<K1, Map<K2, T>>
Indexes values into a 2-level Map keyed by key1, then unique key2.
index3<T, K1, K2, K3>(Iterable<T> values, K1 key1(T value), K2 key2(T value), K3 key3(T value)) → Map<K1, Map<K2, Map<K3, T>>>
Indexes values into a 3-level Map keyed by key1, key2, and unique key3.
indexes<T, K>(Iterable<T> values, K key(T value)) → List<(K, T)>
Indexes values by unique key and returns (key, value) entries.
indexes2<T, K1, K2>(Iterable<T> values, K1 key1(T value), K2 key2(T value)) → List<(K1, List<(K2, T)>)>
Indexes values into a 2-level entry list keyed by key1, then unique key2.
indexes3<T, K1, K2, K3>(Iterable<T> values, K1 key1(T value), K2 key2(T value), K3 key3(T value)) → List<(K1, List<(K2, List<(K3, T)>)>)>
Indexes values into a 3-level entry list keyed by key1, key2, and unique key3.
indexesIndexed<T, K>(Iterable<T> values, K key(T value, int index, Iterable<T> values)) → List<(K, T)>
Indexes values by unique indexed key and returns (key, value) entries.
indexIndexed<T, K>(Iterable<T> values, K key(T value, int index, Iterable<T> values)) → Map<K, T>
Indexes values into a Map by unique indexed key.
intersection<T>(Iterable<T> values, Iterable<Iterable<T>> others) → Set<T>
Returns a new Set containing every distinct value in values that also appears in every iterable of others.
intersection2<T>(Iterable<T> a, Iterable<T> b) → Set<T>
Returns a new Set containing every distinct value present in both a and b.
least<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → T?
Returns the least element of values according to compare (defaulting to ascending), or null if no comparable element exists.
leastBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → T?
Returns the element of values with the least key extracted by accessor, or null if no valid comparable key exists.
leastIndex<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → int
Returns the index of the least element of values according to compare (defaulting to ascending), or -1 if no comparable element exists.
leastIndexBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → int
Returns the index of the element of values with the least key extracted by accessor, or -1 if no valid comparable key exists.
leastIndexWith<T>(Iterable<T> values, num compare(T a, T b)) → int
Returns the index of the least element of values according to compare, or -1 if no comparable element exists.
leastWith<T>(Iterable<T> values, num compare(T a, T b)) → T?
Returns the least element of values according to compare, or null if no comparable element exists.
map<T, R>(Iterable<T> values, R mapper(T value, int index, Iterable<T> values)) → List<R>
Returns a new List containing the mapped values of values produced by mapper.
max<T extends Comparable<Object>>(Iterable<T?> values) → T?
Returns the maximum value in values using natural order, ignoring null and NaN, or null if no valid value exists.
maxBy<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value)) → K?
Returns the maximum value extracted from values using valueof.
maxByIndexed<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → K?
Returns the maximum value extracted from values using indexed valueof.
maxIndex<T extends Comparable<Object>>(Iterable<T?> values) → int
Returns the index of the maximum value in values using natural order, ignoring null and NaN, or -1 if no valid value exists.
maxIndexBy<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value)) → int
Returns the index of the maximum value extracted from values using valueof, or -1 if no valid value exists.
maxIndexByIndexed<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → int
Returns the index of the maximum value extracted from values using indexed valueof, or -1 if no valid value exists.
mean(Iterable<num?> values) → double?
Returns the arithmetic mean of values, ignoring null and NaN, or null if values contains no valid numbers.
meanBy<T>(Iterable<T> values, num? valueof(T value)) → double?
Returns the arithmetic mean of numeric values extracted from values using valueof.
meanByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double?
Returns the arithmetic mean of numeric values extracted from values using indexed valueof.
median(Iterable<num?> values) → double?
Returns the median (0.5-quantile) of values using the R-7 method, ignoring null and NaN, or null if no valid numbers exist.
medianBy<T>(Iterable<T> values, num? valueof(T value)) → double?
Returns the median of numeric values extracted from values using valueof.
medianByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double?
Returns the median of numeric values extracted from values using indexed valueof.
medianIndex(List<num?> values) → int?
Returns the index of the median element of values, or -1 if no valid value exists.
medianIndexBy<T>(List<T> values, num? valueof(T value)) → int?
Returns the index of the median element of values using valueof.
medianIndexByIndexed<T>(List<T> values, num? valueof(T value, int index, List<T> values)) → int?
Returns the index of the median element of values using indexed valueof.
merge<T>(Iterable<Iterable<T>> iterables) → List<T>
Merges the specified iterables into a single flat List.
min<T extends Comparable<Object>>(Iterable<T?> values) → T?
Returns the minimum value in values using natural order, ignoring null and NaN, or null if no valid value exists.
minBy<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value)) → K?
Returns the minimum value extracted from values using valueof.
minByIndexed<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → K?
Returns the minimum value extracted from values using indexed valueof.
minIndex<T extends Comparable<Object>>(Iterable<T?> values) → int
Returns the index of the minimum value in values using natural order, ignoring null and NaN, or -1 if no valid value exists.
minIndexBy<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value)) → int
Returns the index of the minimum value extracted from values using valueof, or -1 if no valid value exists.
minIndexByIndexed<T, K extends Comparable<Object>>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → int
Returns the index of the minimum value extracted from values using indexed valueof, or -1 if no valid value exists.
mode<T>(Iterable<T?> values) → T?
Returns the mode (most frequent value) of values, ignoring null and NaN. Ties are broken by first appearance. Returns null if no valid values exist.
modeBy<T, K>(Iterable<T> values, K? valueof(T value)) → K?
Returns the mode of values extracted from values using valueof.
modeByIndexed<T, K>(Iterable<T> values, K? valueof(T value, int index, Iterable<T> values)) → K?
Returns the mode of values extracted from values using indexed valueof.
nice(num start, num stop, num count) → (double, double)
Returns a nicely-rounded (start, stop) interval extending [start, stop] to clean tick multiples for approximately count ticks.
pair<T>(T a, T b) → (T, T)
Returns the 2-tuple record (a, b).
pairs<T>(Iterable<T> values) → List<(T, T)>
Returns a list of adjacent pairs (previous, current) from values.
pairsWith<T, R>(Iterable<T> values, R pairof(T a, T b)) → List<R>
Returns a list of adjacent pairs from values combined using pairof.
permute<T>(List<T> source, Iterable<int> keys) → List<T>
Returns a permutation of source using the specified integer keys.
permuteMap<K, V>(Map<K, V> source, Iterable<K> keys) → List<V?>
Returns a permutation of values from source map for the specified keys.
permuteNullable<T>(List<T> source, Iterable<int> keys) → List<T?>
Returns a permutation of source using integer keys, producing null for out-of-range indices (matching JavaScript array indexing).
quantile(Iterable<num?> values, double p) → double?
Returns the p-quantile of values using the R-7 method (p in [0, 1]), ignoring null and NaN, or null if no valid numbers exist or p is NaN.
quantileBy<T>(Iterable<T> values, double p, num? valueof(T value)) → double?
Returns the p-quantile of numeric values extracted from values using valueof.
quantileByIndexed<T>(Iterable<T> values, double p, num? valueof(T value, int index, Iterable<T> values)) → double?
Returns the p-quantile of numeric values extracted from values using indexed valueof.
quantileIndex(List<num?> values, double p) → int?
Returns the index of the element corresponding to the p-quantile of values, null if p is NaN, or -1 if no valid value exists.
quantileIndexBy<T>(List<T> values, double p, num? valueof(T value)) → int?
Returns the index of the element corresponding to the p-quantile of values using valueof.
quantileIndexByIndexed<T>(List<T> values, double p, num? valueof(T value, int index, List<T> values)) → int?
Returns the index of the element corresponding to the p-quantile of values using indexed valueof.
quantileSorted(List<num?> values, double p) → double?
Returns the p-quantile of already-sorted numeric values without copying or partitioning.
quantileSortedBy<T>(List<T> values, double p, num? valueof(T value)) → double?
Returns the p-quantile of already-sorted values using valueof.
quantileSortedByIndexed<T>(List<T> values, double p, num? valueof(T value, int index, List<T> values)) → double?
Returns the p-quantile of already-sorted values using indexed valueof.
quickselect<T extends Comparable<Object>>(List<T> array, int k, [int left = 0, int? right, num compare(T a, T b)?]) → List<T>
Rearranges elements in array in-place between left and right (inclusive) such that array[k] is in its sorted position, all elements before k are <= array[k], and all elements after k are >= array[k].
quickselectFloat64NoNaN(Float64List array, int k, int left, int right) → void
Fast internal Floyd-Rivest selection on a Float64List guaranteed to contain no NaN values.
quickselectNullable<T extends Comparable<Object>>(List<T?> array, int k, [int left = 0, int? right, num compare(T? a, T? b)?]) → List<T?>
Rearranges nullable elements in array in-place placing null and NaN elements last.
quickselectWith<T>(List<T> array, int k, num compare(T a, T b), [int left = 0, int? right]) → List<T>
Rearranges elements in array in-place according to compare.
range(num start, [num? stop, num? step]) → List<double>
Returns a list of an arithmetic progression of numbers starting at start (inclusive) up to stop (exclusive) in increments of step.
rank<T extends Comparable<Object>>(Iterable<T> values, [num compare(T a, T b)?]) → Float64List
Returns a Float64List with the competition rank of each element in values (defaulting to ascending), with double.nan for unorderable elements.
rankBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → Float64List
Returns a Float64List with the competition rank of each element in values ordered by ascending key accessor.
rankNullable<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → Float64List
Returns a Float64List with the competition rank of each nullable element in values, assigning double.nan to null and NaN elements.
rankWith<T>(Iterable<T> values, num compare(T a, T b)) → Float64List
Returns a Float64List with the competition rank of each element in values according to compare.
reduce<T, R>(Iterable<T> values, R reducer(R accumulator, T value, int index, Iterable<T> values), R initialValue) → R
Applies reducer against an accumulator initialized to initialValue and each element of values to reduce it to a single value of type R.
reduceFirst<T>(Iterable<T> values, T reducer(T accumulator, T value, int index, Iterable<T> values)) → T?
Applies reducer to values using the first element as initial accumulator, or returns null if values is empty.
reverse<T>(Iterable<T> values) → List<T>
Returns a new List containing the elements of values in reverse order without mutating values.
rollup<T, K, R>(Iterable<T> values, R reduce(List<T> group), K key(T value)) → Map<K, R>
Groups values by key and reduces each group with reduce.
rollup2<T, K1, K2, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value)) → Map<K1, Map<K2, R>>
Groups values by key1 and key2 and reduces each leaf group with reduce.
rollup3<T, K1, K2, K3, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value), K3 key3(T value)) → Map<K1, Map<K2, Map<K3, R>>>
Groups values by key1, key2, and key3 and reduces each leaf group with reduce.
rollupIndexed<T, K, R>(Iterable<T> values, R reduce(List<T> group), K key(T value, int index, Iterable<T> values)) → Map<K, R>
Groups values by indexed key and reduces each group with reduce.
rollups<T, K, R>(Iterable<T> values, R reduce(List<T> group), K key(T value)) → List<(K, R)>
Groups values by key, reduces each group with reduce, and returns (key, value) entries.
rollups2<T, K1, K2, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value)) → List<(K1, List<(K2, R)>)>
Groups values by key1 and key2, reduces each leaf group with reduce, and returns nested entry lists.
rollups3<T, K1, K2, K3, R>(Iterable<T> values, R reduce(List<T> group), K1 key1(T value), K2 key2(T value), K3 key3(T value)) → List<(K1, List<(K2, List<(K3, R)>)>)>
Groups values by key1, key2, and key3, reduces each leaf group with reduce, and returns nested entry lists.
rollupsIndexed<T, K, R>(Iterable<T> values, R reduce(List<T> group), K key(T value, int index, Iterable<T> values)) → List<(K, R)>
Groups values by indexed key, reduces each group with reduce, and returns (key, value) entries.
scan<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → int?
Deprecated alias for leastIndex returning null instead of -1 when no comparable element exists.
scanWith<T>(Iterable<T> values, num compare(T a, T b)) → int?
Deprecated comparator form of scan for arbitrary types T.
shuffle<T>(List<T> array, [int i0 = 0, int? i1]) → List<T>
Randomizes the order of array in-place over [i0, i1) using the Fisher-Yates shuffle and returns array.
shuffler(double random()) → Shuffler
Returns a Shuffler backed by the specified random generator.
some<T>(Iterable<T> values, bool test(T value, int index, Iterable<T> values)) → bool
Returns true if test returns true for at least one element of values.
sort<T extends Comparable<Object>>(Iterable<T> values, [num compare(T a, T b)?]) → List<T>
Returns a sorted copy of values in ascending natural order (or using compare), placing NaN values last.
sortBy<T, K extends Comparable<Object>>(Iterable<T> values, K? accessor(T value)) → List<T>
Returns a sorted copy of values ordered by ascending key accessor, placing null and NaN keys last while preserving stability.
sortBy2<T, K1 extends Comparable<Object>, K2 extends Comparable<Object>>(Iterable<T> values, K1? key1(T value), K2? key2(T value)) → List<T>
Returns a sorted copy of values ordered by key1, then key2.
sortBy3<T, K1 extends Comparable<Object>, K2 extends Comparable<Object>, K3 extends Comparable<Object>>(Iterable<T> values, K1? key1(T value), K2? key2(T value), K3? key3(T value)) → List<T>
Returns a sorted copy of values ordered by key1, then key2, then key3.
sortByAll<T, K extends Comparable<Object>>(Iterable<T> values, List<K? Function(T value)> accessors) → List<T>
Returns a sorted copy of values ordered by a homogeneous list of accessors in priority order.
sortNullable<T extends Comparable<Object>>(Iterable<T?> values, [num compare(T? a, T? b)?]) → List<T?>
Returns a sorted copy of nullable values in ascending natural order (or using compare), placing null and NaN values last while preserving ES2019 stability.
sortWith<T>(Iterable<T> values, num compare(T a, T b)) → List<T>
Returns a sorted copy of values according to compare, placing unorderable elements last while preserving ES2019 stability.
subset<T>(Iterable<T> values, Iterable<T> other) → bool
Returns true if values is a subset of other (every value in values also appears in other).
sum(Iterable<num?> values) → double
Returns the sum of the given numeric values, ignoring null and NaN. Returns 0.0 if values contains no valid numbers.
sumBy<T>(Iterable<T> values, num? valueof(T value)) → double
Returns the sum of numeric values extracted from values using valueof.
sumByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double
Returns the sum of numeric values extracted from values using indexed valueof.
superset<T>(Iterable<T> values, Iterable<T> other) → bool
Returns true if values is a superset of other (every value in other also appears in values), lazily consuming values.
thresholdFreedmanDiaconis(Iterable<num?> values, num min, num max) → int
Returns the number of bins according to the Freedman-Diaconis rule.
thresholdScott(Iterable<num?> values, num min, num max) → int
Returns the number of bins according to Scott's normal reference rule.
thresholdSturges(Iterable<num?> values, [num? min, num? max]) → int
Returns the number of bins according to Sturges' formula.
tickIncrement(num start, num stop, num count) → double
Returns the tick increment for start, stop, and count (negative when the step is < 1, representing -1 / step).
ticks(num start, num stop, num count) → List<double>
Returns approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive).
tickStep(num start, num stop, num count) → double
Returns the signed difference between adjacent tick values for start, stop, and count.
transpose<T>(List<List<T>> matrix) → List<List<T>>
Transposes the specified matrix of lists, truncating to the shortest row.
union<T>(Iterable<Iterable<T>> others) → Set<T>
Returns a new Set containing every distinct value that appears in any of others, preserving first-seen order (with SameValueZero NaN deduplication).
union2<T>(Iterable<T> a, Iterable<T> b) → Set<T>
Returns a new Set containing every distinct value in a or b.
variance(Iterable<num?> values) → double?
Returns the unbiased sample variance (Bessel's correction) of values using Welford's algorithm, ignoring null and NaN, or null if fewer than 2 valid numbers exist.
varianceBy<T>(Iterable<T> values, num? valueof(T value)) → double?
Returns the sample variance of numeric values extracted from values using valueof.
varianceByIndexed<T>(Iterable<T> values, num? valueof(T value, int index, Iterable<T> values)) → double?
Returns the sample variance of numeric values extracted from values using indexed valueof.
zip<T>(List<List<T>> arrays) → List<List<T>>
Returns a list of lists where the i-th list contains the i-th element from each list in arrays, truncated to the shortest list.
zip2<A, B>(List<A> a, List<B> b) → List<(A, B)>
Zips two lists a and b into a list of (A, B) records, truncated to the shorter list.
zip3<A, B, C>(List<A> a, List<B> b, List<C> c) → List<(A, B, C)>
Zips three lists a, b, and c into a list of (A, B, C) records, truncated to the shortest list.

Typedefs

BinDomainAccessor = (double, double)? Function(List<double?> values)
Accessor computing the [min, max] binning domain from extracted values.
BinThresholdCount = int Function(List<double?> values, double min, double max)
Callback computing an approximate threshold count from extracted values.
BinThresholdValues = List<double> Function(List<double?> values, double min, double max)
Callback computing explicit threshold boundaries from extracted values.
BinValueAccessor<T> = num? Function(T value, int index, List<T> data)
Accessor extracting a numeric value for binning from a datum of type T.