@@ -17,9 +17,94 @@ import org.jetbrains.letsPlot.intern.layer.stat.SinaStatParameters
1717import org.jetbrains.letsPlot.pos.positionDodge
1818import 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+ */
23108class geomSina (
24109 data : Map <* , * >? = null ,
25110 stat : StatOptions = Stat .sina(),
0 commit comments