Skip to content

Commit 0ad8c67

Browse files
committed
Fix LP-1285 : General purpose scaleContinuous: can't use the expand parameter.
1 parent 47273f4 commit 0ad8c67

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import org.jetbrains.letsPlot.intern.Scale
2323
* @param lablim The maximum label length (in characters) before trimming is applied.
2424
* @param limits A Pair of Numbers specifying the data range for the scale.
2525
* Use null to refer to default min/max.
26+
* @param expand A numeric vector of length two giving multiplicative and additive expansion constants.
27+
* The vector size == 1 => only multiplicative expand (and additive expand by default).
28+
* Defaults: multiplicative = 0.05, additive = 0.
2629
* @param naValue Missing values will be replaced with this value.
2730
* @param format Specifies the format pattern for labels on the scale.
2831
* @param guide Guide to use for this scale.
@@ -53,6 +56,7 @@ fun scaleContinuous(
5356
labels: Any? = null,
5457
lablim: Int? = null,
5558
limits: Pair<Number?, Number?>? = null,
59+
expand: Any? = null,
5660
naValue: Any? = null,
5761
format: String? = null,
5862
guide: Any? = null,
@@ -66,6 +70,7 @@ fun scaleContinuous(
6670
labels = labels,
6771
lablim = lablim,
6872
limits = limits,
73+
expand = expand,
6974
naValue = naValue,
7075
format = format,
7176
guide = guide,

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

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import org.jetbrains.letsPlot.intern.Scale
2525
* @param lablim The maximum label length (in characters) before trimming is applied.
2626
* @param limits List of data values.
2727
* A vector specifying values to display with the scale and their order in guides (axis).
28+
* @param expand A numeric vector of length two giving multiplicative and additive expansion constants.
29+
* The vector size == 1 => only multiplicative expand (and additive expand by default).
30+
* Defaults: multiplicative = 0, additive = 0.2.
2831
* @param naValue Missing values will be replaced with this value.
2932
* @param format Specifies the format pattern for labels on the scale.
3033
* @param guide Guide to use for this scale.
@@ -56,6 +59,7 @@ fun scaleDiscrete(
5659
labels: Any? = null,
5760
lablim: Int? = null,
5861
limits: List<Any>? = null,
62+
expand: Any? = null,
5963
naValue: Any? = null,
6064
format: String? = null,
6165
guide: Any? = null,
@@ -68,6 +72,7 @@ fun scaleDiscrete(
6872
labels = labels,
6973
lablim = lablim,
7074
limits = limits,
75+
expand = expand,
7176
naValue = naValue,
7277
format = format,
7378
guide = guide,

0 commit comments

Comments
 (0)