import { BubbleChart } from 'reaviz'; import { ChartShallowDataShape } from 'reaviz'; import { BubbleSeries } from 'reaviz'; import { range } from 'd3-array'; import { randomNumber } from 'reaviz-data-utils'; import { Bubble } from 'reaviz'; import { Gradient as GradientBG } from 'reaviz'; import { Stripes } from 'reaviz'; import { BubbleLabel } from 'reaviz'; import { icons } from 'reaviz-data-utils'; const simpleData: ChartShallowDataShape[] = [ { key: 'AWS', data: 100 }, { key: 'SendGrid', data: 45 }, { key: 'Okta', data: 75 }, { key: 'Twillo', data: 25 } ]; export default { tags: ['snapshot'], title: 'Charts/Bubble Chart', component: BubbleChart, subcomponents: { BubbleSeries, BubbleLabel, Bubble } }; export const Simple = () => ( } /> ); export const Mask = () => ( } />} /> } /> ); export const Gradient = () => ( } />} /> } /> ); export const Icons = () => ( { const logos = { AWS: icons.AWS(), SendGrid: icons.SendGrid(), Okta: icons.Okta(), Twillo: icons.Twillo() }; return ( {logos[data.data.key]} {data.data.key} ); }} /> } /> } /> ); export const LongText = () => { const longData: ChartShallowDataShape[] = [ { key: 'Department of Curtains and Interior Design', data: 100 }, { key: 'Fresh Kitchen Pasta Dish and Pizza', data: 45 }, { key: 'Short Name', data: 25 } ]; return ( ); }; export const NoAnimation = () => ( } data={simpleData} /> ); export const VaryingSizes = () => { const longData: ChartShallowDataShape[] = range(15).map((o) => ({ key: `${o}`, data: Math.round(o % 2 === 0 ? 100 * (1 + o * 1.5) : 50 * (1 + o * 4)) })); return ( ); }; export const _100Bubbles = () => { const longData: ChartShallowDataShape[] = range(100).map((o) => ({ key: `${o + 1}`, data: 1 })); return ( ); }; _100Bubbles.tags = ['no-snapshot']; export const Autosize = () => (
); Autosize.tags = ['no-snapshot'];