import React from 'react'; import { VennDiagram } from 'reaviz'; import { schemes } from 'reaviz'; import { VennSeries } from 'reaviz'; import { VennArc } from 'reaviz'; import { Stripes } from 'reaviz'; import { VennLabel } from 'reaviz'; import { Gradient } from 'reaviz'; import { VennOuterLabel } from 'reaviz'; import { symbol, symbolStar } from 'd3-shape'; // Make a static star path for demos const starPath = symbol().type(symbolStar).size(50)(); export default { tags: ['snapshot'], title: 'Charts/Venn Diagram', component: VennDiagram, subcomponents: { VennSeries, VennArc, VennOuterLabel, VennLabel } }; export const Simple = () => ( } />} label={} /> } /> ); export const Euler = () => ( ); export const StarEuler = () => ( } /> } label={} outerLabel={} /> } /> ); export const LabelIcons = () => ( } outerLabel={ { // set some static height/width expectations const height = 50; const width = 50; // Calculate some offsets based on size of your element const offsetX = data.set.align !== 'start' ? -width / 2 : 0; const offsetY = data.set.verticalAlign !== 'top' ? -height / 2 : 0; // Pass a foreign object return ( ); }} /> } /> } /> ); export const Selections = () => ( { if (hovered) { return 'blue'; } else if (active) { return 'green'; } return 'white'; }} /> } /> } /> ); export const CustomColors = () => ( { return index % 2 ? 'white' : 'grey'; }} arc={ { if (hovered) { return 'blue'; } else if (active) { return 'green'; } return 'white'; }} /> } /> } /> ); export const LargeOffsets = () => ( ); export const LongText = () => ( ); export const ManyIntersections = () => ( } /> ); ManyIntersections.tags = ['no-snapshot']; export const NoIntersections = () => ( ); export const Mask = () => ( } strokeWidth={1} />} />} data={[ { key: ['A'], data: 12 }, { key: ['B'], data: 12 }, { key: ['A', 'B'], data: 2 } ]} /> ); export const NoFill = () => ( } /> } data={[ { key: ['A'], data: 12 }, { key: ['B'], data: 12 }, { key: ['A', 'B'], data: 2 } ]} /> ); export const NoLabel = () => ( } />} data={[ { key: ['A'], data: 12 }, { key: ['B'], data: 12 } ]} /> ); export const NoAnimation = () => ( } data={[ { key: ['A'], data: 12 }, { key: ['B'], data: 12 }, { key: ['A', 'B'], data: 2 } ]} /> ); export const Autosize = () => (
); Autosize.tags = ['no-snapshot']; const eulerData = [ { key: ['manageengine', 'meraki'], data: 150 }, { key: ['manageengine', 'active directory', 'sophos', 'meraki'], data: 91 }, { key: ['manageengine'], data: 202 }, { key: ['sophos'], data: 219 }, { key: ['manageengine', 'active directory', 'meraki'], data: 95 }, { key: ['manageengine', 'sophos'], data: 175 }, { key: ['manageengine', 'sophos', 'meraki'], data: 140 }, { key: ['active directory', 'sophos'], data: 113 }, { key: ['sophos', 'meraki'], data: 150 }, { key: ['gsuite'], data: 449 }, { key: ['gsuite', 'meraki'], data: 189 }, { key: ['meraki'], data: 850 }, { key: ['manageengine', 'active directory'], data: 109 }, { key: ['active directory'], data: 224 }, { key: ['active directory', 'meraki'], data: 98 }, { key: ['active directory', 'sophos', 'meraki'], data: 94 }, { key: ['manageengine', 'active directory', 'sophos'], data: 103 } ];