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β
| Prop | Description | Default |
|---|---|---|
type | Type of the chart."venn" | "euler" | "starEuler" | venn |
data * | Data the chart will receive to render.VennDiagramData[] | |
series | The series component that renders the arc and label components.ReactElement<VennSeriesProps, FC<Partial<VennSeriesProps>>> | <VennSeries /> |
disabled | Whether the chart is disabled.boolean | |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
VennSeriesβ
| Prop | Description | Default |
|---|---|---|
id | Id set by the parent.string | |
selections | Active managed selections.string[] | |
data | The internal data object built by venn.jsIVennLayout<any>[] | |
colorScheme | Color scheme for the chart.ColorSchemeType | cybertron |
disabled | Whether the chart is disabled.boolean | false |
animated | Whether the chart is animated or not.boolean | true |
label | Label element.ReactElement<VennLabelProps, FC<Partial<VennLabelProps>>> | <VennLabel /> |
outerLabel | Label element.ReactElement<VennOuterLabelProps, FC<Partial<VennOuterLabelProps>>> | <VennOuterLabel /> |
arc | Arc element.ReactElement<VennArcProps, FC<Partial<VennArcProps>>> | <VennArc /> |
VennArcβ
| Prop | Description | Default |
|---|---|---|
active | Whether the shape is active or not.boolean | false |
id | Id set by the parent.string | |
animated | Whether the chart is animated or not.boolean | |
fill | Fill color for the arc.string | |
stroke | Stroke for the arc.string | ((data: IVennLayout<any>[], index: number, isActive: boolean, isHovered: boolean) => string) | |
data | The internal data object built by venn.jsIVennLayout<any> | |
disabled | Whether the chart is disabled.boolean | |
strokeWidth | Stroke on the arc.number | 3 |
initialStyle | Initial style of arc.any | { opacity: 0.6 } |
activeStyle | Active style of arc.any | { opacity: 0.8 } |
inactiveStyle | Inactive style of arc.any | { opacity: 0.3 } |
style | CSS Styles for the arc.any | |
tooltip | Tooltip element.ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | <ChartTooltip /> |
mask | Mask element for the arc.ReactElement<MaskProps, FC<MaskProps>> | |
gradient | Gradient shades for the arc.ReactElement<GradientProps, FC<Partial<GradientProps>>> | <Gradient /> |
glow | Glow styling for the arc.Glow | |
onClick | Event for when the arc is clicked.(event: any) => void | () => undefined |
onMouseEnter | Event for when the arc has mouse enter.(event: any) => void | () => undefined |
onMouseLeave | Event for when the arc has mouse leave.(event: any) => void | () => undefined |
VennLabelβ
| Prop | Description | Default |
|---|---|---|
active | Whether the shape is active or not.boolean | |
id | Set by the parent element.string | |
showAll | Show all labels or just the large ones. Default false.boolean | false |
labelType | The label type to show."key" | "value" | key |
wrap | Should wrap text or not.boolean | true |
data | The internal data object built by venn.jsany | |
fontSize | Font size of the text.number | 11 |
fontFamily | Font family of the text.string | sans-serif |
fill | Fill of the text.string | |
animated | Whether the chart is animated or not.boolean | true |
format | Format label.(data: any) => any |
VennOuterLabelβ
| Prop | Description | Default |
|---|---|---|
data | The internal data object built by venn.jsany | |
fontSize | Font size of the text.number | 14 |
fontFamily | Font family of the text.string | sans-serif |
fill | Fill of the text.string | #000 |
animated | Whether the chart is animated or not.boolean | true |
format | Format label.(data: any) => any |
Last updated on