Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cityTemperature,
appleStock,
genRandomNormalPoints,
letterFrequency,
genStats,
} from '@vx/mock-data';
import { theme } from '@data-ui/xy-chart';
export const timeSeriesData = appleStock
.filter((d, i) => i % 120 === 0)
.map(d => ({
x: new Date(d.date),
y: d.close,
}));
export const appleStockData = appleStock
.filter((d, i) => i % 10 === 0)
.map(d => ({
x: new Date(d.date),
y: d.close,
}));
export const categoricalData = letterFrequency.map(d => ({
x: d.letter,
y: d.frequency,
}));
// stacked data
export const groupKeys = Object.keys(cityTemperature[0]).filter(attr => attr !== 'date');
export const stackedData = cityTemperature.slice(0, 12).map(d => ({
// convert all keys to numbers
...groupKeys.reduce((obj, key) => ({ ...obj, [key]: Number(d[key]) }), {}),