diff --git a/Writerside/images/changelog/4.11.0/bitcoin_trading.png b/Writerside/images/changelog/4.11.0/bitcoin_trading.png new file mode 100644 index 000000000..25bbd8179 Binary files /dev/null and b/Writerside/images/changelog/4.11.0/bitcoin_trading.png differ diff --git a/Writerside/images/changelog/4.11.0/combo_discrete_continuous.png b/Writerside/images/changelog/4.11.0/combo_discrete_continuous.png new file mode 100644 index 000000000..ce5631ad6 Binary files /dev/null and b/Writerside/images/changelog/4.11.0/combo_discrete_continuous.png differ diff --git a/Writerside/images/changelog/4.11.0/geom_repel.png b/Writerside/images/changelog/4.11.0/geom_repel.png new file mode 100644 index 000000000..42d24149e Binary files /dev/null and b/Writerside/images/changelog/4.11.0/geom_repel.png differ diff --git a/Writerside/images/changelog/4.11.0/geom_sina.png b/Writerside/images/changelog/4.11.0/geom_sina.png new file mode 100644 index 000000000..74bdb7166 Binary files /dev/null and b/Writerside/images/changelog/4.11.0/geom_sina.png differ diff --git a/Writerside/images/changelog/4.11.0/plot_layout_diagram.png b/Writerside/images/changelog/4.11.0/plot_layout_diagram.png new file mode 100644 index 000000000..f9e9478b1 Binary files /dev/null and b/Writerside/images/changelog/4.11.0/plot_layout_diagram.png differ diff --git a/Writerside/images/changelog/4.11.0/time_date_datetime.png b/Writerside/images/changelog/4.11.0/time_date_datetime.png new file mode 100644 index 000000000..db6af65ff Binary files /dev/null and b/Writerside/images/changelog/4.11.0/time_date_datetime.png differ diff --git a/Writerside/images/changelog/4.11.0/waterfall_plot_annotations.png b/Writerside/images/changelog/4.11.0/waterfall_plot_annotations.png new file mode 100644 index 000000000..4e980d5c1 Binary files /dev/null and b/Writerside/images/changelog/4.11.0/waterfall_plot_annotations.png differ diff --git a/Writerside/images/changelog/4.11.0/waterfall_plot_layers.png b/Writerside/images/changelog/4.11.0/waterfall_plot_layers.png new file mode 100644 index 000000000..3dc996e3c Binary files /dev/null and b/Writerside/images/changelog/4.11.0/waterfall_plot_layers.png differ diff --git a/Writerside/images/previews/square-europe_capitals.png b/Writerside/images/previews/square-europe_capitals.png new file mode 100644 index 000000000..119418de1 Binary files /dev/null and b/Writerside/images/previews/square-europe_capitals.png differ diff --git a/Writerside/images/previews/square-klein_bottle.png b/Writerside/images/previews/square-klein_bottle.png new file mode 100644 index 000000000..bf793637b Binary files /dev/null and b/Writerside/images/previews/square-klein_bottle.png differ diff --git a/Writerside/images/previews/square-periodic_table.png b/Writerside/images/previews/square-periodic_table.png new file mode 100644 index 000000000..fc6117e82 Binary files /dev/null and b/Writerside/images/previews/square-periodic_table.png differ diff --git a/Writerside/images/previews/square-post-punk_remake.png b/Writerside/images/previews/square-post-punk_remake.png new file mode 100644 index 000000000..10937437f Binary files /dev/null and b/Writerside/images/previews/square-post-punk_remake.png differ diff --git a/Writerside/images/previews/square-raincloud.png b/Writerside/images/previews/square-raincloud.png new file mode 100644 index 000000000..3f298f39b Binary files /dev/null and b/Writerside/images/previews/square-raincloud.png differ diff --git a/Writerside/lpk.tree b/Writerside/lpk.tree index 3ce68ecab..e894fdc82 100644 --- a/Writerside/lpk.tree +++ b/Writerside/lpk.tree @@ -10,6 +10,7 @@ + diff --git a/Writerside/topics/charts.md b/Writerside/topics/charts.md index adf98343a..84359968c 100644 --- a/Writerside/topics/charts.md +++ b/Writerside/topics/charts.md @@ -213,10 +213,36 @@ Examples: [`scaleXTime()`](%api_scale%/scale-x-time.html), [`scaleYTime()`](%api_scale%/scale-y-time.html) +*Lets-Plot* handles all temporal data types through a unified "datetime" scale (excluding duration, which is handled by the "time" scale). +This is in contrast to R's ggplot2, which provides separate "date", "time", and "datetime" scales. + +**Supported temporal data types**: + +- `kotlinx.datetime` library: + + - `Instant` + - `LocalDate` + - `LocalTime` + - `LocalDateTime` + +- `java.time` package: + + - `Instant` + - `LocalDate` + - `LocalTime` + - `LocalDateTime` + - `ZonedDateTime` (timezone-aware) + - `OffsetDateTime` (timezone-aware with offset) + +- `java.util` package: + + - `Date` + Examples: - [Scale time](%nb-scale_time%) - [Plotting time series](%nb-time_date_datetime%) +- [Bitcoin daily trend visualization](%nb-trading_chart%) ## Images diff --git a/Writerside/topics/gallery.md b/Writerside/topics/gallery.md index 5e99751f0..ff2261d38 100644 --- a/Writerside/topics/gallery.md +++ b/Writerside/topics/gallery.md @@ -1,6 +1,16 @@ # Gallery +
  • + + Raincloud plot + +
  • +
  • + + Lets-Plot GeoTools with texts and labels + +
  • Bitcoin daily trend visualization (2024) @@ -51,11 +61,21 @@ Wind rose
  • +
  • + + Mendeleev's periodic table of elements + +
  • Palmer penguins
  • +
  • + + A post-punk chart remake + +
  • MPG daisy @@ -66,4 +86,9 @@ Inset map of Kotlin island
  • +
  • + + Klein bottle visualization + +
  • \ No newline at end of file diff --git a/Writerside/topics/whats_new.md b/Writerside/topics/whats_new.md new file mode 100644 index 000000000..82c2add28 --- /dev/null +++ b/Writerside/topics/whats_new.md @@ -0,0 +1,123 @@ +# What Is New in 4.11.0 + +- **Time Series Plotting** + + - Support temporal data types from `kotlinx.datetime`, `java.time`, and `java.util`. + + - Support for timezone-aware `java.time.ZonedDateTime` and `java.time.OffsetDateTime` objects. + + changelog/4.11.0/time_date_datetime.png + + See [Date-time](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/time_date_datetime.ipynb) cookbook. +

    + + changelog/4.11.0/bitcoin_trading.png + + See [Bitcoin trading](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/demo/trading_chart.ipynb) demo. +

    + +- **`geomSina()` Geometry** + + changelog/4.11.0/geom_sina.png + + See: [example notebook](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/geom_sina.ipynb). + +- **`geomTextRepel()` and `geomLabelRepel()` Geometries** + + changelog/4.11.0/geom_repel.png + + See: [example notebook](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/ggrepel.ipynb). + +- **`waterfallPlot()` Chart** + + - Annotations support via `relativeLabels` and `absoluteLabels` parameters. +

    + + changelog/4.11.0/waterfall_plot_annotations.png + + See: [example notebook](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/waterfall_plot_annotations.ipynb). +

    + + - Support for combining waterfall bars with other geometry layers. +

    + + changelog/4.11.0/waterfall_plot_layers.png + + See: [example notebook](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/waterfall_plot_layers.ipynb). + +- **Continuous Data on Discrete Scales** + + Continuous data when used with discrete positional scales is no longer transformed to discrete data.
    + Instead, it remains continuous, allowing for precise positioning of continuous elements relative to discrete ones. +

    + + changelog/4.11.0/combo_discrete_continuous.png + + See: [example notebook](https://nbviewer.org/github/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/f-4.11.0/numeric_data_on_discrete_scale.ipynb). + + > [!TIP] + > New way of handling continuous data on discrete scales could potentially break existing plots. + > 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. + +- **Plot Layout** + + The default plot layout has been improved to better accommodate axis labels and titles.
    + Also, new `theme()` options `axisTextSpacing`, `axisTextSpacingX`, and `axisTextSpacingY` control spacing between axis ticks and labels. +

    + + changelog/4.11.0/plot_layout_diagram.png + + See new [Plot Layout Diagrams](https://lets-plot.org/kotlin/presentation-options.html#plot-layout-diagrams) showing various layout options and their effects on plot appearance. + +- **And More** + + See [CHANGELOG.md](https://github.com/JetBrains/lets-plot-kotlin/blob/master/CHANGELOG.md) for a full list of changes. + +## Recent Updates in the [Gallery](gallery.md) + + +
  • + + Raincloud plot + +
  • +
  • + + Lets-Plot GeoTools with texts and labels + +
  • +
  • + + Bitcoin daily trend visualization (2024) + +
  • +
  • + + Creating magnifier inset effect with ggbunch() + +
  • +
  • + + Theme legend scheme + +
  • +
  • + + Zoom and Pan interactivity + +
  • +
  • + + The observable LP-verse + +
  • +
  • + + Sunshine hours + +
  • +
    + +## Change Log + +See [CHANGELOG.md](https://github.com/JetBrains/lets-plot-kotlin/blob/master/CHANGELOG.md) for other changes and fixes. \ No newline at end of file diff --git a/Writerside/v.list b/Writerside/v.list index 0ed57aedf..c8b42f386 100644 --- a/Writerside/v.list +++ b/Writerside/v.list @@ -31,13 +31,18 @@ + + - + + + + diff --git a/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_label_repel.kt b/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_label_repel.kt index f67472cb7..468b5f5c4 100644 --- a/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_label_repel.kt +++ b/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_label_repel.kt @@ -78,6 +78,19 @@ import org.jetbrains.letsPlot.tooltips.TooltipOptions * 1 or "top" - top-aligned (top of text at y). * There are two special alignments: "inward" (aligns text towards the plot center) and "outward" (away from the plot center). * @param angle Label rotation angle in degrees. + * @param shape Shape of the point. + * For more info see: [aesthetics.html#point-shapes](https://lets-plot.org/kotlin/aesthetics.html#point-shapes). + * @param pointSize A value representing the visual size of the point associated with the label. + * Set to 0 to prevent label repulsion from data points. + * @param pointStroke Width of the point border. + * @param segmentColor Color of the line segment connecting the label to the point. + * @param segmentSize Width of the line segment connecting the label to the point. + * @param segmentAlpha Transparency level of the line segment. Understands numbers between 0 and 1. + * @param linetype Type of the line. + * Accept codes or names (0 = "blank", 1 = "solid", 2 = "dashed", 3 = "dotted", 4 = "dotdash", 5 = "longdash", 6 = "twodash"), + * a hex string (up to 8 digits for dash-gap lengths), + * or a pattern `offset to listOf(dash, gap, ...)` / `listOf(dash, gap, ...)`. + * For more info see: [aesthetics.html#line-types](https://lets-plot.org/kotlin/aesthetics.html#line-types). * @param lineheight Line height multiplier applied to the font size in the case of multi-line text. * @param labelFormat Specifies the format pattern for displaying mapped values. * @param naText default = "n/a". diff --git a/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_text_repel.kt b/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_text_repel.kt index dfe9c221e..d0699d5a0 100644 --- a/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_text_repel.kt +++ b/plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/geom/geom_text_repel.kt @@ -75,6 +75,19 @@ import org.jetbrains.letsPlot.tooltips.TooltipOptions * 1 or "top" - top-aligned (top of text at y). * There are two special alignments: "inward" (aligns text towards the plot center) and "outward" (away from the plot center). * @param angle Text rotation angle in degrees. + * @param shape Shape of the point. + * For more info see: [aesthetics.html#point-shapes](https://lets-plot.org/kotlin/aesthetics.html#point-shapes). + * @param pointSize A value representing the visual size of the point associated with the label. + * Set to 0 to prevent label repulsion from data points. + * @param pointStroke Width of the point border. + * @param segmentColor Color of the line segment connecting the label to the point. + * @param segmentSize Width of the line segment connecting the label to the point. + * @param segmentAlpha Transparency level of the line segment. Understands numbers between 0 and 1. + * @param linetype Type of the line. + * Accept codes or names (0 = "blank", 1 = "solid", 2 = "dashed", 3 = "dotted", 4 = "dotdash", 5 = "longdash", 6 = "twodash"), + * a hex string (up to 8 digits for dash-gap lengths), + * or a pattern `offset to listOf(dash, gap, ...)` / `listOf(dash, gap, ...)`. + * For more info see: [aesthetics.html#line-types](https://lets-plot.org/kotlin/aesthetics.html#line-types). * @param lineheight Line height multiplier applied to the font size in the case of multi-line text. * @param labelFormat Specifies the format pattern for displaying mapped values. * @param naText default = "n/a".