Skip to Content

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Β 

NameTypeDefault
type"venn" | "euler" | "starEuler"

Type of the chart.

'venn'
dataVennDiagramData[]

Data the chart will receive to render.

seriesReactElement<VennSeriesProps, FC<Partial<VennSeriesProps>>> | null

The series component that renders the arc and label components.

`<VennSeries />`
disabledboolean

Whether the chart is disabled.

idstring

Id of the chart.

widthnumber

Width of the chart. If not provided will autosize.

heightnumber

Height of the chart. If not provided will autosize.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

VennSeriesΒ 

NameTypeDefault
idstring

Id set by the parent.

selectionsstring[]

Active managed selections.

dataIVennLayout<any>[]

The internal data object built by venn.js

colorSchemeColorSchemeType

Color scheme for the chart.

'cybertron'
disabledboolean

Whether the chart is disabled.

false
animatedboolean

Whether the chart is animated or not.

true
labelReactElement<VennLabelProps, FC<Partial<VennLabelProps>>> | null

Label element.

`<VennLabel />`
outerLabelReactElement<VennOuterLabelProps, FC<Partial<VennOuterLabelProps>>> | null

Label element.

`<VennOuterLabel />`
arcReactElement<VennArcProps, FC<Partial<VennArcProps>>> | null

Arc element.

`<VennArc />`

VennArcΒ 

NameTypeDefault
activeboolean | null

Whether the shape is active or not.

false
idstring

Id set by the parent.

animatedboolean

Whether the chart is animated or not.

fillstring

Fill color for the arc.

strokestring | ((data: IVennLayout<any>[], index: number, isActive: boolean | null, isHovered: boolean | null) => string)

Stroke for the arc.

dataIVennLayout<any>

The internal data object built by venn.js

disabledboolean

Whether the chart is disabled.

strokeWidthnumber

Stroke on the arc.

3
initialStyleany

Initial style of arc.

{ opacity: 0.6 }
activeStyleany

Active style of arc.

{ opacity: 0.8 }
inactiveStyleany

Inactive style of arc.

{ opacity: 0.3 }
styleany

CSS Styles for the arc.

tooltipReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | null

Tooltip element.

`<ChartTooltip />`
maskReactElement<MaskProps, FC<MaskProps>> | null

Mask element for the arc.

gradientReactElement<GradientProps, FC<Partial<GradientProps>>> | null

Gradient shades for the arc.

`<Gradient />`
glowGlow

Glow styling for the arc.

onClick(event: any) => void

Event for when the arc is clicked.

onMouseEnter(event: any) => void

Event for when the arc has mouse enter.

onMouseLeave(event: any) => void

Event for when the arc has mouse leave.

VennLabelΒ 

NameTypeDefault
activeboolean | null

Whether the shape is active or not.

idstring

Set by the parent element.

showAllboolean

Show all labels or just the large ones.

false
labelType"key" | "value"

The label type to show.

'key'
wrapboolean

Should wrap text or not.

true
dataany

The internal data object built by venn.js

fontSizenumber

Font size of the text.

11
fontFamilystring

Font family of the text.

'sans-serif'
fillstring

Fill of the text.

animatedboolean

Whether the chart is animated or not.

true
format(data: any) => any

Format label.

VennOuterLabelΒ 

NameTypeDefault
dataany

The internal data object built by venn.js

fontSizenumber

Font size of the text.

14
fontFamilystring

Font family of the text.

'sans-serif'
fillstring

Fill of the text.

'#000'
animatedboolean

Whether the chart is animated or not.

true
format(data: any) => any

Format label.

Last updated on