Docs
📊 ⏐ Charts
Venn Diagram

Venn Diagram

A Venn Diagram in REAVIZ is a diagram that shows all possible logical relations between a finite collection of sets. It helps visualize the overlaps and differences between multiple sets, making it ideal for set analysis.

Types supported by reaviz:

  • Venn - Standard Venn diagram showing set relationships.
  • Euler - A variation where only significant overlaps are shown.
  • Star Euler - Another variation that emphasizes the star-like layout.

Where to use:

  • Visualize Set Relationships: Ideal for displaying logical relations between different sets.
  • Highlight Overlaps: Useful for highlighting overlaps and differences between sets.
  • Analyze Intersections: Great for analyzing intersections and unique elements in sets.

Quick Start

To create a venn diagram, import the VennDiagram and give it data. The chart will automatically configure itself with the default options exposed via props.

ℹ️

One important aspect to realize here is the key propertyis a array of intersections. It can have one to N number of relationships.

Examples

Venn

Euler

Star Euler

API

VennDiagram (opens in a new tab)

PropDescriptionDefault
typeType of the chart.
"venn" | "euler" | "starEuler"
venn
data *Data the chart will receive to render.
VennDiagramData[]
seriesThe series component that renders the arc and label components.
ReactElement<VennSeriesProps, FC<Partial<VennSeriesProps>>>
<VennSeries />
disabledWhether the chart is disabled.
boolean
idId of the chart.
string
widthWidth of the chart. If not provided will autosize.
number
heightHeight of the chart. If not provided will autosize.
number
marginsMargins for the chart.
Margins
classNameClassnames for the chart.
string
containerClassNameClassnames for the chart.
string
styleAdditional css styles.
StyleHTMLAttributes<SVGSVGElement>
centerCenter the chart. Used mainly internally.
boolean
centerXCenter chart on X Axis only. Used mainly internally.
boolean
centerYCenter chart on Y Axis only. Used mainly internally.
boolean

VennSeries (opens in a new tab)

PropDescriptionDefault
idId set by the parent.
string
selectionsActive managed selections.
string[]
dataThe internal data object built by venn.js
IVennLayout<any>[]
colorSchemeColor scheme for the chart.
ColorSchemeType
cybertron
disabledWhether the chart is disabled.
boolean
false
animatedWhether the chart is animated or not.
boolean
true
labelLabel element.
ReactElement<VennLabelProps, FC<Partial<VennLabelProps>>>
<VennLabel />
outerLabelLabel element.
ReactElement<VennOuterLabelProps, FC<Partial<VennOuterLabelProps>>>
<VennOuterLabel />
arcArc element.
ReactElement<VennArcProps, FC<Partial<VennArcProps>>>
<VennArc />

VennArc (opens in a new tab)

PropDescriptionDefault
activeWhether the shape is active or not.
boolean
false
idId set by the parent.
string
animatedWhether the chart is animated or not.
boolean
fillFill color for the arc.
string
strokeStroke for the arc.
string | ((data: IVennLayout<any>[], index: number, isActive: boolean, isHovered: boolean) => string)
dataThe internal data object built by venn.js
IVennLayout<any>
disabledWhether the chart is disabled.
boolean
strokeWidthStroke on the arc.
number
3
initialStyleInitial style of arc.
any
{ opacity: 0.6 }
activeStyleActive style of arc.
any
{ opacity: 0.8 }
inactiveStyleInactive style of arc.
any
{ opacity: 0.3 }
styleCSS Styles for the arc.
any
tooltipTooltip element.
ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>>
<ChartTooltip />
maskMask element for the arc.
ReactElement<MaskProps, FC<MaskProps>>
gradientGradient shades for the arc.
ReactElement<GradientProps, FC<Partial<GradientProps>>>
<Gradient />
glowGlow styling for the arc.
Glow
onClickEvent for when the arc is clicked.
(event: any) => void
() => undefined
onMouseEnterEvent for when the arc has mouse enter.
(event: any) => void
() => undefined
onMouseLeaveEvent for when the arc has mouse leave.
(event: any) => void
() => undefined

VennLabel (opens in a new tab)

PropDescriptionDefault
activeWhether the shape is active or not.
boolean
idSet by the parent element.
string
showAllShow all labels or just the large ones. Default false.
boolean
false
labelTypeThe label type to show.
"key" | "value"
key
wrapShould wrap text or not.
boolean
true
dataThe internal data object built by venn.js
any
fontSizeFont size of the text.
number
11
fontFamilyFont family of the text.
string
sans-serif
fillFill of the text.
string
animatedWhether the chart is animated or not.
boolean
true
formatFormat label.
(data: any) => any

VennOuterLabel (opens in a new tab)

PropDescriptionDefault
dataThe internal data object built by venn.js
any
fontSizeFont size of the text.
number
14
fontFamilyFont family of the text.
string
sans-serif
fillFill of the text.
string
#000
animatedWhether the chart is animated or not.
boolean
true
formatFormat label.
(data: any) => any