vennDiagramLab separates analysis from rendering. Once
you have a RegionResult, you can render it with custom
names, custom colors, post-process the SVG, embed it in a ggplot2 chain
via geom_venn(), or export to PNG / PDF.
Pass a per-letter mapping (A-I) to override
the dataset’s set names:
Pass a per-letter hex map. Each letter’s color is applied to the matching shape AND the legend bullet (and, where present, the Euler extra shape).
(show_names = FALSE does the analogous thing for set
names.)
The returned SVG is a plain string; parse it with xml2
to make targeted edits (e.g. set the page background or add a
watermark):
geom_venn() returns a list of layers that draws the venn
on a unit-square coordinate system, ready to compose with titles,
themes, and other annotations.
render_venn_svg() returns a string. Convert it to PNG or
PDF via the rsvg package (already a hard import of
vennDiagramLab):
svg <- render_venn_svg(result)
png_path <- tempfile(fileext = ".png")
rsvg::rsvg_png(charToRaw(svg), png_path, width = 1200)
file.size(png_path)
pdf_path <- tempfile(fileext = ".pdf")
rsvg::rsvg_pdf(charToRaw(svg), pdf_path)
file.size(pdf_path)For a multi-page composite report (venn + upset + statistics +
network + about), use to_pdf_report() — see
vignette("v07_pdf_reports").
vignette("v01_quickstart") — basic usage.vignette("v04_upset_vs_venn_vs_network") — alternative
visualizations.vignette("v07_pdf_reports") — composite multi-page PDF
reports.