Skip to content

Commit

Permalink
Merge pull request #353 from Kotlin/stat-api-ref
Browse files Browse the repository at this point in the history
Add stat api reference
  • Loading branch information
AndreiKingsley authored Mar 21, 2024
2 parents d38ea9e + 4016c1f commit eca870d
Show file tree
Hide file tree
Showing 25 changed files with 2,665 additions and 350 deletions.
2 changes: 2 additions & 0 deletions docs/kd.tree
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<toc-element toc-title="statistics">
<toc-element topic="StatBin-API.md"/>
<toc-element topic="StatBoxplot-API.md"/>
<toc-element topic="StatCandlestick-API.md"/>
<toc-element topic="StatCount-API.md"/>
<toc-element topic="StatCount2D-API.md"/>
<toc-element topic="StatDensity-API.md"/>
Expand All @@ -73,6 +74,7 @@
<toc-element topic="Bars-API.md"/>
<toc-element topic="Boxes-API.md"/>
<toc-element topic="Boxplot-API.md"/>
<toc-element topic="Candlestick-API.md"/>
<toc-element topic="CountPlot-API.md"/>
<toc-element topic="CrossBars-API.md"/>
<toc-element topic="DensityPlot-API.md"/>
Expand Down
30 changes: 5 additions & 25 deletions docs/topics/apiRef/Area-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,25 @@

<tldr xmlns="">
<p><format style="bold" color="GoldenRod">area</format> <format style="italic">{ this: AreaContext -></format></p>
<list type="none">
<li>
<a href="#x"><format style="bold" color="CadetBlue">x</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#y"><format style="bold" color="CadetBlue">y</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#alpha"><format style="bold" color="DarkGray">alpha</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-alpha"></include>
</li>
<li>
<a href="#fillcolor"><format style="bold" color="DarkGray">fillColor</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-color"></include>
</li>
<li>
<include from="properties.topic" element-id="signature-of-borderLine"/>
</li>
</list>
<include from = "interfaces.topic" element-id="interface-of-area"></include>
<format style="italic">}</format>
</tldr>

## Properties

### x
### x {id="x_area"}

<include from="properties.topic" element-id="x-property"/>

### y
### y {id="y_area"}

<include from="properties.topic" element-id="y-property"/>

### alpha
### alpha {id="alpha_area"}

<include from="properties.topic" element-id="alpha-property"/>

### fillColor
### fillColor {id="fill_color_area"}

<include from="properties.topic" element-id="fillColor-property"/>

Expand Down
32 changes: 6 additions & 26 deletions docs/topics/apiRef/Bars-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,29 @@

<tldr>
<p><format style="bold" color="GoldenRod">bars</format> <format style="italic">{ this: BarsContext -></format></p>
<list type="none">
<li>
<a href="#x"><format style="bold" color="CadetBlue">x</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#y"><format style="bold" color="CadetBlue">y</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#alpha"><format style="bold" color="DarkGray">alpha</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-alpha"></include>
</li>
<li>
<a href="#fillcolor"><format style="bold" color="DarkGray">fillColor</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-color"></include>
</li>
<li>
<include from="properties.topic" element-id="signature-of-borderLine"/>
</li>
</list>
<include from = "interfaces.topic" element-id="interface-of-bars"></include>
<format style="italic">}</format>
</tldr>

## Properties

### x
### x {id="x_bars"}

<include from="properties.topic" element-id="x-property"/>

### y
### y {id="y_bars"}

<include from="properties.topic" element-id="y-property"/>

### alpha
### alpha {id="alpha_bars"}

<include from="properties.topic" element-id="alpha-property"/>

### width
### width {id="width_bars"}

<include from="properties.topic" element-id="width-property"/>

### fillColor
### fillColor {id="fill_color_bars"}

<include from="properties.topic" element-id="fillColor-property"/>

Expand Down
134 changes: 15 additions & 119 deletions docs/topics/apiRef/Boxes-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,159 +2,55 @@

<tldr>
<p><format style="bold" color="GoldenRod">boxes</format> <format style="italic">{ this: BoxesContext -></format></p>
<list type="none">
<li>
<a href="#x"><format style="bold" color="CadetBlue">x</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#lower"><format style="bold" color="CadetBlue">lower</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#middle"><format style="bold" color="CadetBlue">middle</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#upper"><format style="bold" color="CadetBlue">upper</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#ymin"><format style="bold" color="CadetBlue">yMin</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>
<li>
<a href="#ymax"><format style="bold" color="CadetBlue">yMax</format></a> <format style="superscript">Positional</format>
<include from="properties.topic" element-id="signature-of-positional"></include>
</li>

<li>
<a href="#alpha"><format style="bold" color="DarkGray">alpha</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-alpha"></include>
</li>
<li>
<a href="#width"><format style="bold" color="DarkGray">width</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-double"></include>
</li>
<li>
<a href="#fillcolor"><format style="bold" color="DarkGray">fillColor</format></a> <format style="superscript">NonPositional</format>
<include from="properties.topic" element-id="signature-of-nonpos-color"></include>
</li>
<li>
<a href="#fatten"><format style="bold" color="DarkGray">fatten</format></a> <format style="superscript">NonPositional</format>
<emphasis>Double</emphasis>
</li>
<li>
<include from="properties.topic" element-id="signature-of-borderLine"/>
</li>
<li>
<a href="#y"><format style="bold" color="DarkGray">y</format></a>
<include from="properties.topic" element-id="signature-of-axis"></include>
</li>
</list>
<include from = "interfaces.topic" element-id="interface-of-boxes"></include>
<format style="italic">}</format>
</tldr>

