Skip to content

Docs: update the library version, update notebook about nudgeUnit, replace cookbooks about themes #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Writerside/topics/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Examples:
- [Ribbon geometry](%nb-ribbon%)
- [How to draw curve fast](%nb-algebraic_curve%)
- [`stroke` aesthetic](%nb-aes_stroke%)
- [Configuring nudge units in position adjustments](%nb-position_nudge_unit%)


## Discrete
Expand Down
8 changes: 2 additions & 6 deletions Writerside/topics/presentation_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@

- [Themes overview](%nb-themes%)
- [Default theme](%nb-default_theme%)
- [Applying common theme to a plot group](%nb-gggrid_theme%)
- [Plot margins](%nb-theme_plot_margin%)
- [Option to show/hide plot messages](%nb-theme_plot_message%)
- [Justification for text elements](%nb-hjust_vjust%)
- [Margins](%nb-margins%)
- [`margin` parameter of `elementText()`](%nb-text_margins%)
- [Panel border](%nb-panel_border%)
- [Tooltip properties in `theme()`](%nb-tooltips_theme%)
- [Plot title, subtitle and caption](%nb-title_subtitle_caption%)
- [Theme colors for geometries](%nb-geom_theme_colors%)
- [Customize legend appearance](%nb-legend_theme%)
Expand Down Expand Up @@ -52,8 +48,8 @@
### Predefined Themes Examples

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

- [Theme flavors](%nb-theme_flavors%)
- [Applying common theme to a plot group](%nb-gggrid_theme%)
- [Themes overview](%nb-themes%)
- [Theme colors for geometries](%nb-geom_theme_colors%)
- [Annotation labels on pie-chart](%nb-annotations_for_pie%)
2 changes: 1 addition & 1 deletion Writerside/topics/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ See also the [formatting reference](formats.md) to learn how to format numeric a

- [Tooltip title](%nb-tooltip_title%)
- [Tooltip customization](%nb-tooltip_config%)
- [Tooltip properties in `theme()`](%nb-tooltips_theme%)
- [Tooltip properties in `theme()`](%nb-themes%)
9 changes: 3 additions & 6 deletions Writerside/v.list
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
<vars>
<var name="version" value="4.9.3"/>
<var name="version" value="4.9.4"/>
<var name="current_year" value="2025"/>
<var name="web_root" value="https://lets-plot.org"/>

