Skip to content

Commit c3e4718

Browse files
Add aesthetics for the horizontal geomBoxplot()
1 parent 083f12b commit c3e4718

File tree

6 files changed

+49
-2
lines changed

6 files changed

+49
-2
lines changed

future_changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ GeoTools [v 33.2](https://github.com/geotools/geotools/releases/tag/33.2)
5252
> New way of handling continuous data on discrete scales could potentially break existing plots.
5353
> If you want to restore a broken plot to its original form, you can use the [`asDiscrete()`](https://lets-plot.org/kotlin/as-discrete.html) function to annotate continuous data as discrete.
5454
55+
- [**BREAKING**] `geomBoxplot()`: when y-oriented, it now uses aesthetics `xlower`/`xmiddle`/`xupper` instead of `lower`/`middle`/`upper` [[#1319](https://github.com/JetBrains/lets-plot/issues/1319)].
56+
- [**BREAKING**] `waterfallPlot()`: special "flow_type" value for `label=elementText(color=...)` replaced with "inherit". See `label` in the [documentation](https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot.bistro.waterfall/waterfall-plot.html).
57+
- [**DEPRECATED**] The `positionDodgeV()` function and the `"dodgev"` value for the `position` parameter are deprecated and will be removed in future releases.
5558
- Plot layout: reduced margins and spacing for title, caption, axes, and legend.
5659
- Updated RGB values for `lightgray` and `green`. To restore the previous colors, use `gray75` and `lime`, respectively.
5760

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ object Geom {
614614
override val upper: Number? = null,
615615
override val ymin: Number? = null,
616616
override val ymax: Number? = null,
617+
override val xlower: Number? = null,
618+
override val xmiddle: Number? = null,
619+
override val xupper: Number? = null,
620+
override val xmin: Number? = null,
621+
override val xmax: Number? = null,
617622
override val fatten: Number? = null,
618623
override val whiskerWidth: Number? = null,
619624
override val alpha: Number? = null,

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ fun geomBoxplot(
127127
upper: Number? = null,
128128
ymin: Number? = null,
129129
ymax: Number? = null,
130+
xlower: Number? = null,
131+
xmiddle: Number? = null,
132+
xupper: Number? = null,
133+
xmin: Number? = null,
134+
xmax: Number? = null,
130135
alpha: Number? = null,
131136
color: Any? = null,
132137
fill: Any? = null,
@@ -165,7 +170,9 @@ fun geomBoxplot(
165170
manualKey,
166171
tooltips,
167172
orientation,
168-
x, y, lower, middle, upper, ymin, ymax, alpha, color, fill, size, linetype, shape, angle, width, weight, fatten,
173+
x, y, lower, middle, upper, ymin, ymax, alpha,
174+
xlower, xmiddle, xupper, xmin, xmax,
175+
color, fill, size, linetype, shape, angle, width, weight, fatten,
169176
whiskerWidth, varWidth, coef,
170177
widthUnit,
171178
colorBy, fillBy,
@@ -231,6 +238,11 @@ private class geomBoxplotInternal(
231238
override val upper: Number? = null,
232239
override val ymin: Number? = null,
233240
override val ymax: Number? = null,
241+
override val xlower: Number? = null,
242+
override val xmiddle: Number? = null,
243+
override val xupper: Number? = null,
244+
override val xmin: Number? = null,
245+
override val xmax: Number? = null,
234246
override val alpha: Number? = null,
235247
override val color: Any? = null,
236248
override val fill: Any? = null,

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/intern/layer/geom/BoxplotAesthetics.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ interface BoxplotAesthetics : OptionsCapsule {
1616
val upper: Any?
1717
val ymin: Any?
1818
val ymax: Any?
19+
val xlower: Any?
20+
val xmiddle: Any?
21+
val xupper: Any?
22+
val xmin: Any?
23+
val xmax: Any?
1924
val alpha: Any?
2025
val color: Any?
2126
val fill: Any?
@@ -34,6 +39,11 @@ interface BoxplotAesthetics : OptionsCapsule {
3439
"upper" to upper,
3540
"ymin" to ymin,
3641
"ymax" to ymax,
42+
"xlower" to xlower,
43+
"xmiddle" to xmiddle,
44+
"xupper" to xupper,
45+
"xmin" to xmin,
46+
"xmax" to xmax,
3747
"alpha" to alpha,
3848
"color" to color,
3949
"fill" to fill,

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/intern/layer/geom/BoxplotMapping.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class BoxplotMapping(
1616
override var upper: Any? = null,
1717
override var ymin: Any? = null,
1818
override var ymax: Any? = null,
19+
override var xlower: Any? = null,
20+
override var xmiddle: Any? = null,
21+
override var xupper: Any? = null,
22+
override var xmin: Any? = null,
23+
override var xmax: Any? = null,
1924
override var alpha: Any? = null,
2025
override var color: Any? = null,
2126
override var fill: Any? = null,

plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/stat/stat_boxplot.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ fun statBoxplot(
107107
upper: Number? = null,
108108
ymin: Number? = null,
109109
ymax: Number? = null,
110+
xlower: Number? = null,
111+
xmiddle: Number? = null,
112+
xupper: Number? = null,
113+
xmin: Number? = null,
114+
xmax: Number? = null,
110115
alpha: Number? = null,
111116
color: Any? = null,
112117
fill: Any? = null,
@@ -143,7 +148,9 @@ fun statBoxplot(
143148
inheritAes,
144149
sampling,
145150
x, y,
146-
lower, middle, upper, ymin, ymax, alpha, color, fill, size, linetype, shape, angle, width, weight, fatten,
151+
lower, middle, upper, ymin, ymax,
152+
xlower, xmiddle, xupper, xmin, xmax,
153+
alpha, color, fill, size, linetype, shape, angle, width, weight, fatten,
147154
whiskerWidth, varWidth, coef,
148155
colorBy, fillBy,
149156
mapping
@@ -204,6 +211,11 @@ private class statBoxplotInternal(
204211
override val upper: Number? = null,
205212
override val ymin: Number? = null,
206213
override val ymax: Number? = null,
214+
override val xlower: Number? = null,
215+
override val xmiddle: Number? = null,
216+
override val xupper: Number? = null,
217+
override val xmin: Number? = null,
218+
override val xmax: Number? = null,
207219
override val alpha: Number? = null,
208220
override val color: Any? = null,
209221
override val fill: Any? = null,

0 commit comments

Comments
 (0)