選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

data.ts 6.1KB

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