Expand Down Expand Up @@ -84,7 +84,6 @@
<var name="nb-geom_ydotplot" value="%nbviewer_cookbook%/geom_ydotplot.ipynb"/>
<var name="nb-ggbunch" value="%nbviewer_cookbook%/ggbunch.ipynb"/>
<var name="nb-gggrid_scale_share" value="%nbviewer_cookbook%/gggrid_scale_share.ipynb"/>
<var name="nb-gggrid_theme" value="%nbviewer_cookbook%/gggrid_theme.ipynb"/>
<var name="nb-graph_edges" value="%nbviewer_cookbook%/graph_edges.ipynb"/>
<var name="nb-hjust_vjust" value="%nbviewer_cookbook%/hjust_vjust.ipynb"/>
<var name="nb-horizontal_error_bars" value="%nbviewer_cookbook%/horizontal_error_bars.ipynb"/>
Expand All @@ -108,6 +107,7 @@
<var name="nb-panel_border" value="%nbviewer_cookbook%/panel_border.ipynb"/>
<var name="nb-param_width_unit" value="%nbviewer_cookbook%/param_width_unit.ipynb"/>
<var name="nb-plot_grid" value="%nbviewer_cookbook%/plot_grid.ipynb"/>
<var name="nb-position_nudge_unit" value="%nbviewer_cookbook%/position_nudge_unit.ipynb"/>
<var name="nb-position_stack" value="%nbviewer_cookbook%/position_stack.ipynb"/>
<var name="nb-projection_provided" value="%nbviewer_cookbook%/projection_provided.ipynb"/>
<var name="nb-qq_plots" value="%nbviewer_cookbook%/qq_plots.ipynb"/>
Expand All @@ -132,13 +132,10 @@
<var name="nb-text_geoms" value="https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/Lb69ZPTQWq3XbupPxnQ4Rh"/>
<var name="nb-text_margins" value="%nbviewer_cookbook%/text_margins.ipynb"/>
<var name="nb-theme_flavors" value="%nbviewer_cookbook%/theme_flavors.ipynb"/>
<var name="nb-theme_plot_margin" value="%nbviewer_cookbook%/theme_plot_margin.ipynb"/>
<var name="nb-theme_plot_message" value="%nbviewer_cookbook%/theme_plot_message.ipynb"/>
<var name="nb-themes" value="%nbviewer_cookbook%/themes.ipynb"/>
<var name="nb-themes" value="https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h"/>
<var name="nb-title_subtitle_caption" value="%nbviewer_cookbook%/title_subtitle_caption.ipynb"/>
<var name="nb-tooltip_config" value="%nbviewer_cookbook%/tooltip_config.ipynb"/>
<var name="nb-tooltip_title" value="%nbviewer_cookbook%/tooltip_title.ipynb"/>
<var name="nb-tooltips_theme" value="%nbviewer_cookbook%/tooltips_theme.ipynb"/>
<var name="nb-waterfall_plot" value="%nbviewer_cookbook%/waterfall_plot.ipynb"/>
<var name="nb-y_orientation" value="%nbviewer_cookbook%/y_orientation.ipynb"/>
</vars>
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (project.file("local.properties").exists()) {
allprojects {
group = "org.jetbrains.lets-plot"
version = when (name) {
"dokka" -> "4.9.3"
"dokka" -> "4.9.4"
else -> "4.9.4-SNAPSHOT"
// else -> "0.0.0-SNAPSHOT" // for local publishing only
}
Expand Down
2 changes: 1 addition & 1 deletion docs/dokka/source/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ See [tooltips.html](https://lets-plot.org/kotlin/tooltips.html).

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

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

# Package org.jetbrains.letsPlot.annotations

Expand Down
71 changes: 36 additions & 35 deletions docs/examples/jupyter-notebooks/f-4.10.0/position_nudge_unit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"source": [
"# Configuring Nudge Units in Position Adjustments\n",
"\n",
"The position adjustment `position_nudge()` now supports the `unit` parameter that specifies the measurement system for nudge offsets. <br/>\n",
"Equivalent parameter is also available as `nudge_unit` in `geom_text()` and `geom_label()` directly. \n",
"The position adjustment `positionNudge()` now supports the `unit` parameter that specifies the measurement system for nudge offsets. <br/>\n",
"Equivalent parameter is also available as `nudgeUnit` in `geomText()` and `geomLabel()` directly. \n",
"\n",
"Available Units:\n",
"\n",
"- `'identity'` (default): nudge in data coordinates - a value of 1 corresponds to the distance from 0 to 1 on the axis\n",
"- `'size'`: nudge relative to point size - a value of 1 corresponds to the diameter of a point with size 1\n",
"- `'px'`: nudge in fixed pixels - a value of 1 corresponds to 1 pixel"
"- `\"identity\"` (default): nudge in data coordinates - a value of 1 corresponds to the distance from 0 to 1 on the axis\n",
"- `\"size\"`: nudge relative to point size - a value of 1 corresponds to the diameter of a point with size 1\n",
"- `\"px\"`: nudge in fixed pixels - a value of 1 corresponds to 1 pixel"
]
},
{
Expand All @@ -26,7 +26,7 @@
{
"data": {
"text/html": [
" <div id=\"4DSxKL\"></div>\n",
" <div id=\"JnN9cv\"></div>\n",
" <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
" if(!window.letsPlotCallQueue) {\n",
" window.letsPlotCallQueue = [];\n",
Expand All @@ -37,7 +37,7 @@
" (function() {\n",
" var script = document.createElement(\"script\");\n",
" script.type = \"text/javascript\";\n",
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.6.0/js-package/distr/lets-plot.min.js\";\n",
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.6.1/js-package/distr/lets-plot.min.js\";\n",
" script.onload = function() {\n",
" window.letsPlotCall = function(f) {f();};\n",
" window.letsPlotCallQueue.forEach(function(f) {f();});\n",
Expand All @@ -51,9 +51,9 @@
" var div = document.createElement(\"div\");\n",
" div.style.color = 'darkred';\n",
" div.textContent = 'Error loading Lets-Plot JS';\n",
" document.getElementById(\"4DSxKL\").appendChild(div);\n",
" document.getElementById(\"JnN9cv\").appendChild(div);\n",
" };\n",
" var e = document.getElementById(\"4DSxKL\");\n",
" var e = document.getElementById(\"JnN9cv\");\n",
" e.appendChild(script);\n",
" })();\n",
" </script>"
Expand All @@ -77,7 +77,7 @@
{
"data": {
"text/plain": [
"Lets-Plot Kotlin API v.hehe. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.6.0."
"Lets-Plot Kotlin API v.4.6.1. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.6.1."
]
},
"execution_count": 2,
Expand Down Expand Up @@ -106,7 +106,7 @@
{
"data": {
"text/html": [
" <div id=\"mynfho\"></div>\n",
" <div id=\"0l8qfx\"></div>\n",
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
" \n",
" (function() {\n",
Expand All @@ -131,7 +131,7 @@
" };\n",
" }\n",
" \n",
" const containerDiv = document.getElementById(\"mynfho\");\n",
" const containerDiv = document.getElementById(\"0l8qfx\");\n",
" let fig = null;\n",
" \n",
" function renderPlot() {\n",
Expand Down Expand Up @@ -221,8 +221,8 @@
],
"source": [
"letsPlot() + \n",
" geomPoint(x=0, y=0, size=10, color=\"#DA8459\") + \n",
" geomText(x=0, y=0, label=\"text without nudge\") + \n",
" geomPoint(x = 0, y = 0, size = 10, color = \"#DA8459\") + \n",
" geomText(x = 0, y = 0, label = \"text without nudge\") + \n",
" ggsize(400, 300)"
]
},
Expand All @@ -232,9 +232,10 @@
"metadata": {},
"source": [
"#### 2. Unit Comparison: Pixel, Size, and Identity\n",
"The `'size'` unit enables precise positioning relative to point dimensions.\n",
"\n",
"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."
"The `\"size\"` unit enables precise positioning relative to point dimensions.\n",
"\n",
"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."
]
},
{
Expand All @@ -246,7 +247,7 @@
{
"data": {
"text/html": [
" <div id=\"nuSyBd\"></div>\n",
" <div id=\"PB9UUu\"></div>\n",
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
" \n",
" (function() {\n",
Expand All @@ -271,7 +272,7 @@
" };\n",
" }\n",
" \n",
" const containerDiv = document.getElementById(\"nuSyBd\");\n",
" const containerDiv = document.getElementById(\"PB9UUu\");\n",
" let fig = null;\n",
" \n",
" function renderPlot() {\n",
Expand Down Expand Up @@ -450,25 +451,25 @@
}
],
"source": [
"letsPlot() + \n",
" xlim(-1 to 4) + \n",
" geomPoint(x=0, y=1, size=5, color=\"#B9534C\") + \n",
" geomText(x=0, y=1, label=\"identity 0.2\", nudgeY=0.2) + \n",
" geomPoint(x=1, y=1, size=5, color=\"#DA8459\") + \n",
" geomText(x=1, y=1, label=\"px 40\", nudgeY=40, nudgeUnit=\"px\") + \n",
" geomPoint(x=2, y=1, size=30, color=\"#EEAB65\") + \n",
" geomText(x=2, y=1, label=\"size 15\", nudgeY=15, nudgeUnit=\"size\") + \n",
" geomPoint(x=3, y=1, size=30, color=\"#F6C971\") + \n",
" geomText(x=3, y=1, label=\"size 15 vjust 0\", nudgeY=15, vjust=0, nudgeUnit=\"size\") + \n",
" geomText(x=3, y=1, label=\"size -15 vjust 1\", nudgeY=-15, vjust=1, nudgeUnit=\"size\")"
"letsPlot() +\n",
" xlim(-1 to 4) +\n",
" geomPoint(x = 0, y = 1, size = 5, color = \"#B9534C\") +\n",
" geomText(x = 0, y = 1, label = \"identity 0.2\", nudgeY = 0.2) +\n",
" geomPoint(x = 1, y = 1, size = 5, color = \"#DA8459\") +\n",
" geomText(x = 1, y = 1, label = \"px 40\", nudgeY = 40, nudgeUnit = \"px\") +\n",
" geomPoint(x = 2, y = 1, size = 30, color = \"#EEAB65\") +\n",
" geomText(x = 2, y = 1, label = \"size 15\", nudgeY = 15, nudgeUnit = \"size\") +\n",
" geomPoint(x = 3, y = 1, size = 30, color = \"#F6C971\") +\n",
" geomText(x = 3, y = 1, label = \"size 15 vjust 0\", nudgeY = 15, vjust = 0, nudgeUnit = \"size\") +\n",
" geomText(x = 3, y = 1, label = \"size -15 vjust 1\", nudgeY = -15, vjust = 1, nudgeUnit = \"size\")"
]
},
{
"cell_type": "markdown",
"id": "b8f317a8-5aec-4ba7-8646-cbad83c13742",
"metadata": {},
"source": [
"#### 3. Parameter `unit` in `position_nudge()`"
"#### 3. Parameter `unit` in `positionNudge()`"
]
},
{
Expand All @@ -480,7 +481,7 @@
{
"data": {
"text/html": [
" <div id=\"UXksSH\"></div>\n",
" <div id=\"qBUfgi\"></div>\n",
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
" \n",
" (function() {\n",
Expand All @@ -505,7 +506,7 @@
" };\n",
" }\n",
" \n",
" const containerDiv = document.getElementById(\"UXksSH\");\n",
" const containerDiv = document.getElementById(\"qBUfgi\");\n",
" let fig = null;\n",
" \n",
" function renderPlot() {\n",
Expand Down Expand Up @@ -613,9 +614,9 @@
],
"source": [
"letsPlot() + \n",
" geomPoint(x=0, y=0, size=50, color=\"#DA8459\") + \n",
" geomPoint(x=0, y=0, size=20, color=\"blue\", position=positionNudge(0, 25, \"size\")) + \n",
" geomText(x=0, y=0, label=\"position_nudge size 25\", position=positionNudge(50, 25, \"size\"))"
" geomPoint(x = 0, y = 0, size = 50, color = \"#DA8459\") + \n",
" geomPoint(x = 0, y = 0, size = 20, color = \"blue\", position = positionNudge(0, 25, \"size\")) + \n",
" geomText(x = 0, y = 0, label = \"position_nudge size 25\", position = positionNudge(50, 25, \"size\"))"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,12 @@ import org.jetbrains.letsPlot.intern.filterNonNullValues
*
* ## Examples
*
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*
* - [legend.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/legend.ipynb)
*
* - [theme_label_text.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_label_text.ipynb)
*
* - [superscript_exponent.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/superscript_exponent.ipynb)
*
* - [theme_panel_inset.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_panel_inset.ipynb)
*
* - [theme_plot_inset.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_plot_inset.ipynb)
*
*
* @param exponentFormat default="e" ("e", "pow", "pow_full").
* Controls the appearance of numbers formatted with "e" or "g" types.
*
Expand Down Expand Up @@ -478,7 +471,7 @@ class theme(
*
* ## Examples
*
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*/
fun elementBlank() = mapOf(Option.Theme.Elem.BLANK to true)

Expand All @@ -489,9 +482,7 @@ fun elementBlank() = mapOf(Option.Theme.Elem.BLANK to true)
*
* ## Examples
*
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
*
* - [theme_linetype.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_linetype.ipynb)
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*
* @param fill Fill color. Accepts color core as string (HEX or rgb) or Color object.
* @param color Border color. Accepts color core as string (HEX or rgb) or Color object.
Expand Down Expand Up @@ -523,9 +514,7 @@ fun elementRect(
*
* ## Examples
*
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
*
* - [theme_linetype.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/theme_linetype.ipynb)
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*
* @param color Line color. Accepts color core as string (HEX or rgb) or Color object.
* @param size Line width.
Expand Down Expand Up @@ -554,7 +543,7 @@ fun elementLine(
*
* ## Examples
*
* - [themes.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/themes.ipynb)
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*
* - [axis_text_angle.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/axis_text_angle.ipynb)
*
Expand Down Expand Up @@ -613,6 +602,8 @@ fun elementText(
*
* ## Examples
*
* - [themes.ipynb](https://datalore.jetbrains.com/report/static/HZqq77cegYd.E7get_WnChZ/rjq52BpjPak2geihq3ol1h)
*
* - [markdown.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/markdown.ipynb)
*
* @param color Text color. Accepts color core as string (HEX or rgb) or Color object.
Expand Down