Skip to content

Commit 7d2ce89

Browse files
Docs: update the library version, update notebook about nudgeUnit, replace cookbooks about themes (#273)
1 parent ed65323 commit 7d2ce89

File tree

8 files changed

+52
-66
lines changed

8 files changed

+52
-66
lines changed

Writerside/topics/charts.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Examples:
5858
- [Ribbon geometry](%nb-ribbon%)
5959
- [How to draw curve fast](%nb-algebraic_curve%)
6060
- [`stroke` aesthetic](%nb-aes_stroke%)
61+
- [Configuring nudge units in position adjustments](%nb-position_nudge_unit%)
6162

6263

6364
## Discrete

Writerside/topics/presentation_options.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@
1616

1717
- [Themes overview](%nb-themes%)
1818
- [Default theme](%nb-default_theme%)
19-
- [Applying common theme to a plot group](%nb-gggrid_theme%)
20-
- [Plot margins](%nb-theme_plot_margin%)
21-
- [Option to show/hide plot messages](%nb-theme_plot_message%)
2219
- [Justification for text elements](%nb-hjust_vjust%)
2320
- [Margins](%nb-margins%)
2421
- [`margin` parameter of `elementText()`](%nb-text_margins%)
2522
- [Panel border](%nb-panel_border%)
26-
- [Tooltip properties in `theme()`](%nb-tooltips_theme%)
2723
- [Plot title, subtitle and caption](%nb-title_subtitle_caption%)
2824
- [Theme colors for geometries](%nb-geom_theme_colors%)
2925
- [Customize legend appearance](%nb-legend_theme%)
@@ -52,8 +48,8 @@
5248
### Predefined Themes Examples
5349

5450
- [Default theme](%nb-default_theme%)
51+
- [Themes overview](%nb-themes%)
5552
- [Theme flavors](%nb-theme_flavors%)
56-
- [Applying common theme to a plot group](%nb-gggrid_theme%)
5753
- [Margins](%nb-margins%)
5854
- [`margin` parameter of `elementText()`](%nb-text_margins%)
5955
- [Theme colors for geometries](%nb-geom_theme_colors%)
@@ -75,6 +71,6 @@
7571
### Flavors Examples
7672

7773
- [Theme flavors](%nb-theme_flavors%)
78-
- [Applying common theme to a plot group](%nb-gggrid_theme%)
74+
- [Themes overview](%nb-themes%)
7975
- [Theme colors for geometries](%nb-geom_theme_colors%)
8076
- [Annotation labels on pie-chart](%nb-annotations_for_pie%)

Writerside/topics/tooltips.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ See also the [formatting reference](formats.md) to learn how to format numeric a
1212

1313
- [Tooltip title](%nb-tooltip_title%)
1414
- [Tooltip customization](%nb-tooltip_config%)
15-
- [Tooltip properties in `theme()`](%nb-tooltips_theme%)
15+
- [Tooltip properties in `theme()`](%nb-themes%)

Writerside/v.list

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
33
<vars>
4-
<var name="version" value="4.9.3"/>
4+
<var name="version" value="4.9.4"/>
55
<var name="current_year" value="2025"/>
66
<var name="web_root" value="https://lets-plot.org"/>
77

@@ -84,7 +84,6 @@
8484
<var name="nb-geom_ydotplot" value="%nbviewer_cookbook%/geom_ydotplot.ipynb"/>
8585
<var name="nb-ggbunch" value="%nbviewer_cookbook%/ggbunch.ipynb"/>
8686
<var name="nb-gggrid_scale_share" value="%nbviewer_cookbook%/gggrid_scale_share.ipynb"/>
87-
<var name="nb-gggrid_theme" value="%nbviewer_cookbook%/gggrid_theme.ipynb"/>
8887
<var name="nb-graph_edges" value="%nbviewer_cookbook%/graph_edges.ipynb"/>
8988
<var name="nb-hjust_vjust" value="%nbviewer_cookbook%/hjust_vjust.ipynb"/>
9089
<var name="nb-horizontal_error_bars" value="%nbviewer_cookbook%/horizontal_error_bars.ipynb"/>
@@ -108,6 +107,7 @@
108107
<var name="nb-panel_border" value="%nbviewer_cookbook%/panel_border.ipynb"/>
109108
<var name="nb-param_width_unit" value="%nbviewer_cookbook%/param_width_unit.ipynb"/>
110109
<var name="nb-plot_grid" value="%nbviewer_cookbook%/plot_grid.ipynb"/>
110+
<var name="nb-position_nudge_unit" value="%nbviewer_cookbook%/position_nudge_unit.ipynb"/>
111111
<var name="nb-position_stack" value="%nbviewer_cookbook%/position_stack.ipynb"/>
112112
<var name="nb-projection_provided" value="%nbviewer_cookbook%/projection_provided.ipynb"/>
113113
<var name="nb-qq_plots" value="%nbviewer_cookbook%/qq_plots.ipynb"/>
@@ -132,13 +132,10 @@
132132
<var name="nb-text_geoms" value="https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/Lb69ZPTQWq3XbupPxnQ4Rh"/>
133133
<var name="nb-text_margins" value="%nbviewer_cookbook%/text_margins.ipynb"/>
134134
<var name="nb-theme_flavors" value="%nbviewer_cookbook%/theme_flavors.ipynb"/>
135-
<var name="nb-theme_plot_margin" value="%nbviewer_cookbook%/theme_plot_margin.ipynb"/>
136-
<var name="nb-theme_plot_message" value="%nbviewer_cookbook%/theme_plot_message.ipynb"/>
137-
<var name="nb-themes" value="%nbviewer_cookbook%/themes.ipynb"/>
135+
<var name="nb-themes" value="https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h"/>
138136
<var name="nb-title_subtitle_caption" value="%nbviewer_cookbook%/title_subtitle_caption.ipynb"/>
139137
<var name="nb-tooltip_config" value="%nbviewer_cookbook%/tooltip_config.ipynb"/>
140138
<var name="nb-tooltip_title" value="%nbviewer_cookbook%/tooltip_title.ipynb"/>
141-
<var name="nb-tooltips_theme" value="%nbviewer_cookbook%/tooltips_theme.ipynb"/>
142139
<var name="nb-waterfall_plot" value="%nbviewer_cookbook%/waterfall_plot.ipynb"/>
143140
<var name="nb-y_orientation" value="%nbviewer_cookbook%/y_orientation.ipynb"/>
144141
</vars>

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (project.file("local.properties").exists()) {
3333
allprojects {
3434
group = "org.jetbrains.lets-plot"
3535
version = when (name) {
36-
"dokka" -> "4.9.3"
36+
"dokka" -> "4.9.4"
3737
else -> "4.9.4-SNAPSHOT"
3838
// else -> "0.0.0-SNAPSHOT" // for local publishing only
3939
}

docs/dokka/source/packages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ See [tooltips.html](https://lets-plot.org/kotlin/tooltips.html).
174174

175175
- [tooltip_title.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/tooltip_title.ipynb)
176176

177-
- [tooltips_theme.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/tooltips_theme.ipynb)
177+
- [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h#Tooltips)
178178

179179
# Package org.jetbrains.letsPlot.annotations
180180

docs/examples/jupyter-notebooks/f-4.10.0/position_nudge_unit.ipynb

+36-35
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"source": [
88
"# Configuring Nudge Units in Position Adjustments\n",
99
"\n",
10-
"The position adjustment `position_nudge()` now supports the `unit` parameter that specifies the measurement system for nudge offsets. <br/>\n",
11-
"Equivalent parameter is also available as `nudge_unit` in `geom_text()` and `geom_label()` directly. \n",
10+
"The position adjustment `positionNudge()` now supports the `unit` parameter that specifies the measurement system for nudge offsets. <br/>\n",
11+
"Equivalent parameter is also available as `nudgeUnit` in `geomText()` and `geomLabel()` directly. \n",
1212
"\n",
1313
"Available Units:\n",
1414
"\n",
15-
"- `'identity'` (default): nudge in data coordinates - a value of 1 corresponds to the distance from 0 to 1 on the axis\n",
16-
"- `'size'`: nudge relative to point size - a value of 1 corresponds to the diameter of a point with size 1\n",
17-
"- `'px'`: nudge in fixed pixels - a value of 1 corresponds to 1 pixel"
15+
"- `\"identity\"` (default): nudge in data coordinates - a value of 1 corresponds to the distance from 0 to 1 on the axis\n",
16+
"- `\"size\"`: nudge relative to point size - a value of 1 corresponds to the diameter of a point with size 1\n",
17+
"- `\"px\"`: nudge in fixed pixels - a value of 1 corresponds to 1 pixel"
1818
]
1919
},
2020
{
@@ -26,7 +26,7 @@
2626
{
2727
"data": {
2828
"text/html": [
29-
" <div id=\"4DSxKL\"></div>\n",
29+
" <div id=\"JnN9cv\"></div>\n",
3030
" <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
3131
" if(!window.letsPlotCallQueue) {\n",
3232
" window.letsPlotCallQueue = [];\n",
@@ -37,7 +37,7 @@
3737
" (function() {\n",
3838
" var script = document.createElement(\"script\");\n",
3939
" script.type = \"text/javascript\";\n",
40-
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/[email protected].0/js-package/distr/lets-plot.min.js\";\n",
40+
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/[email protected].1/js-package/distr/lets-plot.min.js\";\n",
4141
" script.onload = function() {\n",
4242
" window.letsPlotCall = function(f) {f();};\n",
4343
" window.letsPlotCallQueue.forEach(function(f) {f();});\n",
@@ -51,9 +51,9 @@
5151
" var div = document.createElement(\"div\");\n",
5252
" div.style.color = 'darkred';\n",
5353
" div.textContent = 'Error loading Lets-Plot JS';\n",
54-
" document.getElementById(\"4DSxKL\").appendChild(div);\n",
54+
" document.getElementById(\"JnN9cv\").appendChild(div);\n",
5555
" };\n",
56-
" var e = document.getElementById(\"4DSxKL\");\n",
56+
" var e = document.getElementById(\"JnN9cv\");\n",
5757
" e.appendChild(script);\n",
5858
" })();\n",
5959
" </script>"
@@ -77,7 +77,7 @@
7777
{
7878
"data": {
7979
"text/plain": [
80-
"Lets-Plot Kotlin API v.hehe. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.6.0."
80+
"Lets-Plot Kotlin API v.4.6.1. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.6.1."
8181
]
8282
},
8383
"execution_count": 2,
@@ -106,7 +106,7 @@
106106
{
107107
"data": {
108108
"text/html": [
109-
" <div id=\"mynfho\"></div>\n",
109+
" <div id=\"0l8qfx\"></div>\n",
110110
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
111111
" \n",
112112
" (function() {\n",
@@ -131,7 +131,7 @@
131131
" };\n",
132132
" }\n",
133133
" \n",
134-
" const containerDiv = document.getElementById(\"mynfho\");\n",
134+
" const containerDiv = document.getElementById(\"0l8qfx\");\n",
135135
" let fig = null;\n",
136136
" \n",
137137
" function renderPlot() {\n",
@@ -221,8 +221,8 @@
221221
],
222222
"source": [
223223
"letsPlot() + \n",
224-
" geomPoint(x=0, y=0, size=10, color=\"#DA8459\") + \n",
225-
" geomText(x=0, y=0, label=\"text without nudge\") + \n",
224+
" geomPoint(x = 0, y = 0, size = 10, color = \"#DA8459\") + \n",
225+
" geomText(x = 0, y = 0, label = \"text without nudge\") + \n",
226226
" ggsize(400, 300)"
227227
]
228228
},
@@ -232,9 +232,10 @@
232232
"metadata": {},
233233
"source": [
234234
"#### 2. Unit Comparison: Pixel, Size, and Identity\n",
235-
"The `'size'` unit enables precise positioning relative to point dimensions.\n",
236235
"\n",
237-
"In this example, the point has `size=30` and text is positioned at half that distance (`nudge_y=15`). When combined with `vjust/hjust`, this allows for placing text at specific locations relative to the point boundary."
236+
"The `\"size\"` unit enables precise positioning relative to point dimensions.\n",
237+
"\n",
238+
"In this example, the point has `size = 30` and text is positioned at half that distance (`nudgeY = 15`). When combined with `vjust`/`hjust`, this allows for placing text at specific locations relative to the point boundary."
238239
]
239240
},
240241
{
@@ -246,7 +247,7 @@
246247
{
247248
"data": {
248249
"text/html": [
249-
" <div id=\"nuSyBd\"></div>\n",
250+
" <div id=\"PB9UUu\"></div>\n",
250251
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
251252
" \n",
252253
" (function() {\n",
@@ -271,7 +272,7 @@
271272
" };\n",
272273
" }\n",
273274
" \n",
274-
" const containerDiv = document.getElementById(\"nuSyBd\");\n",
275+
" const containerDiv = document.getElementById(\"PB9UUu\");\n",
275276
" let fig = null;\n",
276277
" \n",
277278
" function renderPlot() {\n",
@@ -450,25 +451,25 @@
450451
}
451452
],
452453
"source": [
453-
"letsPlot() + \n",
454-
" xlim(-1 to 4) + \n",
455-
" geomPoint(x=0, y=1, size=5, color=\"#B9534C\") + \n",
456-
" geomText(x=0, y=1, label=\"identity 0.2\", nudgeY=0.2) + \n",
457-
" geomPoint(x=1, y=1, size=5, color=\"#DA8459\") + \n",
458-
" geomText(x=1, y=1, label=\"px 40\", nudgeY=40, nudgeUnit=\"px\") + \n",
459-
" geomPoint(x=2, y=1, size=30, color=\"#EEAB65\") + \n",
460-
" geomText(x=2, y=1, label=\"size 15\", nudgeY=15, nudgeUnit=\"size\") + \n",
461-
" geomPoint(x=3, y=1, size=30, color=\"#F6C971\") + \n",
462-
" geomText(x=3, y=1, label=\"size 15 vjust 0\", nudgeY=15, vjust=0, nudgeUnit=\"size\") + \n",
463-
" geomText(x=3, y=1, label=\"size -15 vjust 1\", nudgeY=-15, vjust=1, nudgeUnit=\"size\")"
454+
"letsPlot() +\n",
455+
" xlim(-1 to 4) +\n",
456+
" geomPoint(x = 0, y = 1, size = 5, color = \"#B9534C\") +\n",
457+
" geomText(x = 0, y = 1, label = \"identity 0.2\", nudgeY = 0.2) +\n",
458+
" geomPoint(x = 1, y = 1, size = 5, color = \"#DA8459\") +\n",
459+
" geomText(x = 1, y = 1, label = \"px 40\", nudgeY = 40, nudgeUnit = \"px\") +\n",
460+
" geomPoint(x = 2, y = 1, size = 30, color = \"#EEAB65\") +\n",
461+
" geomText(x = 2, y = 1, label = \"size 15\", nudgeY = 15, nudgeUnit = \"size\") +\n",
462+
" geomPoint(x = 3, y = 1, size = 30, color = \"#F6C971\") +\n",
463+
" geomText(x = 3, y = 1, label = \"size 15 vjust 0\", nudgeY = 15, vjust = 0, nudgeUnit = \"size\") +\n",
464+
" geomText(x = 3, y = 1, label = \"size -15 vjust 1\", nudgeY = -15, vjust = 1, nudgeUnit = \"size\")"
464465
]
465466
},
466467
{
467468
"cell_type": "markdown",
468469
"id": "b8f317a8-5aec-4ba7-8646-cbad83c13742",
469470
"metadata": {},
470471
"source": [
471-
"#### 3. Parameter `unit` in `position_nudge()`"
472+
"#### 3. Parameter `unit` in `positionNudge()`"
472473
]
473474
},
474475
{
@@ -480,7 +481,7 @@
480481
{
481482
"data": {
482483
"text/html": [
483-
" <div id=\"UXksSH\"></div>\n",
484+
" <div id=\"qBUfgi\"></div>\n",
484485
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
485486
" \n",
486487
" (function() {\n",
@@ -505,7 +506,7 @@
505506
" };\n",
506507
" }\n",
507508
" \n",
508-
" const containerDiv = document.getElementById(\"UXksSH\");\n",
509+
" const containerDiv = document.getElementById(\"qBUfgi\");\n",
509510
" let fig = null;\n",
510511
" \n",
511512
" function renderPlot() {\n",
@@ -613,9 +614,9 @@
613614
],
614615
"source": [
615616
"letsPlot() + \n",
616-
" geomPoint(x=0, y=0, size=50, color=\"#DA8459\") + \n",
617-
" geomPoint(x=0, y=0, size=20, color=\"blue\", position=positionNudge(0, 25, \"size\")) + \n",
618-
" geomText(x=0, y=0, label=\"position_nudge size 25\", position=positionNudge(50, 25, \"size\"))"
617+
" geomPoint(x = 0, y = 0, size = 50, color = \"#DA8459\") + \n",
618+
" geomPoint(x = 0, y = 0, size = 20, color = \"blue\", position = positionNudge(0, 25, \"size\")) + \n",
619+
" geomText(x = 0, y = 0, label = \"position_nudge size 25\", position = positionNudge(50, 25, \"size\"))"
619620
]
620621
}
621622
],

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

+7-16
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,12 @@ import org.jetbrains.letsPlot.intern.filterNonNullValues
2424
*
2525
* ## Examples
2626
*
27-
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
27+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
2828
*
2929
* - [legend.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/legend.ipynb)
3030
*
31-
* - [theme_label_text.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_label_text.ipynb)
32-
*
3331
* - [superscript_exponent.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/superscript_exponent.ipynb)
3432
*
35-
* - [theme_panel_inset.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_panel_inset.ipynb)
36-
*
37-
* - [theme_plot_inset.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_plot_inset.ipynb)
38-
*
39-
*
4033
* @param exponentFormat default="e" ("e", "pow", "pow_full").
4134
* Controls the appearance of numbers formatted with "e" or "g" types.
4235
*
@@ -478,7 +471,7 @@ class theme(
478471
*
479472
* ## Examples
480473
*
481-
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
474+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
482475
*/
483476
fun elementBlank() = mapOf(Option.Theme.Elem.BLANK to true)
484477

@@ -489,9 +482,7 @@ fun elementBlank() = mapOf(Option.Theme.Elem.BLANK to true)
489482
*
490483
* ## Examples
491484
*
492-
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
493-
*
494-
* - [theme_linetype.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_linetype.ipynb)
485+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
495486
*
496487
* @param fill Fill color. Accepts color core as string (HEX or rgb) or Color object.
497488
* @param color Border color. Accepts color core as string (HEX or rgb) or Color object.
@@ -523,9 +514,7 @@ fun elementRect(
523514
*
524515
* ## Examples
525516
*
526-
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
527-
*
528-
* - [theme_linetype.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_linetype.ipynb)
517+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
529518
*
530519
* @param color Line color. Accepts color core as string (HEX or rgb) or Color object.
531520
* @param size Line width.
@@ -554,7 +543,7 @@ fun elementLine(
554543
*
555544
* ## Examples
556545
*
557-
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
546+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
558547
*
559548
* - [axis_text_angle.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/axis_text_angle.ipynb)
560549
*
@@ -613,6 +602,8 @@ fun elementText(
613602
*
614603
* ## Examples
615604
*
605+
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
606+
*
616607
* - [markdown.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/markdown.ipynb)
617608
*
618609
* @param color Text color. Accepts color core as string (HEX or rgb) or Color object.

0 commit comments

Comments
 (0)