Skip to content

Commit c0156e7

Browse files
Update KDocs for waterfallPlot(), geomSina() and scaleX|YDateTime().
1 parent 3e8aa4d commit c0156e7

File tree

3 files changed

+112
-19
lines changed

3 files changed

+112
-19
lines changed

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/bistro/waterfall/WaterfallPlot.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,20 @@ package org.jetbrains.letsPlot.bistro.waterfall
8787
* Set "blank" or result of `elementBlank()` to draw nothing.
8888
* Set `elementLine()` to specify parameters.
8989
* @param relativeLabels Result of the call to the `layerLabels()` function.
90-
* Specify content and formatting of annotation labels on relative change bars.
91-
* If specified, overrides `labelFormat` for relative bars.
92-
* See `layer_labels() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.annotations/layer-labels/index.html>`__.
90+
* Specify content and formatting of annotation labels on relative change bars.
91+
* If specified, overrides `labelFormat` for relative bars.
92+
* See `layer_labels() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.annotations/layer-labels/index.html>`__.
9393
* @param absoluteLabels Result of the call to the `layerLabels()` function.
94-
* Specify content and formatting of annotation labels on absolute value bars.
95-
* If specified, overrides `labelFormat` for absolute bars.
96-
* See `layer_labels() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.annotations/layer-labels/index.html>`__.
94+
* Specify content and formatting of annotation labels on absolute value bars.
95+
* If specified, overrides `labelFormat` for absolute bars.
96+
* See `layer_labels() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.annotations/layer-labels/index.html>`__.
9797
* @param label Label on the bar.
98-
* Style configuration for labels on bars. Applied to default labels or to
99-
* relative/absolute labels when `relativeLabels` or `absoluteLabels` are specified.
100-
* Set "blank" or result of `elementBlank()` to draw nothing.
101-
* Set `elementText()` to specify style parameters.
102-
* Use `elementText(color="inherit")` to make labels inherit the color of bar borders.
103-
* See `elementText() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.themes/element-text.html>`__.
98+
* Style configuration for labels on bars. Applied to default labels or to
99+
* relative/absolute labels when `relativeLabels` or `absoluteLabels` are specified.
100+
* Set "blank" or result of `elementBlank()` to draw nothing.
101+
* Set `elementText()` to specify style parameters.
102+
* Use `elementText(color="inherit")` to make labels inherit the color of bar borders.
103+
* See `elementText() <https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.themes/element-text.html>`__.
104104
* @param labelFormat Format used to transform label mapping values to a string.
105105
* For more info see: [formats.html](https://lets-plot.org/kotlin/formats.html)
106106
* Note: the "$" must be escaped as "\$".
@@ -109,8 +109,8 @@ package org.jetbrains.letsPlot.bistro.waterfall
109109
* - ".2f" -> "12.45"
110110
* - "Score: {.2f}" -> "Score: 12.45"
111111
* - "Score: {}" -> "Score: 12.454789"
112-
* @param backgroundLayers will be added behind the waterfall
113-
* Background layers to be added to the plot, a single Layer or FeatureList.
112+
* @param backgroundLayers Will be added behind the waterfall.
113+
* Background layers to be added to the plot, a single layer or feature list.
114114
*/
115115
fun waterfallPlot(
116116
data: Map<*, *>,

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_sina.kt

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,94 @@ import org.jetbrains.letsPlot.intern.layer.stat.SinaStatParameters
1717
import org.jetbrains.letsPlot.pos.positionDodge
1818
import org.jetbrains.letsPlot.tooltips.TooltipOptions
1919

20-
/*
21-
TODO
22-
*/
20+
@Suppress("ClassName")
21+
/**
22+
* A sina plot visualizes a single variable across classes, with jitter width reflecting the data density in each class.
23+
*
24+
* ## Notes
25+
*
26+
* Computed variables:
27+
*
28+
* - ..violinwidth.. : density scaled for the sina plot, according to area, counts or to a constant maximum width (mapped by default).
29+
* - ..density.. : density estimate.
30+
* - ..count.. : density * number of points.
31+
* - ..scaled.. : density estimate, scaled to maximum of 1.
32+
* - ..quantile.. : quantile estimate.
33+
*
34+
* To hide axis tooltips, set "blank" or the result of `elementBlank()`
35+
* to the `axisTooltip`, `axisTooltipX` or `axisTooltipY` parameter of the `theme()`.
36+
*
37+
* ## Examples
38+
*
39+
* - [geom_sina.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/geom_sina.ipynb)
40+
*
41+
* @param data The data to be displayed in this layer. If null, the default, the data
42+
* is inherited from the plot data as specified in the call to [letsPlot][org.jetbrains.letsPlot.letsPlot].
43+
* @param stat default = `Stat.sina()`. The statistical transformation to use on the data for this layer.
44+
* Supported transformations: `Stat.identity`, `Stat.bin()`, `Stat.count()`, etc. see [Stat][org.jetbrains.letsPlot.Stat].
45+
* @param position default = `positionDodge()`. Position adjustment: `positionIdentity`, `positionStack()`, `positionDodge()`, etc. see
46+
* [Position](https://lets-plot.org/kotlin/-lets--plot--kotlin/org.jetbrains.letsPlot.pos/).
47+
* @param showLegend default = true.
48+
* false - do not show legend for this layer.
49+
* @param inheritAes default = true.
50+
* false - do not combine the layer aesthetic mappings with the plot shared mappings.
51+
* @param manualKey String or result of the call to the `layerKey()` function.
52+
* The key to show in the manual legend. Specifies the text for the legend label or advanced settings using the `layerKey()` function.
53+
* @param sampling Result of the call to the `samplingXxx()` function.
54+
* To prevent any sampling for this layer pass value `samplingNone`.
55+
* For more info see [sampling.html](https://lets-plot.org/kotlin/sampling.html).
56+
* @param tooltips Result of the call to the `layerTooltips()` function.
57+
* Specifies appearance, style and content.
58+
* Set `tooltips = tooltipsNone` to hide tooltips from the layer.
59+
* @param orientation Specifies the axis that the layer's stat and geom should run along.
60+
* The default value (`null`) automatically determines the orientation based on the aesthetic mapping.
61+
* If the automatic detection doesn't work, it can be set explicitly by specifying the "x" or "y" orientation.
62+
* @param x X-axis coordinates.
63+
* @param y Y-axis coordinates.
64+
* @param violinWidth Density scaled for the sina plot, according to area, counts or to a constant maximum width.
65+
* @param alpha Transparency level of a layer. Understands numbers between 0 and 1.
66+
* @param color Color of the geometry.
67+
* For more info see: [aesthetics.html#color-and-fill](https://lets-plot.org/kotlin/aesthetics.html#color-and-fill).
68+
* @param fill Fill color.
69+
* For more info see: [aesthetics.html#color-and-fill](https://lets-plot.org/kotlin/aesthetics.html#color-and-fill).
70+
* @param shape Shape of the sina points.
71+
* For more info see: [aesthetics.html#point-shapes](https://lets-plot.org/kotlin/aesthetics.html#point-shapes).
72+
* @param size Lines width.
73+
* Defines line width.
74+
* @param stroke Width of the shape border. Applied only to the shapes having border.
75+
* @param width Width of sina bounding box.
76+
* @param weight Used by `Stat.sina()` stat to compute weighted density.
77+
* @param seed A random seed to make the jitter reproducible.
78+
* If null (the default value), the seed is initialised with a random value.
79+
* @param showHalf default = 0.
80+
* - If -1, only half of each group is drawn.
81+
* - If 1, another half is drawn.
82+
* - If 0, sina look as usual.
83+
* @param quantiles Draw horizontal lines at the given quantiles of the density estimate.
84+
* @param scale default = "area".
85+
* - If "area", all groups have the same area.
86+
* - If "count", areas are scaled proportionally to the number of observations.
87+
* - If "width", all groups have the same maximum width.
88+
* @param trim default = true.
89+
* Trim the tails of the violins, which limit the area for sina points, to the range of the data.
90+
* @param tailsCutoff default = 3.0.
91+
* Extend domain of each violin, which limit the area for sina points, on `tailsCutoff * bw` if `trim = false`.
92+
* @param kernel The kernel we use to calculate the density function. Choose among "gaussian", "cosine", "optcosine",
93+
* "rectangular" (or "uniform"), "triangular", "biweight" (or "quartic"), "epanechikov" (or "parabolic").
94+
* @param bw String or Double.
95+
* The method (or exact value) of bandwidth. Either a string (choose among "nrd0" and "nrd") or a double.
96+
* @param adjust Adjusts the value of bandwidth by multiplying it. Changes how smooth the frequency curve is.
97+
* @param n The number of sampled points for plotting the function.
98+
* @param fullScanMax Maximum size of data to use density computation with "full scan".
99+
* For bigger data, less accurate but more efficient density computation is applied.
100+
* @param colorBy default = "color" ("fill", "color", "paint_a", "paint_b", "paint_c").
101+
* Defines the color aesthetic for the geometry.
102+
* @param fillBy default = "fill" ("fill", "color", "paint_a", "paint_b", "paint_c").
103+
* Defines the fill aesthetic for the geometry.
104+
* @param mapping Set of aesthetic mappings.
105+
* Aesthetic mappings describe the way that variables in the data are
106+
* mapped to plot "aesthetics".
107+
*/
23108
class geomSina(
24109
data: Map<*, *>? = null,
25110
stat: StatOptions = Stat.sina(),

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/scale/DateTime.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import org.jetbrains.letsPlot.intern.Scale
1313
import org.jetbrains.letsPlot.intern.checkScaleExpand
1414

1515
/**
16-
* Position scale x for date/time data.
16+
* Position scale for the x-axis with date/time data.
17+
* The input is expected to be either a series of integers representing milliseconds since the Unix epoch,
18+
* or kotlinx.datetime, or java.util datetime objects.
19+
* Assumes UTC timezone if no timezone information is present in the data (naive datetime).
20+
* For timezone-aware datetime objects, the timezone information from the data is preserved.
1721
*
1822
* ## Examples
1923
*
@@ -79,7 +83,11 @@ fun scaleXDateTime(
7983
}
8084

8185
/**
82-
* Position scale y for date/time data.
86+
* Position scale for the y-axis with date/time data.
87+
* The input is expected to be either a series of integers representing milliseconds since the Unix epoch,
88+
* or kotlinx.datetime, or java.util datetime objects.
89+
* Assumes UTC timezone if no timezone information is present in the data (naive datetime).
90+
* For timezone-aware datetime objects, the timezone information from the data is preserved.
8391
*
8492
* ## Examples
8593
*

0 commit comments

Comments
 (0)