Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

data.ts 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. import { Data } from 'types'
  2. export const defaultDocument: Data['document'] = {
  3. id: '0001',
  4. name: 'My Default Document',
  5. pages: {
  6. page1: {
  7. id: 'page1',
  8. type: 'page',
  9. name: 'Page 1',
  10. childIndex: 0,
  11. shapes: {
  12. // textShape0: shapeUtils[ShapeType.Text].create({
  13. // id: 'textShape0',
  14. // point: [0, 0],
  15. // text: 'Short',
  16. // childIndex: 0,
  17. // }),
  18. // textShape1: shapeUtils[ShapeType.Text].create({
  19. // id: 'textShape1',
  20. // point: [100, 150],
  21. // fontSize: FontSize.Small,
  22. // text: 'Well, this is a pretty long title. I hope it all still works',
  23. // childIndex: 1,
  24. // }),
  25. // textShape2: shapeUtils[ShapeType.Text].create({
  26. // id: 'textShape2',
  27. // point: [100, 200],
  28. // fontSize: FontSize.Medium,
  29. // text: 'Well, this is a pretty long title. I hope it all still works',
  30. // childIndex: 2,
  31. // }),
  32. // textShape3: shapeUtils[ShapeType.Text].create({
  33. // id: 'textShape3',
  34. // point: [100, 250],
  35. // fontSize: FontSize.Large,
  36. // text: 'Well, this is a pretty long title. I hope it all still works',
  37. // childIndex: 3,
  38. // }),
  39. // textShape4: shapeUtils[ShapeType.Text].create({
  40. // id: 'textShape4',
  41. // point: [100, 300],
  42. // fontSize: FontSize.ExtraLarge,
  43. // text: 'Well, this is a pretty long title. I hope it all still works',
  44. // childIndex: 4,
  45. // }),
  46. // arrowShape0: shapeUtils[ShapeType.Arrow].create({
  47. // id: 'arrowShape0',
  48. // point: [200, 200],
  49. // points: [
  50. // [0, 0],
  51. // [200, 200],
  52. // ],
  53. // }),
  54. // arrowShape1: shapeUtils[ShapeType.Arrow].create({
  55. // id: 'arrowShape1',
  56. // point: [100, 100],
  57. // points: [
  58. // [0, 0],
  59. // [300, 0],
  60. // ],
  61. // }),
  62. // shape3: shapeUtils[ShapeType.Dot].create({
  63. // id: 'shape3',
  64. // name: 'Shape 3',
  65. // childIndex: 3,
  66. // point: [400, 500],
  67. // style: {
  68. // stroke: shades.black,
  69. // fill: shades.lightGray,
  70. // strokeWidth: 1,
  71. // },
  72. // }),
  73. // shape0: shapeUtils[ShapeType.Circle].create({
  74. // id: 'shape0',
  75. // name: 'Shape 0',
  76. // childIndex: 1,
  77. // point: [100, 600],
  78. // radius: 50,
  79. // style: {
  80. // stroke: shades.black,
  81. // fill: shades.lightGray,
  82. // strokeWidth: 1,
  83. // },
  84. // }),
  85. // shape5: shapeUtils[ShapeType.Ellipse].create({
  86. // id: 'shape5',
  87. // name: 'Shape 5',
  88. // childIndex: 5,
  89. // point: [200, 200],
  90. // radiusX: 50,
  91. // radiusY: 100,
  92. // style: {
  93. // stroke: shades.black,
  94. // fill: shades.lightGray,
  95. // strokeWidth: 1,
  96. // },
  97. // }),
  98. // shape7: shapeUtils[ShapeType.Ellipse].create({
  99. // id: 'shape7',
  100. // name: 'Shape 7',
  101. // childIndex: 7,
  102. // point: [100, 100],
  103. // radiusX: 50,
  104. // radiusY: 30,
  105. // style: {
  106. // stroke: shades.black,
  107. // fill: shades.lightGray,
  108. // strokeWidth: 1,
  109. // },
  110. // }),
  111. // shape6: shapeUtils[ShapeType.Line].create({
  112. // id: 'shape6',
  113. // name: 'Shape 6',
  114. // childIndex: 1,
  115. // point: [400, 400],
  116. // direction: [0.2, 0.2],
  117. // style: {
  118. // stroke: shades.black,
  119. // fill: shades.lightGray,
  120. // strokeWidth: 1,
  121. // },
  122. // }),
  123. // rayShape: shapeUtils[ShapeType.Ray].create({
  124. // id: 'rayShape',
  125. // name: 'Ray',
  126. // childIndex: 3,
  127. // point: [300, 100],
  128. // direction: [0.5, 0.5],
  129. // style: {
  130. // stroke: shades.black,
  131. // fill: shades.lightGray,
  132. // strokeWidth: 1,
  133. // },
  134. // }),
  135. // shape2: shapeUtils[ShapeType.Polyline].create({
  136. // id: 'shape2',
  137. // name: 'Shape 2',
  138. // childIndex: 2,
  139. // point: [200, 600],
  140. // points: [
  141. // [0, 0],
  142. // [75, 200],
  143. // [100, 50],
  144. // ],
  145. // style: {
  146. // stroke: shades.black,
  147. // fill: shades.none,
  148. // strokeWidth: 1,
  149. // },
  150. // }),
  151. // Groups Testing
  152. // shapeA: shapeUtils[ShapeType.Rectangle].create({
  153. // id: 'shapeA',
  154. // name: 'Shape A',
  155. // childIndex: 1,
  156. // point: [0, 0],
  157. // size: [200, 200],
  158. // parentId: 'groupA',
  159. // }),
  160. // shapeB: shapeUtils[ShapeType.Rectangle].create({
  161. // id: 'shapeB',
  162. // name: 'Shape B',
  163. // childIndex: 2,
  164. // point: [220, 100],
  165. // size: [200, 200],
  166. // parentId: 'groupA',
  167. // }),
  168. // groupA: shapeUtils[ShapeType.Group].create({
  169. // id: 'groupA',
  170. // name: 'Group A',
  171. // childIndex: 2,
  172. // point: [0, 0],
  173. // size: [420, 300],
  174. // parentId: 'page1',
  175. // children: ['shapeA', 'shapeB'],
  176. // }),
  177. },
  178. },
  179. page2: {
  180. id: 'page2',
  181. type: 'page',
  182. name: 'Page 2',
  183. childIndex: 1,
  184. shapes: {},
  185. },
  186. },
  187. code: {
  188. file0: {
  189. id: 'file0',
  190. name: 'index.ts',
  191. code: `
  192. new Dot({
  193. point: new Vector(0, 0),
  194. })
  195. new Circle({
  196. point: new Vector(200, 0),
  197. radius: 50,
  198. })
  199. new Ellipse({
  200. point: new Vector(400, 0),
  201. radiusX: 50,
  202. radiusY: 75
  203. })
  204. new Rectangle({
  205. point: new Vector(0, 300),
  206. })
  207. new Line({
  208. point: new Vector(200, 300),
  209. direction: new Vector(1,0.2)
  210. })
  211. new Polyline({
  212. point: new Vector(400, 300),
  213. points: [new Vector(0, 200), new Vector(0,0), new Vector(200, 200), new Vector(200, 0)],
  214. })
  215. `,
  216. },
  217. },
  218. }