lines.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import type { LinePoint, LineStyleType } from '@/lib/types/slides';
  2. export interface LinePoolItem {
  3. path: string;
  4. style: LineStyleType;
  5. points: [LinePoint, LinePoint];
  6. isBroken?: boolean;
  7. isBroken2?: boolean;
  8. isCurve?: boolean;
  9. isCubic?: boolean;
  10. }
  11. interface PresetLine {
  12. type: string;
  13. children: LinePoolItem[];
  14. }
  15. export const LINE_LIST: PresetLine[] = [
  16. {
  17. type: '直线',
  18. children: [
  19. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', ''] },
  20. { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', ''] },
  21. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'arrow'] },
  22. { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', 'arrow'] },
  23. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'dot'] },
  24. ],
  25. },
  26. {
  27. type: '折线、曲线',
  28. children: [
  29. {
  30. path: 'M 0 0 L 0 20 L 20 20',
  31. style: 'solid',
  32. points: ['', 'arrow'],
  33. isBroken: true,
  34. },
  35. {
  36. path: 'M 0 0 L 10 0 L 10 20 L 20 20',
  37. style: 'solid',
  38. points: ['', 'arrow'],
  39. isBroken2: true,
  40. },
  41. {
  42. path: 'M 0 0 Q 0 20 20 20',
  43. style: 'solid',
  44. points: ['', 'arrow'],
  45. isCurve: true,
  46. },
  47. {
  48. path: 'M 0 0 C 20 0 0 20 20 20',
  49. style: 'solid',
  50. points: ['', 'arrow'],
  51. isCubic: true,
  52. },
  53. ],
  54. },
  55. ];