Skip to content

Commit 6d41c58

Browse files
Dokka: Fix KDocs for the ggsave().
1 parent 05260ef commit 6d41c58

File tree

2 files changed

+44
-40
lines changed

2 files changed

+44
-40
lines changed

plot-api/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
9494
}
9595

9696
dokkaSourceSets.named("commonMain") { displayName.set("Plot API") }
97+
dokkaSourceSets.named("jvmMain") { displayName.set("Plot API (JVM)") }
9798
}
9899

99100

plot-api/src/jvmMain/kotlin/org/jetbrains/letsPlot/export/ggsave.kt

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,67 +23,70 @@ private const val DEF_EXPORT_DIR = "lets-plot-images"
2323
* Supported formats: SVG, HTML, PNG, JPEG and TIFF.
2424
* Note: in some configurations raster formats might not be supported.
2525
*
26-
* If [path] is not specified, the output file will be saved in
26+
* If `path` is not specified, the output file will be saved in
2727
* `${user.dir}/lets-plot-images`.
2828
*
29-
* ## Examples
30-
*
31-
* - [export_to_file.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/export_to_file.ipynb)
32-
*
33-
* @param plot Plot to export.
34-
* @param filename Name of the file. Must include an extension matching
35-
* one of the supported formats: `.svg`, `.html`/`.htm`, `.png`, `.jpeg`/`.jpg`, or `.tiff`/`.tif`
36-
* @param scale Scaling factor (only for raster formats). Default: 2.0
37-
* @param w Width of the output image in units.
38-
* @param h Height of the output image in units.
39-
* @param unit Unit of the output image. One of: `"in"`, `"cm"`, `"mm"`, `"px"`.
40-
* Only applicable when exporting to SVG, PNG, JPG, or TIFF. For HTML, the unit is always `"px"` (pixels).
41-
* Default:
42-
* "px" (pixels) for SVG,
43-
* "in" (inches) for the raster formats (PNG, JPG, and TIFF).
44-
* @param dpi Resolution in dots per inch.
45-
* Only applicable when exporting to the raster formats: PNG, JPG, or TIFF.
46-
* The default value depends on the [unit]:
47-
* - for `"px"` it is `96` (output image will have the same pixel size as [w] and [h] values)
48-
* - for physical units (`"in"`, `"cm"`, `"mm"`) it is `300`.
49-
* @param path Path to a directory to save image files in.
50-
* Default: `${user.dir}/lets-plot-images`
51-
*
52-
* @return Absolute pathname of the created file.
53-
*
54-
* ### Notes
29+
* ## Notes
5530
*
5631
* The output format is inferred from the file extension.
5732
*
5833
* **For PNG and PDF:**
5934
*
60-
* - If [w], [h], [unit], and [dpi] are all specified:
35+
* - If `w`, `h`, `unit`, and `dpi` are all specified:
6136
*
62-
* - The plot's pixel size (default or set via [ggsize()](https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot/ggsize.html) is ignored.
37+
* - The plot's pixel size (default or set via [ggsize()][org.jetbrains.letsPlot.ggsize]) is ignored.
6338
* - The output size is computed from the given dimensions and DPI.
64-
* - The plot is resized to fit the specified [w] x [h] area, which may affect the layout.
39+
* - The plot is resized to fit the specified `w` x `h` area, which may affect the layout.
6540
*
66-
* - If only [dpi] is specified:
67-
* - The plot's pixel size (default or set via [ggsize()](https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot/ggsize.html)) is converted to inches assuming the standard display PPI of 96 PPI.
68-
* - The output size is computed from this size and [dpi].
41+
* - If only `dpi` is specified:
42+
* - The plot's pixel size (default or set via [ggsize()][org.jetbrains.letsPlot.ggsize]) is converted to inches assuming the standard display PPI of 96 PPI.
43+
* - The output size is computed from this size and `dpi`.
6944
* - The plot maintains its aspect ratio, preserving layout, tick labels, and other visual elements.
7045
* - Useful for printing - the plot will appear nearly the same size as on screen.
7146
*
72-
* - If [w] and [h] are not specified:
73-
* - The [scale] parameter is used to determine the output size.
47+
* - If `w` and `h` are not specified:
48+
* - The `scale` parameter is used to determine the output size.
7449
*
7550
* - The plot maintains its aspect ratio, preserving layout, tick labels, and other visual elements.
7651
* - Useful for generating high-resolution images suitable for publication.
7752
*
7853
* **For SVG:**
79-
* - If [w], [h], and [unit] are specified:
80-
* - The plot's pixel size (default or set via [ggsize()](https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot/ggsize.html)) is ignored.
54+
*
55+
* - If `w`, `h`, and `unit` are specified:
56+
* - The plot's pixel size (default or set via [ggsize()][org.jetbrains.letsPlot.ggsize]) is ignored.
8157
* - The output size is set from the given values.
8258
*
8359
* **For HTML:**
84-
* - If [w] and [h] are specified:
85-
* - The plot's pixel size (default or set via [ggsize()](https://lets-plot.org/kotlin/api-reference/-lets--plot--kotlin/org.jetbrains.letsPlot/ggsize.html)) is ignored.
86-
* - The output size is determined directly from the specified [w] and [h], which are treated as pixel values.
60+
*
61+
* - If `w` and `h` are specified:
62+
* - The plot's pixel size (default or set via [ggsize()][org.jetbrains.letsPlot.ggsize]) is ignored.
63+
* - The output size is determined directly from the specified `w` and `h`, which are treated as pixel values.
64+
*
65+
* ## Examples
66+
*
67+
* - [export_to_file.ipynb](https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/kotlin_examples/cookbook/export_to_file.ipynb)
68+
*
69+
* @param plot Plot to export.
70+
* @param filename Name of the file. Must include an extension matching
71+
* one of the supported formats: `.svg`, `.html`/`.htm`, `.png`, `.jpeg`/`.jpg`, or `.tiff`/`.tif`
72+
* @param scale Scaling factor (only for raster formats). Default: 2.0
73+
* @param w Width of the output image in units.
74+
* @param h Height of the output image in units.
75+
* @param unit Unit of the output image. One of: `"in"`, `"cm"`, `"mm"`, `"px"`.
76+
* Only applicable when exporting to SVG, PNG, JPG, or TIFF. For HTML, the unit is always `"px"` (pixels).
77+
* Default:
78+
* "px" (pixels) for SVG,
79+
* "in" (inches) for the raster formats (PNG, JPG, and TIFF).
80+
* @param dpi Resolution in dots per inch.
81+
* Only applicable when exporting to the raster formats: PNG, JPG, or TIFF.
82+
* The default value depends on the `unit`:
83+
*
84+
* - for `"px"` it is `96` (output image will have the same pixel size as `w` and `h` values)
85+
* - for physical units (`"in"`, `"cm"`, `"mm"`) it is `300`.
86+
* @param path Path to a directory to save image files in.
87+
* Default: `${user.dir}/lets-plot-images`
88+
*
89+
* @return Absolute pathname of the created file.
8790
*
8891
*/
8992
@Suppress("SpellCheckingInspection")

0 commit comments

Comments
 (0)