1---2name: set-diagram3description: Use when the user needs to show membership, overlap, exclusion, union, intersection, or nested categories with sets.4---56# Set diagram78## What / why910A set diagram tells the story “which elements belong to which sets, and where do memberships overlap?” Use Venn diagrams for a small number of sets and Euler diagrams when only meaningful intersections should be shown. Choose a graph for typed relationships or a matrix for exhaustive pairwise comparison.1112## How to model1314- Define each set and the universe or scope; state whether circles are exhaustive.15- Put elements in regions only when membership is known; distinguish empty from unknown.16- Label intersections with the set operation or plain-language meaning.17- Keep set count small enough for legible regions; use an Euler representation for sparse overlaps.18- Do not use area or circle size to imply quantity unless it is quantitatively encoded and explained.1920## Styling and customization2122Use overlapping outlines with high-contrast labels, transparent fills, and patterns or labels in addition to color. Avoid excessive intersections. Provide an accessible list/table of memberships when important, and keep the universe boundary visible when it matters.2324## Renderer choices2526Preserve user choice. Mermaid, Graphviz, D2, PlantUML, and diagrams.net can approximate set diagrams with shapes and labels; diagrams.net or custom SVG is better for controlled overlap. diagram.zip has no dedicated Venn/Euler semantic renderer or overlap solver, so verify memberships manually and do not claim proportional geometry.2728## Review2930Check every region against membership data, confirm empty/unknown regions, make labels readable, and test grayscale/colorblind viewing. Ensure the chosen Venn layout can represent stated intersections; otherwise switch to Euler or a table.3132## Prior art and gaps3334See [references/prior-art.md](references/prior-art.md). A native set renderer would need membership input, Venn/Euler layout validation, and an accessible tabular fallback; this is an integration opportunity rather than current diagram.zip support.