You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import { Data, ShapeType } from 'types'
  2. import shapeUtils from 'lib/shape-utils'
  3. export const defaultDocument: Data['document'] = {
  4. pages: {
  5. page0: {
  6. id: 'page0',
  7. type: 'page',
  8. name: 'Page 0',
  9. childIndex: 0,
  10. shapes: {
  11. // arrowShape0: shapeUtils[ShapeType.Arrow].create({
  12. // id: 'arrowShape0',
  13. // point: [200, 200],
  14. // points: [
  15. // [0, 0],
  16. // [200, 200],
  17. // ],
  18. // }),
  19. // arrowShape1: shapeUtils[ShapeType.Arrow].create({
  20. // id: 'arrowShape1',
  21. // point: [100, 100],
  22. // points: [
  23. // [0, 0],
  24. // [300, 0],
  25. // ],
  26. // }),
  27. // shape3: shapeUtils[ShapeType.Dot].create({
  28. // id: 'shape3',
  29. // name: 'Shape 3',
  30. // childIndex: 3,
  31. // point: [400, 500],
  32. // style: {
  33. // stroke: shades.black,
  34. // fill: shades.lightGray,
  35. // strokeWidth: 1,
  36. // },
  37. // }),
  38. // shape0: shapeUtils[ShapeType.Circle].create({
  39. // id: 'shape0',
  40. // name: 'Shape 0',
  41. // childIndex: 1,
  42. // point: [100, 600],
  43. // radius: 50,
  44. // style: {
  45. // stroke: shades.black,
  46. // fill: shades.lightGray,
  47. // strokeWidth: 1,
  48. // },
  49. // }),
  50. // shape5: shapeUtils[ShapeType.Ellipse].create({
  51. // id: 'shape5',
  52. // name: 'Shape 5',
  53. // childIndex: 5,
  54. // point: [200, 200],
  55. // radiusX: 50,
  56. // radiusY: 100,
  57. // style: {
  58. // stroke: shades.black,
  59. // fill: shades.lightGray,
  60. // strokeWidth: 1,
  61. // },
  62. // }),
  63. // shape7: shapeUtils[ShapeType.Ellipse].create({
  64. // id: 'shape7',
  65. // name: 'Shape 7',
  66. // childIndex: 7,
  67. // point: [100, 100],
  68. // radiusX: 50,
  69. // radiusY: 30,
  70. // style: {
  71. // stroke: shades.black,
  72. // fill: shades.lightGray,
  73. // strokeWidth: 1,
  74. // },
  75. // }),
  76. // shape6: shapeUtils[ShapeType.Line].create({
  77. // id: 'shape6',
  78. // name: 'Shape 6',
  79. // childIndex: 1,
  80. // point: [400, 400],
  81. // direction: [0.2, 0.2],
  82. // style: {
  83. // stroke: shades.black,
  84. // fill: shades.lightGray,
  85. // strokeWidth: 1,
  86. // },
  87. // }),
  88. // rayShape: shapeUtils[ShapeType.Ray].create({
  89. // id: 'rayShape',
  90. // name: 'Ray',
  91. // childIndex: 3,
  92. // point: [300, 100],
  93. // direction: [0.5, 0.5],
  94. // style: {
  95. // stroke: shades.black,
  96. // fill: shades.lightGray,
  97. // strokeWidth: 1,
  98. // },
  99. // }),
  100. // shape2: shapeUtils[ShapeType.Polyline].create({
  101. // id: 'shape2',
  102. // name: 'Shape 2',
  103. // childIndex: 2,
  104. // point: [200, 600],
  105. // points: [
  106. // [0, 0],
  107. // [75, 200],
  108. // [100, 50],
  109. // ],
  110. // style: {
  111. // stroke: shades.black,
  112. // fill: shades.none,
  113. // strokeWidth: 1,
  114. // },
  115. // }),
  116. // shape1: shapeUtils[ShapeType.Rectangle].create({
  117. // id: 'shape1',
  118. // name: 'Shape 1',
  119. // childIndex: 1,
  120. // point: [400, 600],
  121. // size: [200, 200],
  122. // style: {
  123. // stroke: shades.black,
  124. // fill: shades.lightGray,
  125. // strokeWidth: 1,
  126. // },
  127. // }),
  128. },
  129. },
  130. },
  131. code: {
  132. file0: {
  133. id: 'file0',
  134. name: 'index.ts',
  135. code: `
  136. new Dot({
  137. point: new Vector(0, 0),
  138. })
  139. new Circle({
  140. point: new Vector(200, 0),
  141. radius: 50,
  142. })
  143. new Ellipse({
  144. point: new Vector(400, 0),
  145. radiusX: 50,
  146. radiusY: 75
  147. })
  148. new Rectangle({
  149. point: new Vector(0, 300),
  150. })
  151. new Line({
  152. point: new Vector(200, 300),
  153. direction: new Vector(1,0.2)
  154. })
  155. new Polyline({
  156. point: new Vector(400, 300),
  157. points: [new Vector(0, 200), new Vector(0,0), new Vector(200, 200), new Vector(200, 0)],
  158. })
  159. `,
  160. },
  161. },
  162. }