@@ -11,31 +11,33 @@ export type Thresholds = ThresholdsName | ThresholdsFunction | RangeInterval;
1111
1212export interface BinOptions {
1313 /**
14- * Whether the distribution is cumulative (use -1 for the [complementary
15- * cumulative](https://en.wikipedia.org/wiki/Cumulative_distribution_function#Complementary_cumulative_distribution_function_.28tail_distribution.29))
14+ * If true or a positive number, produce a cumulative distribution; if a
15+ * negative number, produce a [complementary cumulative](https://en.wikipedia.org/wiki/Cumulative_distribution_function#Complementary_cumulative_distribution_function_.28tail_distribution.29)
16+ * distribution; if false or zero (the default), produce a probability
17+ * distribution.
1618 */
1719 cumulative ?: boolean | number ;
20+
1821 /**
1922 * The domain, or a function that receives the values and returns the
2023 * domain. Values outside the domain will be omitted.
2124 */
2225 domain ?: ( ( values : any [ ] ) => [ min : any , max : any ] ) | [ min : any , max : any ] ;
26+
2327 /**
2428 * The **thresholds** value may be specified as:
2529 *
2630 * * *auto* (default) - Scott’s rule, capped at 200
27- * * *freedman-diaconis* - the [Freedman–Diaconis
28- * rule](https://en.wikipedia.org/wiki/Freedman–Diaconis_rule)
29- * * *scott* - [Scott’s normal reference
30- * rule](https://en.wikipedia.org/wiki/Histogram#Scott.27s_normal_reference_rule)
31- * * *sturges* - [Sturges’
32- * formula](https://en.wikipedia.org/wiki/Histogram#Sturges.27_formula)
31+ * * *freedman-diaconis* - the [Freedman–Diaconis rule](https://en.wikipedia.org/wiki/Freedman–Diaconis_rule)
32+ * * *scott* - [Scott’s normal reference rule](https://en.wikipedia.org/wiki/Histogram#Scott.27s_normal_reference_rule)
33+ * * *sturges* - [Sturges’ formula](https://en.wikipedia.org/wiki/Histogram#Sturges.27_formula)
3334 * * a count (hint) representing the desired number of bins
3435 * * an array of *n* threshold values for *n* - 1 bins
3536 * * an interval or time interval (see also **interval**)
3637 * * a function that returns an array, count, or time interval
3738 */
3839 thresholds ?: Thresholds ;
40+
3941 /**
4042 * An alternative way of specifying the bins thresholds. It may be either an
4143 * interval (object with a floor method), a time interval such as *day*, or a
@@ -71,16 +73,19 @@ export interface BinOutputOptions extends BinOptions {
7173 * input order.
7274 */
7375 data ?: BinReducer | null ;
76+
7477 /**
7578 * The filter reducer, defaults to a check on empty bins. Use null to return
7679 * all bins, for example to impute sum=0 for a line chart.
7780 */
7881 filter ?: BinReducer | null ;
82+
7983 /**
8084 * The order in which the bins are generated, specified as an aggregation
8185 * method (defaults to ascending).
8286 */
8387 sort ?: BinReducer | null ;
88+
8489 /**
8590 * Reverse the order in which the bins are generated.
8691 */
@@ -107,8 +112,7 @@ export type BinOutputs = ChannelReducers<BinReducer> & BinOutputOptions;
107112 * * *count* - the number of elements (frequency)
108113 * * *distinct* - the number of distinct values
109114 * * *sum* - the sum of values
110- * * *proportion* - the sum proportional to the overall total (weighted
111- * frequency)
115+ * * *proportion* - the sum proportional to the overall total (weighted frequency)
112116 * * *proportion-facet* - the sum proportional to the facet total
113117 * * *min* - the minimum value
114118 * * *min-index* - the zero-based index of the minimum value
@@ -119,16 +123,14 @@ export type BinOutputs = ChannelReducers<BinReducer> & BinOutputOptions;
119123 * * *mode* - the value with the most occurrences
120124 * * *pXX* - the percentile value, where XX is a number in [00,99]
121125 * * *deviation* - the standard deviation
122- * * *variance* - the variance per [Welford’s
123- * algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
126+ * * *variance* - the variance per [Welford’s algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
124127 * * *x* - the middle of the bin’s *x* extent (when binning on *x*)
125128 * * *x1* - the lower bound of the bin’s *x* extent (when binning on *x*)
126129 * * *x2* - the upper bound of the bin’s *x* extent (when binning on *x*)
127130 * * *y* - the middle of the bin’s *y* extent (when binning on *y*)
128131 * * *y1* - the lower bound of the bin’s *y* extent (when binning on *y*)
129132 * * *y2* - the upper bound of the bin’s *y* extent (when binning on *y*)
130- * * a function to be passed the array of values for each bin and the extent of
131- * the bin
133+ * * a function to be passed the array of values for each bin and the extent of the bin
132134 * * an object with a *reduce* method, and optionally a *scope*
133135 *
134136 * Most aggregation methods require binding the output channel to an input
@@ -163,8 +165,7 @@ export function binX<T>(outputs?: BinOutputs, options?: T & BinOptions): Transfo
163165 * * *count* - the number of elements (frequency)
164166 * * *distinct* - the number of distinct values
165167 * * *sum* - the sum of values
166- * * *proportion* - the sum proportional to the overall total (weighted
167- * frequency)
168+ * * *proportion* - the sum proportional to the overall total (weighted frequency)
168169 * * *proportion-facet* - the sum proportional to the facet total
169170 * * *min* - the minimum value
170171 * * *min-index* - the zero-based index of the minimum value
@@ -175,16 +176,14 @@ export function binX<T>(outputs?: BinOutputs, options?: T & BinOptions): Transfo
175176 * * *mode* - the value with the most occurrences
176177 * * *pXX* - the percentile value, where XX is a number in [00,99]
177178 * * *deviation* - the standard deviation
178- * * *variance* - the variance per [Welford’s
179- * algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
179+ * * *variance* - the variance per [Welford’s algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
180180 * * *x* - the middle of the bin’s *x* extent (when binning on *x*)
181181 * * *x1* - the lower bound of the bin’s *x* extent (when binning on *x*)
182182 * * *x2* - the upper bound of the bin’s *x* extent (when binning on *x*)
183183 * * *y* - the middle of the bin’s *y* extent (when binning on *y*)
184184 * * *y1* - the lower bound of the bin’s *y* extent (when binning on *y*)
185185 * * *y2* - the upper bound of the bin’s *y* extent (when binning on *y*)
186- * * a function to be passed the array of values for each bin and the extent of
187- * the bin
186+ * * a function to be passed the array of values for each bin and the extent of the bin
188187 * * an object with a *reduce* method, and optionally a *scope*
189188 *
190189 * Most aggregation methods require binding the output channel to an input
@@ -219,8 +218,7 @@ export function binY<T>(outputs?: BinOutputs, options?: T & BinOptions): Transfo
219218 * * *count* - the number of elements (frequency)
220219 * * *distinct* - the number of distinct values
221220 * * *sum* - the sum of values
222- * * *proportion* - the sum proportional to the overall total (weighted
223- * frequency)
221+ * * *proportion* - the sum proportional to the overall total (weighted frequency)
224222 * * *proportion-facet* - the sum proportional to the facet total
225223 * * *min* - the minimum value
226224 * * *min-index* - the zero-based index of the minimum value
@@ -231,16 +229,14 @@ export function binY<T>(outputs?: BinOutputs, options?: T & BinOptions): Transfo
231229 * * *mode* - the value with the most occurrences
232230 * * *pXX* - the percentile value, where XX is a number in [00,99]
233231 * * *deviation* - the standard deviation
234- * * *variance* - the variance per [Welford’s
235- * algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
232+ * * *variance* - the variance per [Welford’s algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm)
236233 * * *x* - the middle of the bin’s *x* extent (when binning on *x*)
237234 * * *x1* - the lower bound of the bin’s *x* extent (when binning on *x*)
238235 * * *x2* - the upper bound of the bin’s *x* extent (when binning on *x*)
239236 * * *y* - the middle of the bin’s *y* extent (when binning on *y*)
240237 * * *y1* - the lower bound of the bin’s *y* extent (when binning on *y*)
241238 * * *y2* - the upper bound of the bin’s *y* extent (when binning on *y*)
242- * * a function to be passed the array of values for each bin and the extent of
243- * the bin
239+ * * a function to be passed the array of values for each bin and the extent of the bin
244240 * * an object with a *reduce* method, and optionally a *scope*
245241 *
246242 * Most aggregation methods require binding the output channel to an input
0 commit comments