reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
opt-charts40
VennDiagram
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

VennDiagram

Chart

Compare two or three sets with area-scaled SVG circles, interactive exclusive regions, and an accessible table; three-set placement is approximate.

Related docs
bun add @reopt-ai/opt-charts
Install and import
bash
bun add @reopt-ai/opt-charts
tsx
import { VennDiagram, computeVennLayout, exclusiveRegionSizes, lensArea, solveCircleDistance, vennRegionKey } from "@reopt-ai/opt-charts";

Live preview

Change the width and theme, then interact with the components.

100%

두 집합 — 겹침 면적이 정확히 맞는다

구매자 only: 900명뉴스레터 구독자 only: 500명구매자 ∩ 뉴스레터 구독자: 300명구매자뉴스레터 구독자900명500명300명
Region sizes
RegionSize
구매자 only900명
뉴스레터 구독자 only500명
구매자 ∩ 뉴스레터 구독자300명

세 집합 — 영역 클릭

플랫폼별 활성 사용자

웹 only: 2,240명iOS only: 1,360명Android only: 1,100명웹 ∩ iOS: 480명웹 ∩ Android: 340명iOS ∩ Android: 120명웹 ∩ iOS ∩ Android: 140명웹iOSAndroid2,240명1,360명1,100명480명340명120명140명
Region sizes
RegionSize
웹 only2,240명
iOS only1,360명
Android only1,100명
웹 ∩ iOS480명
웹 ∩ Android340명
iOS ∩ Android120명
웹 ∩ iOS ∩ Android140명

선택한 영역: 없음

겹침 없음 / 완전 포함

무료 플랜 only: 900명엔터프라이즈 only: 300명무료 플랜 ∩ 엔터프라이즈: 0명무료 플랜엔터프라이즈900명300명
Region sizes
RegionSize
무료 플랜 only900명
엔터프라이즈 only300명
무료 플랜 ∩ 엔터프라이즈0명
전체 사용자 only: 1,500명이번 주 활성 only: 0명전체 사용자 ∩ 이번 주 활성: 500명전체 사용자이번 주 활성1,500명500명
Region sizes
RegionSize
전체 사용자 only1,500명
이번 주 활성 only0명
전체 사용자 ∩ 이번 주 활성500명

Usage guidance

Anatomy

  • Area-proportional set circles → interactive exclusive regions → set-name and region-value labels → visually hidden region table

Best practices

  • Use for overlaps between two or three sets. Supply set sizes, pairwise overlaps, and the triple overlap for three sets in the same units.
  • Add units such as people or records through valueFormatter; they appear in both region values and ARIA summaries.
  • Provide onRegionClick for drill-down. Each exclusive region then becomes a button.

Usage to avoid

  • Four or more sets cannot be represented accurately with circles and are ignored. Use a matrix or UpSet visualization instead.
  • The three-set layout is approximate. Show value labels and a table when exact numbers matter.

Usage examples

Overlap between two cohorts

VennDiagram

PropTypeDefaultDescription
setsRequiredVennSet[]—집합 2~3개. { id, label, size, color? }
intersectionsRequiredVennIntersection[]—쌍별 겹침과 (3집합이면) 삼중 겹침. { sets, size }
heightnumber280차트 높이. 너비는 1.5배 viewBox
valueFormatter(n: number) => string—값 포맷터. 기본은 로캘 숫자(formatNumber)
localestring—기본 숫자 포맷 로캘
showLabelsbooleantrue집합 이름과 영역 값 표시. 가장 큰 영역의 4% 미만인 조각은 값 라벨을 생략한다(표에는 남는다)
onRegionClick(region: { sets: string[]; size: number }) => void—배타 영역 클릭 핸들러. 주면 영역이 버튼이 됩니다. 영역은 핸들러가 없어도 포커스 가능하고 툴팁을 가진다
loadingbooleanfalse새 데이터를 기다리는 동안 그림을 흐리게 유지
labelsVennDiagramLabels—i18n용 라벨 오버라이드 (요약 문장, 영역 이름, 빈 상태, 표)
classNamestring—루트 CSS 클래스
aria-labelstring—접근성 이름. 뒤에 계산된 요약 문장이 붙습니다
View test results

테스트 커버리지

2026년 7월 9일

생성된 테스트 결과를 찾지 못했습니다.

VennDiagram 항목이 문서 메타에 연결되어 있지만 현재 생성 파일에는 없습니다.

테스트를 추가한 뒤 `bun run generate:test-results`를 실행하거나 `testDescribe` 매핑을 다시 확인하세요.

Related components

opt-charts

PathFlowChart

Charts

Explore staged user paths with transition ribbons, session starts and exits, grid or proportional Sankey layouts, and linked hover highlighting.

opt-charts

TimeSeriesChart

Charts

Explore time series with fixed query ranges, automatic ticks, incomplete buckets, drag zoom, annotations, thresholds, and comparison overlays.

opt-charts

TimeSeriesTooltip

Charts

Read full timestamps and time zones, sorted values, totals, comparison deltas, and incomplete-bucket warnings.

opt-charts

SmallMultiples

Charts

Compare breakdowns in small time-series panels with a shared y-axis, synchronized crosshairs, top-value ordering, and a collapsed long tail.

opt-charts

TraceWaterfall

Charts

Inspect nested trace spans on one timeline with collapsible branches, explicit failure markers, and compressed idle gaps that preserve reported durations.

opt-charts

EventSparkline

Charts

Show an event label, value, change, and miniature trend chart together.

PreviousTraceWaterfallNextMetricsCard