Skip to content

v0.35.1

Choose a tag to compare

@sipemu sipemu released this 29 Oct 23:57
9ad828b

Added

  • npm package @sipemu/ggplot-rs (#382): the wasm build is published
    to npm from the same GitHub release as the crate, at the same version
    (.github/workflows/npm.yml, with provenance; js/check-version.mjs
    checks that the versions match in CI and on release).
    • render(spec) / renderWithWarnings(spec) take a layered spec
      ({ data, aes, layers: [{ geom, aes, data, params, stat, position }], scales, facet, coord, labels, theme, legend, width, height }) as a JS
      object or as JSON text. It covers 53 geoms, including waterfall, sankey,
      chord, treemap, sunburst and candlestick; facet wrap/grid with free
      scales; coord flip/polar/fixed/radar/zoom; theme presets or a
      ThemeConfig overlay; and the legend position, including inside.
    • The shipped .d.ts has a typed PlotSpec.
    • Errors are Error objects naming the bad field. An unknown column
      lists the available ones; unknown geoms, aesthetics and spec fields are
      rejected.
    • The package is SVG-only, about 0.59 MB of gzipped .wasm. CI runs
      vitest against the built package, a typecheck of the shipped .d.ts,
      and wasm-bindgen tests.

Fixed

  • A tagged grid element keeps clear of its tag (GridElement with
    tag_levels). The tag sits in a band twice the title size at the cell's
    top (or bottom, with a bottom tag position) and the element is drawn in the
    rest of the cell, as a plot cell's margin already leaves room for its own.
    Previously a table or note drawn from the cell's top left sat under the
    tag.
  • Title and subtitle no longer overlap (#384). Previously the subtitle
    was centred 2px above the panel, so its lower half sat inside the panel,
    and it overlapped the title at the default sizes. Both now stack inside
    the bands the layout reserves. This applies to the single-panel and
    faceted paths, and the subtitle is now also lifted above a top x-axis.
    A title with no subtitle stays where it was.