import { list } from "radash" import React from "react" import { classNames } from "../../../utils" import { Skeleton } from "../../Skeleton" import { ChartSkeleton, ChartSkeletonProps } from "../ChartSkeleton" import { RANDOM_POSITIONS_X, RANDOM_POSITIONS_Y } from "./constants" // Returns a random position percentage value between 5% and 95% const getRandomPosition = (index: number) => { return { x: RANDOM_POSITIONS_X[index % RANDOM_POSITIONS_X.length], y: RANDOM_POSITIONS_Y[index % RANDOM_POSITIONS_Y.length], } } export type ScatterplotSkeletonProps = Omit & Pick const ScatterplotSkeletonBase = ({ numPoints = 60, ...rest }: ScatterplotSkeletonProps) => { return ( {list(1, numPoints).map(index => ( ))} } {...rest} /> ) } type ScatterplotSkeletonDotsProps = { numPoints?: number className?: string } const ScatterplotSkeletonDots = ({ numPoints = 60, className, }: ScatterplotSkeletonDotsProps) => { return list(1, numPoints).map(index => ( )) } export const ScatterplotSkeleton = Object.assign(ScatterplotSkeletonBase, { Dots: ScatterplotSkeletonDots, })