Skip to content

[#19]:svarga:feature, add plot::donut driver with adjustable plot::hole#20

Merged
steven-varga merged 1 commit into
stagingfrom
19-donut-driver
Jun 18, 2026
Merged

[#19]:svarga:feature, add plot::donut driver with adjustable plot::hole#20
steven-varga merged 1 commit into
stagingfrom
19-donut-driver

Conversation

@steven-varga

Copy link
Copy Markdown
Contributor

Summary

  • plot::donut(labels, values, opts...) is now its own driver — a pie with a default 0.55 inner-radius hole.
  • Both plot::pie and plot::donut accept plot::hole{r} (r in (0,1)) to set/override the hole fraction.
  • Renamed the option tag donut_thole_t and the option struct plot::donut{} (value) → plot::hole{}.
  • pie_view gains a default_inner member; impl::hole_of(fallback, ...) returns the fallback when no plot::hole{} is given.

Tests

  • ctest 5/5 pass; Valgrind clean (0 errors) on plot_new + plot_fill.
  • Added donut-driver + plot::hole{} override coverage in plot_new.cpp; donut driver in plot_fill.cpp still asserts a filled ring.
  • Verified rendered donut wedges are rings (≈2× the polygon points of pie wedges).

Updated example (examples/pie.cpp) and docs (doxy/docs/index.md).

plot::donut(labels, values, opts...) is now its own driver — a pie with a
default 0.55 inner-radius hole. Both pie and donut accept plot::hole{r} to
set/override the hole fraction (tag renamed donut_t -> hole_t). pie_view gains
a default_inner member; impl::hole_of(fallback, ...) returns the fallback when
no plot::hole{} is given. Updated example, tests (donut driver + hole override),
and docs.
@steven-varga steven-varga merged commit 596c57a into staging Jun 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant