Skip to content

Commit 9f6c780

Browse files
Fix backgroundLayers in waterfallPlot()
1 parent 4fe6ae7 commit 9f6c780

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

docs/examples/jupyter-notebooks/f-4.11.0/waterfall_plot_layers.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@
644644
" x = \"Accounts\",\n",
645645
" y = \"Values\",\n",
646646
" measure = \"Measure\",\n",
647-
" backgroundLayers = listOf(geomPoint(), quarterLayer)\n",
647+
" backgroundLayers = quarterLayer\n",
648648
") + \n",
649649
" textLayers + \n",
650650
" scaleHue(\"paint_a\", guide = \"none\") + \n",

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ package org.jetbrains.letsPlot.bistro.waterfall
110110
* - "Score: {.2f}" -> "Score: 12.45"
111111
* - "Score: {}" -> "Score: 12.454789"
112112
* @param backgroundLayers will be added behind the waterfall
113-
* Background layers to be added to the plot. Accepts either:
114-
* - A single layer (e.g., `geomBar { ... }`).
115-
* - A list of layers (`List<Layer>`).
113+
* Background layers to be added to the plot, a single Layer or FeatureList.
116114
*/
117115
fun waterfallPlot(
118116
data: Map<*, *>,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ internal class WaterfallPlotBuilder(
8282
Waterfall.LABEL_FORMAT to labelFormat,
8383
Waterfall.BACKGROUND_LAYERS to when (backgroundLayers) {
8484
is Layer -> listOf(backgroundLayers.toSpec())
85-
is List<*> -> backgroundLayers.map {
85+
is FeatureList -> backgroundLayers.elements.map {
8686
when (it) {
8787
is Layer -> it.toSpec()
8888
else -> error("Invalid type in backgroundLayers list")

0 commit comments

Comments
 (0)