Repository navigation
Releases: sipemu/ggplot-rs
Releases · sipemu/ggplot-rs
Release list
v0.36.0
Added
- Repelled labels keep clear of straight lines:
RepelParams::avoid_ablinesand theavoid_abline(slope, intercept)builder onGeomTextRepel/GeomLabelRepel(DataZooDE/anofox-visualization#753).
Changed (breaking)
RepelParamshas a new public field (avoid_ablines).
v0.35.3
v0.35.2
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
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
ThemeConfigoverlay; and the legend position, includinginside.- The shipped
.d.tshas a typedPlotSpec. - Errors are
Errorobjects 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 (
GridElementwith
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
Added
GridElement— non-plotPlotGridcells (patchwork's
wrap_elements, #378):GridElement::fixed(svg, w, h)scales a fragment
drawn in its ownw × hbox 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 byaxis_collect/collect_legends; the
|//operators accept it. Markup is inserted verbatim.
Fixed
- Inside legends (
LegendPosition::Inside,legend_inside_auto) are inset
bylegend_marginfrom 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:
GridCellhas a newElementvariant (exhaustive matches
need an arm). - Inside legends with a non-zero
legend_marginsit that margin further
in from the panel edge.
v0.34.0
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 aSecAxis::percent_of_maxaxis, #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-directedgeom_network(#310),
geom_floworigin–destination flow maps (featuresf, #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-
proportionalgeom_venn(#312),geom_wordcloud(#313),
geom_variable_pie(#319). - Time: streamgraphs via
StackOffset(silhouette, wiggle) +
geom_stream(#304); splineInterpolate(monotone cubic, Catmull-Rom)
on line / area / ribbon (#305);geom_timeline(#315);geom_xrange
Gantt charts (#316);geom_flagsevent 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_tilemaptile-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-Mercatorgeom_sflayers, with the
source's attribution. No networking in the crate: tiles come from a
caller-suppliedTileFetcher(anyFn(z, x, y) -> Option<Vec<u8>>) and
are cached per layer. NewDrawBackend::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-atattribute.GGPlot::facet_levels(&[..])(#329): explicitfacet_wrappanel
order; levels without data keep an empty panel (ggplot2'sdrop = 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 +PlotGridalarm strip, #124)
andmap_tiles; README gallery and chart-family overview (#326).
Fixed
ScaleDateTime::with_date_labelsis honoured on automatic month and year
breaks (#352).position_jitter/geom_jitter/position_jitterdodgenow jitter on a
discrete x axis (points used to stay on the category's centre line).- A
Bottomlegend 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
Bottomlegend
(#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 andprimary_color(#362).
Changed
- Breaking for struct literals without
..Default::default(): new
fieldsinterpolateonGeomLine/GeomArea/GeomRibbon,style/
open_tickon the candlestick geoms,offsetonPositionStack,
percent_of_maxonSecAxis, andlevelsonFacet::Wrap.