Skip to content

v0.28.2

Choose a tag to compare

@sipemu sipemu released this 24 Oct 13:29
57b5d7a

Fixes and one option from DataZooDE/anofox-visualization's #318 ports:
ScaleDateTime::domain(), so PlotGrid can align date axes (#207);
PlotGrid keeps each cell's own svg_attrs (#208); axis label fit leaves a
legible gap between kept tick labels (#212); a multi-geometry geom_sf row is
one mark (#213); compact relative SVG path encoding for geom_sf (#214). No API
breaks (cargo-semver-checks against v0.28.1).

Added

  • geom_sf's native SVG output is more compact for large boundaries
    (#214): the new DrawBackend::draw_polygon_rings_precise (default
    impl just forwards to the existing draw_polygon_rings[_pattern], so
    no other backend or geom changes) lets a caller ask for relative-command,
    configurable-decimal-precision path data instead of absolute M/L
    2-decimal commands. GeomSf opts in automatically, tied to its own
    simplify_px (1 decimal whenever simplification is on, the default);
    .simplify(0.0) keeps the exact absolute encoding. Every other
    draw_polygon_rings[_pattern] caller (geom_rect/geom_tile/
    geom_polygon) is untouched, so their output doesn't move. Found
    porting DataZooDE/anofox-visualization#420.

Fixed

  • check.overlap could leave adjacent continuous x tick labels touching
    (#212, upstream issue DataZooDE/anofox-visualization#450). The thinning
    pass only required two kept labels' estimated bounding boxes not to
    literally intersect — on a narrow panel (a dashboard card's plot area
    squeezed by a right-hand legend) that could leave as little as ~1 px
    between them, which on real font metrics reads as one garbled run (25
    next to 50 as 2550). draw_x_axis now also requires one space
    character's width of clearance between every pair of kept labels, not
    just "don't touch" — a 0/25/50/75/100 set over a ~50 px panel now keeps
    0/50/100 instead of 0/25/50/100 with a sub-pixel gap.
  • PlotGrid::axis_collect(AxisCollect::CollectX) (#175) skipped every
    column with a date x axis
    , warning plot_grid: a column's x scale is discrete or untrained; x domain not collected and leaving every cell —
    chart included — unaligned (#207, upstream issue
    DataZooDE/anofox-visualization#422: every ::TRACK fixture there uses a
    date x axis). collect_x_domain reads a cell's x scale via
    Scale::domain(), which defaults to None and is overridden by
    ScaleContinuous but wasn't by ScaleDateTime (it only implemented
    train() and expanded_domain()) — so a date scale always looked
    "untrained" to it, regardless of how much data it had actually trained
    on. ScaleDateTime::domain() now returns its trained (min, max), same
    as ScaleContinuous's. Audited every other position (X/Y) scale
    (ScaleContinuous, ScaleDateTime, ScaleDiscrete) for the same gap —
    ScaleDiscrete correctly has no domain() and is excluded by
    CollectX's own is_discrete() check instead, so it needed no change.
  • PlotGrid silently dropped each cell's own GGPlot::svg_attr/
    svg_attrs
    once composed (#208, upstream issue
    DataZooDE/anofox-visualization#422: every ::TRACK cell's data-track
    attribute never reached the composed SVG). prepare_plot never carried
    GGPlot::root_attrs past build_for_render (which consumes and drops
    it), and render_prepared's per-cell render only ever wrote
    root_data_attrs + data-panel to the cell's own root <svg>. A
    cell's own svg_attrs are now captured alongside svg_formatted_values
    (the same build_for_render-discards-it problem that field already
    had) and applied — allow-listed and collision-checked exactly as a
    lone plot's or the grid's own, via the same validate_root_attrs — on
    a <g> wrapping that cell's content, so they don't collide with
    ggplot-rs's own per-cell root attributes or the grid's own svg_attrs
    on the grid's root. A cell with no svg_attr call gets no <g>
    wrapper at all — unaffected output.
  • geom_sf (#213): a MultiPolygon row now draws as one mark — one
    <path> with one M…Z subpath per ring and part under the even-odd
    fill rule, one set of row attributes/data-*, one tooltip — instead of
    one separate mark per part (a country with islands no longer produces
    N marks sharing the same data-row). Single-Polygon output is
    unchanged. Found porting DataZooDE/anofox-visualization#420.