aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-27 08:49:38 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-27 08:49:38 +0200
commit83a2eaef9853194093a457b0ab65fc231acce23f (patch)
tree965f04075964d8a98a25e7ab5255938a278df1eb /README.md
parent682d1996c04ddd3b0f305edc3fba1ae9e75403a4 (diff)
downloadprognosis-main.tar.gz
prognosis-main.zip
Draw a meteogram, and let the output go somewhereHEADv0.1.4main
-svg renders the forecast as a standalone SVG: temperature with the apparent temperature dashed, precipitation as bars with the probability on its own right-hand axis, and humidity, over shaded night bands with a rule at each midnight. The rain panel carries two units, so the probability gets a second axis; read against millimetres a 60% chance looks like 0.6 mm. Written as markup rather than through gnuplot or a plotting library, so it needs nothing installed and works wherever the binary does -- the phone included. Axis ticks are snapped to round values and the number of gridlines follows the step, since snapping only the ends still yields 12.5 and 27.5. An hour label that would land under a bold date is dropped, or "23" and "28.08" render on top of each other. -o and -out choose the destination, for the table as much as the meteogram. A directory gets a filename made from the place and the date, so a daily run does not overwrite yesterday; a bare name gains the extension, so nothing lands as a file no viewer will open. Colour is omitted when writing to a file. The place is transliterated rather than stripped, so Zbylitowska Gora keeps its vowels. Documented which viewers accept a pipe: feh - and chafa do, nsxiv does not and answers with its usage, which hides the cause. The earlier claim that ImageMagick renders these files wrong was too broad -- that is convert falling back to its own renderer; display delegates to rsvg-convert and is fine.
Diffstat (limited to 'README.md')
-rw-r--r--README.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/README.md b/README.md
index 1d79322..69ebbff 100644
--- a/README.md
+++ b/README.md
@@ -143,6 +143,8 @@ Every flag, and every setting in the config file, is documented in
| `-no-graph` | table only |
| `-ascii` | ASCII only, so an SMS stays in GSM-7 |
| `-no-color` | plain output |
+| `-svg` | produce an SVG meteogram instead of the table |
+| `-o PATH`, `-out PATH` | write to PATH; a directory gets a generated filename |
| `-config` | print the config file path and exit |
| `-version` | print the version and exit |
@@ -172,6 +174,37 @@ Output is pipe-safe: colour switches off when stdout is not a terminal, so
`prognosis > file` is clean UTF-8. Notes and failures go to stderr, so use
`2>&1` for an unattended job.
+## Meteogram
+
+`-svg` writes a standalone chart: temperature with feels-like dashed,
+precipitation bars with the probability on its own right-hand axis, and
+humidity — three panels over one time axis, with shaded night bands.
+
+ prognosis -l Krakow -d 2 -svg > meteogram.svg
+ prognosis -l Krakow -d 2 -svg -o ~/photos/weather
+ prognosis -l Krakow -d 2 -svg -o meteogram.svg
+
+`-o` takes a file or a directory. Given a directory it generates the name from
+the place and the date — `krakow-pl-2026-08-27.svg` — so a daily run does not
+overwrite yesterday. It works for the text table too, which then gets `.txt`
+and no colour.
+
+No plotting library and no gnuplot: SVG is markup, so this works anywhere the
+binary does. The meteogram requests the fields it needs regardless of
+`columns=`.
+
+Not every viewer reads a pipe. `feh -` and `chafa` do; `nsxiv` has no stdin
+mode and answers with its usage, which hides the cause:
+
+ prognosis -l Krakow -svg | feh -
+ prognosis -l Krakow -svg | chafa
+ prognosis -l Krakow -svg -o ~/tmp && nsxiv ~/tmp/krakow-pl-*.svg
+
+Given the file, most viewers handle it: `plumber`, `nsxiv`, `feh`, `display`,
+a browser, or `chafa` in the terminal. One caveat: `convert` may fall back to
+ImageMagick's own SVG renderer, which drops the polylines — `rsvg-convert`
+does not, and `display` is fine because ImageMagick delegates to it.
+
## Data sources
| Source | Used for |