Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { LinearGradient } from '@vx/gradient';
import { Group } from '@vx/group';
import { genStats } from '@vx/mock-data';
import { PatternLines } from '@vx/pattern';
import { scaleBand, scaleLinear } from '@vx/scale';
import { BoxPlot, ViolinPlot } from '@vx/stats';
import { Tooltip, withTooltip } from '@vx/tooltip';
import { format } from 'd3-format';
import React from 'react';
const data = genStats(5);
const twoDecimalFormat = format('.2f');
// accessors
const x = d => d.boxPlot.x;
const min = d => d.boxPlot.min;
const max = d => d.boxPlot.max;
const median = d => d.boxPlot.median;
const firstQuartile = d => d.boxPlot.firstQuartile;
const thirdQuartile = d => d.boxPlot.thirdQuartile;
const outliers = d => d.boxPlot.outliers;
export default withTooltip(
({
width,
height,
events = false,
r: minSize + Math.random() * (maxSize - minSize),
fillOpacity: Math.max(0.4, Math.random()),
fill: theme.colors.categories[i % 2 === 0 ? 1 : 3],
}))
.concat(
Array(70)
.fill(null)
.map((_, i) => ({
x: start,
r: minSize + Math.random() * (maxSize - minSize),
fillOpacity: Math.max(0.4, Math.random()),
fill: theme.colors.categories[i % 2 === 0 ? 1 : 3],
})),
);
export const statsData = genStats(5);