data.ts 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { CircleType } from '../../constants/type';
  2. const RADIUS = 6;
  3. const generateCirclesData = (width: number, height: number): Array<CircleType> => ([
  4. {
  5. direction: 'top-left',
  6. cx: RADIUS,
  7. cy: RADIUS,
  8. r: RADIUS,
  9. },
  10. {
  11. direction: 'left',
  12. cx: RADIUS,
  13. cy: height / 2 + 12,
  14. r: RADIUS,
  15. },
  16. {
  17. direction: 'bottom-left',
  18. cx: RADIUS,
  19. cy: height + 18,
  20. r: RADIUS,
  21. },
  22. {
  23. direction: 'bottom',
  24. cx: width / 2 + 12,
  25. cy: height + 18,
  26. r: RADIUS,
  27. },
  28. {
  29. direction: 'bottom-right',
  30. cx: width + 18,
  31. cy: height + 18,
  32. r: RADIUS,
  33. },
  34. {
  35. direction: 'right',
  36. cx: width + 18,
  37. cy: height / 2 + 12,
  38. r: RADIUS,
  39. },
  40. {
  41. direction: 'top-right',
  42. cx: width + 18,
  43. cy: RADIUS,
  44. r: RADIUS,
  45. },
  46. {
  47. direction: 'top',
  48. cx: width / 2 + 12,
  49. cy: RADIUS,
  50. r: RADIUS,
  51. },
  52. ]);
  53. export default generateCirclesData;