Repository navigation
v0.28.1
Pattern fills (#206): a stripe Pattern as na_pattern on ScaleFillBinned,
drawn in the legend's NA key and by geom_sf / polygon / rect / tile (SVG
<defs><pattern> with per-plot ids; raster stripes; plotters falls back to the
background colour), for hatched no-data regions on choropleths
(DataZooDE/anofox-visualization#420). No API breaks (cargo-semver-checks
against v0.28.0).
Added
- Pattern fills (#206):
render::backend::FillPattern(Stripe { fg, bg, size_px, angle_deg }, a thin 30%-duty-cycle hatch by default —
FillPattern::stripe(fg, bg)),ScaleFillBinned::na_pattern(..)(sits
alongside the existingna_color, drawn instead of it), and three new
DrawBackendmethods —draw_rect_pattern/draw_polygon_pattern/
draw_polygon_rings_pattern— drawn bygeom_sf/geom_polygon/
geom_rect/geom_tilefor aValue::Narow and by the legend's own
"no data" key, instead ofna_color's flat colour. The native SVG
backend registers a per-backend-instance-prefixed<defs><pattern>
(deduped by equality) and fills with itsurl(#…); the pixel/canvas
backend rasterises the actual stripes per pixel;plottershas no
pattern primitive and keeps the trait methods' default — a flat
FillPattern::bgfill, so a no-data region still reads as muted, just
without the hatch. Holes still cut out under the even-odd rule exactly
as a flat fill would. DataZooDE/anofox-visualization#420 — a classed
choropleth's no-data cells can retire their hand-written SVG<pattern>
hatch (map/mod.rs) onto this instead of losing it to a flat na colour
(a visible regression the::MAP→geom_sfport would otherwise be
stuck with).