Skip to content

Releases: sipemu/ggplot-rs

v0.36.0

Choose a tag to compare

@sipemu sipemu released this 30 Oct 21:46
b40d36e

Added

  • Repelled labels keep clear of straight lines: RepelParams::avoid_ablines and the avoid_abline(slope, intercept) builder on GeomTextRepel / GeomLabelRepel (DataZooDE/anofox-visualization#753).

Changed (breaking)

  • RepelParams has a new public field (avoid_ablines).

v0.35.3

Choose a tag to compare

@sipemu sipemu released this 30 Oct 13:00
3b1e8ea

Added

  • format::format_timestamp(secs, fmt, locale): the datetime scales' strftime subset, with a locale's month and weekday names, for hosts that format a date the way an axis does (anofox-visualization#751).

v0.35.2

Choose a tag to compare

@sipemu sipemu released this 30 Oct 00:45
67a1feb

Fixed

  • An inside legend no longer runs off a right-hand panel edge
    (LegendPosition::Inside, legend_inside_auto). Its width was estimated
    as six characters per label and ignored the title, so at a right corner a
    longer label or title was drawn past the panel (and cut off by the
    canvas). The estimate now measures the widest label and the title as
    drawn.

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.

v0.35.0

Choose a tag to compare

@sipemu sipemu released this 29 Oct 21:03
1971af1

Added

  • GridElement — non-plot PlotGrid cells (patchwork's
    wrap_elements, #378): GridElement::fixed(svg, w, h) scales a fragment
    drawn in its own w × h box into the cell keeping its aspect;
    GridElement::fill(|w, h| svg) renders at the cell's real size. The cell
    is a nested <svg … data-cell="i">, takes part in widths/heights and
    tag_levels, and is skipped by axis_collect / collect_legends; the
    | / / operators accept it. Markup is inserted verbatim.

Fixed

  • Inside legends (LegendPosition::Inside, legend_inside_auto) are inset
    by legend_margin from the panel edges, and the title — drawn centred on
    the legend origin — no longer sticks out above the box (it was clipped in
    a top corner); a colourbar's bottom label overhang is counted too (#377).

Changed

  • Breaking: GridCell has a new Element variant (exhaustive matches
    need an arm).
  • Inside legends with a non-zero legend_margin sit that margin further
    in from the panel edge.

v0.34.0

Choose a tag to compare

@sipemu sipemu released this 28 Oct 21:31
f722c36

Added

Highcharts chart-type parity (#296–#326), each with a geom_* shortcut and a
configurable geom_*_with:

  • Business / KPI: geom_waterfall (#296), geom_pareto (sorted bars +
    cumulative-% line on a SecAxis::percent_of_max axis, #297),
    geom_funnel / geom_pyramid (#303), geom_bullet (#307),
    geom_lollipop / geom_dumbbell (#306), geom_variwide /
    geom_marimekko (#314).
  • Flows & networks: geom_sankey (#298), geom_chord (#299),
    geom_arcdiagram (#300), force-directed geom_network (#310),
    geom_flow origin–destination flow maps (feature sf, #324).
  • Hierarchies: squarified geom_treemap (#301), geom_sunburst /
    geom_icicle (#302), geom_packed_bubble (#309), geom_tree / org
    charts / geom_dendrogram (#311).
  • Sets & units: geom_waffle / geom_parliament (#308), area-
    proportional geom_venn (#312), geom_wordcloud (#313),
    geom_variable_pie (#319).
  • Time: streamgraphs via StackOffset (silhouette, wiggle) +
    geom_stream (#304); spline Interpolate (monotone cubic, Catmull-Rom)
    on line / area / ribbon (#305); geom_timeline (#315); geom_xrange
    Gantt charts (#316); geom_flags event flags (#323).
  • Finance: hollow candles, geom_hlc, geom_heikin_ashi (#320);
    geom_renko / geom_point_figure (#321); StatIndicator — SMA, EMA,
    WMA, Bollinger, MACD, RSI, ATR, VWAP, stochastic, ZigZag (#322).
  • Maps & weather: geom_tilemap tile-grid cartograms (+
    us_state_grid, #317), geom_windbarb (#318).
  • Tiled basemaps (new feature tiles, #325):
    annotation_map_tile(TileSource::xyz(..), fetcher) draws XYZ raster tiles
    (OpenStreetMap and friends) under Web-Mercator geom_sf layers, with the
    source's attribution. No networking in the crate: tiles come from a
    caller-supplied TileFetcher (any Fn(z, x, y) -> Option<Vec<u8>>) and
    are cached per layer. New DrawBackend::draw_image (default: no-op),
    implemented by the native SVG, canvas and plotters backends.
  • GGPlot::legend_inside_auto() / legend_inside_auto_with(corners, fallback) (#332): the legend goes inside the panel in the first corner
    where its real box overlaps no drawn mark, else outside on the side
    (Top/Right) that leaves the data area larger. The choice is the root
    data-legend-at attribute.
  • GGPlot::facet_levels(&[..]) (#329): explicit facet_wrap panel
    order; levels without data keep an empty panel (ggplot2's drop = FALSE).
  • PlotGrid::legend_bottom_when_narrow(share) (#363): a grid's
    collected legend column moves below the grid on narrow renders.
  • Examples: inventory_twin (quantile fan + PlotGrid alarm strip, #124)
    and map_tiles; README gallery and chart-family overview (#326).

Fixed

  • ScaleDateTime::with_date_labels is honoured on automatic month and year
    breaks (#352).
  • position_jitter / geom_jitter / position_jitterdodge now jitter on a
    discrete x axis (points used to stay on the category's centre line).
  • A Bottom legend under an axis-less theme (theme_void) stays on the
    canvas instead of being placed at its edge with zero height (#341).
  • The caption is drawn inside its reserved area, below a Bottom legend
    (#286).
  • The y axis title keeps a gap to short tick labels; a faceted grid draws
    one x and one y axis title instead of one per panel (#348).
  • Chart-type shortcuts (geom_waterfall, geom_funnel, geom_waffle, …)
    honour theme ink/paper and primary_color (#362).

Changed

  • Breaking for struct literals without ..Default::default(): new
    fields interpolate on GeomLine / GeomArea / GeomRibbon, style /
    open_tick on the candlestick geoms, offset on PositionStack,
    percent_of_max on SecAxis, and levels on Facet::Wrap.

v0.33.0

Choose a tag to compare

@sipemu sipemu released this 28 Oct 09:11
9adf016

Small-multiple maps (#293): fixed-aspect facet_wrap under coord_sf, per-panel clip, data-viewport/data-panels root attributes, GeomAttribution::figure, ScaleFillBinned::show_counts, GeomNorthArrow.

v0.32.0

Choose a tag to compare

@sipemu sipemu released this 28 Oct 07:00
592bbc6

GeomPoint::visibility / hidden_targets (#290): hide markers on dense series while keeping them as hover/click targets. Breaking: new pub fields on GeomPoint.

v0.31.8

Choose a tag to compare

@sipemu sipemu released this 28 Oct 00:50
d36037a

Opt-in GGPlot::legend_bottom_when_narrow(share): a Right legend moves below a narrow panel (#287). See CHANGELOG.md.

v0.31.7

Choose a tag to compare

@sipemu sipemu released this 26 Oct 18:20
00b7f84

A subtitle without a title no longer overlaps a Top legend (#281). See CHANGELOG.md.