lines.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type { LinePoint } from '@/types/slides'
  2. export interface LinePoolItem {
  3. path: string
  4. style: 'solid' | 'dashed'
  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. { path: 'M 0 0 L 0 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken: true },
  30. { path: 'M 0 0 L 10 0 L 10 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken2: true },
  31. { path: 'M 0 0 Q 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCurve: true },
  32. { path: 'M 0 0 C 20 0 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCubic: true },
  33. ],
  34. },
  35. ]