## Properties

### x
### x {id=x_boxes}

<include from="properties.topic" element-id="x-property"/>

### lower
### lower {id=lower_boxes}

<include from="properties.topic" element-id="req-position-aes-desc"/>

The `lower` aesthetic is specifically designed for use in box plots, where it represents the lower quartile of the data.
This quartile marks the bottom edge of the box, indicating the value below which 25% of the data points fall.
The `lower` aesthetic is critical for accurately displaying the distribution of data within a box plot.
<include from="properties.topic" element-id="lower-property-desc"/>

**Setting**

* `lower.constant(Any)`: directly sets the lower quartile value for all boxes in the plot.
This approach is useful for highlighting a specific threshold or for comparative analysis across different datasets.
Example: `lower.constant(0.7)` uniformly sets the lower quartile to 0.7 for all boxes.

**Mapping**

* `lower(Iterable)`: associates the lower quartile of each box with values from an iterable collection. This method
allows for variable lower quartiles across boxes, useful for visualizing distributions from different groups or
categories.
* `lower(ColumnReference | KProperty | DataColumn)`: dynamically links the lower quartile of boxes to a DataFrame
column.
This mapping is essential for directly visualizing the statistical properties of the dataset.
* `lower(String)`: connects the lower quartile to data based on the column name in the DataFrame or by key in a Map,
offering flexibility in data representation.

### middle
### middle {id=middle_boxes}

<include from="properties.topic" element-id="req-position-aes-desc"/>

The `middle` aesthetic is instrumental in visualizing the central tendency within box plots and crossbars,
representing the median of the data in box plots and the central value in crossbars.
This aesthetic is key to conveying the central point around which the distribution or error bars are constructed,
providing a clear visual indicator of the dataset's middle value.

**Setting**

* `middle.constant(Any)`: applies a fixed value for the median or central value across all applicable elements within a
layer.
This method is useful for comparative analysis or highlighting specific median values across groups.
Example: `middle.constant(1.1)` uniformly sets the median or central value to 1.1 for all elements.
<include from="properties.topic" element-id="middle-property-desc"/>

**Mapping**

* `middle(Iterable)`: links each element's median or central value to a value from an iterable collection, allowing for
the visualization of variable middle points across different data groups or categories.
* `middle(ColumnReference | KProperty | DataColumn)`: dynamically associates the median or central value with a
DataFrame column, enabling the representation of data-driven median values.
* `middle(String)`: connects the median or central value to data based on the column name in the DataFrame or by key in
a Map, offering flexibility in representing central tendencies through data.

### upper
### upper {id=upper_boxes}

<include from="properties.topic" element-id="req-position-aes-desc"/>

The `upper` aesthetic plays a crucial role in box plots by representing the upper quartile of the dataset.
This quartile marks the top edge of the box, indicating the value above which 25% of the data points fall.
The `upper` aesthetic is essential for accurately displaying the spread and distribution of data within a box plot.

**Setting**

* `upper.constant(Any)`: assigns a uniform upper quartile value across all boxes in the plot.
This method is beneficial for standardizing comparisons or highlighting specific thresholds across datasets.
Example: `upper.constant(1.5)` sets a consistent upper quartile to 1.5 for all boxes.

**Mapping**

* `upper(Iterable)`: each box's upper quartile is associated with a value from an iterable collection, enabling the
visualization of varying upper quartiles across different data groups or categories.
* `upper(ColumnReference | KProperty | DataColumn)`: dynamically links the upper quartile of boxes to a DataFrame
column, allowing for the visualization of data-driven upper quartiles.
* `upper(String)`: connects the upper quartile to data based on the column name in the DataFrame or by key in a Map,
offering flexibility in representing upper limits through data.
<include from="properties.topic" element-id="upper-property-desc"/>

### yMin
### yMin {id=ymin_boxes}

<include from="properties.topic" element-id="yMin-property"/>

### yMax
### yMax {id=ymax_boxes}

<include from="properties.topic" element-id="yMax-property"/>

### alpha
### alpha {id=alpha_boxes}

<include from="properties.topic" element-id="alpha-property"/>

### width
### width {id=width_boxes}

<include from="properties.topic" element-id="width-property"/>

### fillColor
### fillColor {id=fill_color_boxes}

<include from="properties.topic" element-id="fillColor-property"/>

### fatten
### fatten {id=fatten_boxes}

<include from="properties.topic" element-id="fatten-property"/>

Expand All @@ -164,6 +60,6 @@ The `upper` aesthetic is essential for accurately displaying the spread and dist

## Free Scales

### y
### y {id=y_boxes}

<include from="properties.topic" element-id="yFree-property"/>
Loading

0 comments on commit eca870d

Please sign in to comment.