Class Index | File Index

Classes


Class pv.histogram

Represents a histogram operator.
Defined in: Histogram.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
pv.histogram(data, f)
Returns a histogram operator for the specified data, with an optional accessor function.
Method Summary
Method Attributes Method Name and Description
 
bins(ticks)
Returns the computed histogram bins.
 
Sets or gets whether this histogram operator returns frequencies or probabilities.
Class Detail
pv.histogram(data, f)
Returns a histogram operator for the specified data, with an optional accessor function. If the data specified is not an array of numbers, an accessor function must be specified to map the data to numeric values.
Parameters:
{array} data
an array of numbers or objects.
{function} f Optional
an optional accessor function.
Method Detail
{array} bins(ticks)
Returns the computed histogram bins. An optional array of numbers, ticks, may be specified as the break points. If the ticks are not specified, default ticks will be computed using a linear scale on the data domain.

The returned array contains pv.histogram.Bins. The x attribute corresponds to the bin's start value (inclusive), while the dx attribute stores the bin size (end - start). The y attribute stores either the frequency count or probability, depending on how the histogram operator has been configured.

The pv.histogram.Bin objects are themselves arrays, containing the data elements present in each bin, i.e., the elements in the data array (prior to invoking the accessor function, if any). For example, if the data represented countries, and the accessor function returned the GDP of each country, the returned bins would be arrays of countries (not GDPs).

Parameters:
{array} ticks Optional
Returns:
{array}

{pv.histogram} frequency(x)
Sets or gets whether this histogram operator returns frequencies or probabilities.
Parameters:
{boolean} x Optional
Returns:
{pv.histogram} this.

Documentation generated by JsDoc Toolkit 2.3.2 on Fri May 28 2010 10:13:28 GMT-0700 (PDT)