Skip to main content

Release: Lilaq 0.6.0

ยท 5 min read
Mc-Zen
Lilaq author/maintainer

Exciting news! Lilaq 0.6.0 introduces ultra-flexible support for plot grids, also known as subplots.

On the front of plotting functions, we added the new twins violin and hviolin and a new tick formatter for displaying fractions. Moreover, we significantly improved date/time support and introduced functionality for fixing the aspect ratio between xx and yy data coordinates.

Changelogโ€‹

Breaking changesโ€‹

  • Diagram bounds now strictly respect tick label bounds. This new default may change diagram layouts. You can restore the previous behavior with:

    #show: lq.set-diagram(bounds: "relaxed")
  • axis.mirror now reacts differently when set to auto. Before, axis mirrors where removed automatically when axis.position was changed. Now, they are removed automatically when either a secondary axis is added or axis.position is set to a data or screen coordinate. This change reduces boilerplate code when configuring secondary axes.

  • The default for bar.width and hbar.width changed from 0.8 to 80%. This prevents "invisible" bars on datetime axes or widely spaced positions. Similarly, boxplot.width and hboxplot.width now default to 50%. Unit-distance data (which is the most common case) is unaffected by this change.

  • Limits of boxplot and hboxplot instances are now computed correctly according to the actual width (thickness) of the box while before, boxplot (hboxplot) limits were not tight in x(y)-direction but extended to twice the width (height) in total. In order to increase the spacing again, you can set diagram.margin to something like (x: 20%).

  • vec.transform now takes individual arguments instead of a tuple. See the Utility section for details.

Diagramโ€‹

  • Added native diagram grids via show rules with lq.layout.
  • Added diagram.aspect-ratio to set up a fixed aspect ratio between data x-and y-coordinates (by adjusting dimensions or margins).
  • Added diagram.bounds with modes: "strict", "relaxed", and "data-area".
  • Added support for em-lengths in diagram.width and diagram.height.
  • Improved the smartness of axis.mirror.
  • When axis limits are set to datetime values, the scale now switches to a datetime scale if axis.scale is set to auto.
  • Fixed inverted colorbars in PDF export.
  • Fixed spacing when labels are larger than the diagram.
  • When exporting to HTML, diagrams are wrapped in html.frame.

Plotsโ€‹

  • Added violin and hviolin plot types.
  • Colormesh:
    • Now accepts pre-rendered images as input. When min, max, and map are provided, the colormesh behaves as if it rendered the mesh itself (including colorbars).
    • Added colormesh.align to control mesh rectangle alignment with x/y coordinates.
    • Now accepts edge arrays for x and y (length n+1) to specify mesh edges instead of point centers.
  • Bar plots:
    • Now, bar.width and hbar.width accept ratio (relative to consecutive bar positions) and duration (for datetime coordinates) values.
    • โš ๏ธ Default bar.width/hbar.width changed from 0.8 to 80% to improve visibility on datetime or sparse axes.
    • Changed hbar.align default from center to horizon (both values are supported).
    • Fixed integer handling for bar.width and hbar.width.
  • Boxplots
    • Now, boxplot.width and hboxplot.width accept ratio (relative to consecutive boxplot positions) and duration (for datetime coordinates) values.
    • โš ๏ธ Default boxplot.width/hboxplot.width changed from 0.5 to 50% to improve visibility on datetime or sparse axes.
  • Added fill-between.smooth, equivalent to plot.smooth.
  • Added support for datetime coordinates with place, rect, ellipse, and line.
  • Added plot.tip and plot.toe to place Tiptoe arrow marks at the start and end of line plots.
  • Fixed behavior for empty coordinate arrays with most plotting functions.
  • Fixed colormesh scaling when scale.reflow is set to true via set rules.
  • Fixed polygon rotation when rotate.reflow is set to true via set rules.
  • Fixed rect and ellipse content and gradient fills when the dimensions are negative.

Ticksโ€‹

  • Added tick-format.fraction for automatic fraction formatting.
  • Added tick-format.linear.pad to disable zero-padding when formatting linear ticks.
  • Fixed formatting of linear ticks with suffix. In particular, the "0" and minus sign of negative ticks were previously not passed to zero.num. This can be important for consistency when text and math fonts don't match.
  • Fixed rounding issues for axis.tick-distance when using the linear locator.
  • Fixed an issue where the wrong subtick locator was selected when the log locator resolves to linear ticks.
  • Fixed automatic offsets and raised the threshold for automatic offsets to kick in.

Utilityโ€‹

  • Added logspace for creating logspaced value arrays.
  • Added vec.jitter to apply randomized offsets to numeric arrays.
  • Added the minmax.margin option.
  • โš ๏ธ vec.transform now takes individual arguments rather than a tuple. Use: lq.vec.transform(a, b, (a, b) => ...) instead of the previous: lq.vec.transform(a, b, ((a, b)) => ...).

Dependenciesโ€‹

  • Zero: 0.5.0 โ†’ 0.6.1
  • Komet: 0.1.0 โ†’ 0.2.0
  • Tiptoe: 0.3.1 โ†’ 0.4.0

Documentationโ€‹

  • Fixed typos and improved clarity across the entire documentation.
  • Typst built-in type annotations now link to the corresponding pages on the Typst website.