@operato/scene-basic 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +0 -0
  3. package/demo/index.html +158 -0
  4. package/demo/things-scene-basic.html +6 -0
  5. package/dist/anchors/ellipse-anchors.d.ts +7 -0
  6. package/dist/anchors/ellipse-anchors.js +43 -0
  7. package/dist/anchors/ellipse-anchors.js.map +1 -0
  8. package/dist/audio.d.ts +25 -0
  9. package/dist/audio.js +141 -0
  10. package/dist/audio.js.map +1 -0
  11. package/dist/cloud.d.ts +13 -0
  12. package/dist/cloud.js +30 -0
  13. package/dist/cloud.js.map +1 -0
  14. package/dist/donut.d.ts +15 -0
  15. package/dist/donut.js +74 -0
  16. package/dist/donut.js.map +1 -0
  17. package/dist/ellipse.d.ts +24 -0
  18. package/dist/ellipse.js +72 -0
  19. package/dist/ellipse.js.map +1 -0
  20. package/dist/gif-view.d.ts +18 -0
  21. package/dist/gif-view.js +116 -0
  22. package/dist/gif-view.js.map +1 -0
  23. package/dist/image-view.d.ts +19 -0
  24. package/dist/image-view.js +180 -0
  25. package/dist/image-view.js.map +1 -0
  26. package/dist/index.d.ts +11 -0
  27. package/dist/index.js +15 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/outline/ellipse-outline.d.ts +2 -0
  30. package/dist/outline/ellipse-outline.js +11 -0
  31. package/dist/outline/ellipse-outline.js.map +1 -0
  32. package/dist/polygon.d.ts +19 -0
  33. package/dist/polygon.js +84 -0
  34. package/dist/polygon.js.map +1 -0
  35. package/dist/polyline.d.ts +18 -0
  36. package/dist/polyline.js +102 -0
  37. package/dist/polyline.js.map +1 -0
  38. package/dist/rect.d.ts +19 -0
  39. package/dist/rect.js +60 -0
  40. package/dist/rect.js.map +1 -0
  41. package/dist/star.d.ts +13 -0
  42. package/dist/star.js +80 -0
  43. package/dist/star.js.map +1 -0
  44. package/dist/templates/audio.d.ts +14 -0
  45. package/dist/templates/audio.js +15 -0
  46. package/dist/templates/audio.js.map +1 -0
  47. package/dist/templates/color-image.d.ts +22 -0
  48. package/dist/templates/color-image.js +23 -0
  49. package/dist/templates/color-image.js.map +1 -0
  50. package/dist/templates/donut.d.ts +22 -0
  51. package/dist/templates/donut.js +23 -0
  52. package/dist/templates/donut.js.map +1 -0
  53. package/dist/templates/ellipse.d.ts +21 -0
  54. package/dist/templates/ellipse.js +22 -0
  55. package/dist/templates/ellipse.js.map +1 -0
  56. package/dist/templates/gif-image.d.ts +14 -0
  57. package/dist/templates/gif-image.js +15 -0
  58. package/dist/templates/gif-image.js.map +1 -0
  59. package/dist/templates/gray-image.d.ts +22 -0
  60. package/dist/templates/gray-image.js +23 -0
  61. package/dist/templates/gray-image.js.map +1 -0
  62. package/dist/templates/index.d.ts +74 -0
  63. package/dist/templates/index.js +15 -0
  64. package/dist/templates/index.js.map +1 -0
  65. package/dist/templates/polygon.d.ts +22 -0
  66. package/dist/templates/polygon.js +25 -0
  67. package/dist/templates/polygon.js.map +1 -0
  68. package/dist/templates/polyline.d.ts +22 -0
  69. package/dist/templates/polyline.js +25 -0
  70. package/dist/templates/polyline.js.map +1 -0
  71. package/dist/templates/rect.d.ts +21 -0
  72. package/dist/templates/rect.js +22 -0
  73. package/dist/templates/rect.js.map +1 -0
  74. package/dist/templates/star.d.ts +23 -0
  75. package/dist/templates/star.js +24 -0
  76. package/dist/templates/star.js.map +1 -0
  77. package/dist/templates/text.d.ts +27 -0
  78. package/dist/templates/text.js +28 -0
  79. package/dist/templates/text.js.map +1 -0
  80. package/dist/templates/triangle.d.ts +23 -0
  81. package/dist/templates/triangle.js +24 -0
  82. package/dist/templates/triangle.js.map +1 -0
  83. package/dist/text.d.ts +6 -0
  84. package/dist/text.js +11 -0
  85. package/dist/text.js.map +1 -0
  86. package/dist/triangle.d.ts +14 -0
  87. package/dist/triangle.js +75 -0
  88. package/dist/triangle.js.map +1 -0
  89. package/icons/audio.png +0 -0
  90. package/icons/both-arrow.png +0 -0
  91. package/icons/color-image.png +0 -0
  92. package/icons/container.png +0 -0
  93. package/icons/dash.png +0 -0
  94. package/icons/donut.png +0 -0
  95. package/icons/ellipse.png +0 -0
  96. package/icons/gif-image.png +0 -0
  97. package/icons/global-reference.png +0 -0
  98. package/icons/gray-image.png +0 -0
  99. package/icons/humidity-sensor.png +0 -0
  100. package/icons/info-window.png +0 -0
  101. package/icons/line.png +0 -0
  102. package/icons/local-reference.png +0 -0
  103. package/icons/no-image.png +0 -0
  104. package/icons/ortholine.png +0 -0
  105. package/icons/person.png +0 -0
  106. package/icons/polygon.png +0 -0
  107. package/icons/polyline.png +0 -0
  108. package/icons/popup.png +0 -0
  109. package/icons/rect.png +0 -0
  110. package/icons/single-arrow.png +0 -0
  111. package/icons/star.png +0 -0
  112. package/icons/text.png +0 -0
  113. package/icons/triangle.png +0 -0
  114. package/package.json +61 -0
  115. package/src/anchors/ellipse-anchors.ts +46 -0
  116. package/src/audio.ts +173 -0
  117. package/src/cloud.ts +40 -0
  118. package/src/donut.ts +92 -0
  119. package/src/ellipse.ts +90 -0
  120. package/src/gif-view.ts +146 -0
  121. package/src/image-view.ts +215 -0
  122. package/src/index.ts +16 -0
  123. package/src/outline/ellipse-outline.ts +15 -0
  124. package/src/polygon.ts +103 -0
  125. package/src/polyline.ts +122 -0
  126. package/src/rect.ts +71 -0
  127. package/src/star.ts +104 -0
  128. package/src/templates/audio.ts +15 -0
  129. package/src/templates/color-image.ts +23 -0
  130. package/src/templates/donut.ts +23 -0
  131. package/src/templates/ellipse.ts +22 -0
  132. package/src/templates/gif-image.ts +15 -0
  133. package/src/templates/gray-image.ts +23 -0
  134. package/src/templates/index.ts +16 -0
  135. package/src/templates/polygon.ts +25 -0
  136. package/src/templates/polyline.ts +25 -0
  137. package/src/templates/rect.ts +22 -0
  138. package/src/templates/star.ts +24 -0
  139. package/src/templates/text.ts +28 -0
  140. package/src/templates/triangle.ts +24 -0
  141. package/src/text.ts +12 -0
  142. package/src/triangle.ts +87 -0
  143. package/test/basic-test.html +63 -0
  144. package/test/index.html +22 -0
  145. package/things-scene.config.js +5 -0
  146. package/tsconfig.json +23 -0
  147. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,18 @@
1
+ import { Component, ComponentNature, Line } from '@hatiolab/things-scene';
2
+ export default class Polyline extends Line {
3
+ _fromEnd: any;
4
+ _toEnd: any;
5
+ get pathExtendable(): boolean;
6
+ get path(): any[];
7
+ set path(path: any[]);
8
+ get controls(): {
9
+ x: any;
10
+ y: any;
11
+ handler: {
12
+ ondragstart: (point: import("@hatiolab/things-scene").DIMENSION, index: number, component: Component) => void;
13
+ ondragmove: (point: import("@hatiolab/things-scene").DIMENSION, index: number, component: Component) => void;
14
+ ondragend: (point: import("@hatiolab/things-scene").DIMENSION, index: number, component: Component) => void;
15
+ };
16
+ }[];
17
+ get nature(): ComponentNature;
18
+ }
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { Component, Line } from '@hatiolab/things-scene';
5
+ var controlHandler = {
6
+ ondragstart: function (point, index, component) {
7
+ component.mutatePath(null, function (path) {
8
+ path.splice(index, 0, point); // array.insert(index, point) 의 의미임.
9
+ });
10
+ },
11
+ ondragmove: function (point, index, component) {
12
+ component.mutatePath(null, function (path) {
13
+ path[index] = point;
14
+ });
15
+ },
16
+ ondragend: function (point, index, component) { }
17
+ };
18
+ const NATURE = {
19
+ mutable: false,
20
+ resizable: false,
21
+ rotatable: false,
22
+ properties: [
23
+ {
24
+ type: 'number',
25
+ label: 'round',
26
+ name: 'round',
27
+ property: {
28
+ min: 0,
29
+ max: 100,
30
+ step: 1
31
+ }
32
+ }
33
+ ],
34
+ help: 'scene/component/polyline'
35
+ };
36
+ export default class Polyline extends Line {
37
+ get pathExtendable() {
38
+ return true;
39
+ }
40
+ get path() {
41
+ var _a, _b;
42
+ const { from, to } = this.state;
43
+ const { path } = this.state;
44
+ return [
45
+ ((_a = this.fromEnd) === null || _a === void 0 ? void 0 : _a.position) || (from === null || from === void 0 ? void 0 : from.position) || path[0],
46
+ ...path.slice(1, -1),
47
+ ((_b = this.toEnd) === null || _b === void 0 ? void 0 : _b.position) || (to === null || to === void 0 ? void 0 : to.position) || path[path.length - 1]
48
+ ];
49
+ }
50
+ set path(path) {
51
+ const { from, to } = this.state;
52
+ delete this._fromEnd;
53
+ delete this._toEnd;
54
+ this.set({
55
+ from: {
56
+ ...from,
57
+ position: path[0]
58
+ },
59
+ to: {
60
+ ...to,
61
+ position: path[path.length - 1]
62
+ },
63
+ path
64
+ });
65
+ }
66
+ get controls() {
67
+ // 폴리라인에서의 control은 새로운 path를 추가하는 포인트이다.
68
+ var path = this.path;
69
+ var controls = [];
70
+ for (let i = 0; i < path.length - 1; i++) {
71
+ let p1 = path[i];
72
+ let p2 = path[i + 1];
73
+ if (i == 0) {
74
+ controls.push({
75
+ x: p1.x,
76
+ y: p1.y,
77
+ handler: controlHandler
78
+ });
79
+ }
80
+ controls.push({
81
+ x: (p1.x + p2.x) / 2,
82
+ y: (p1.y + p2.y) / 2,
83
+ handler: controlHandler
84
+ });
85
+ if (i == path.length - 2) {
86
+ controls.push({
87
+ x: p2.x,
88
+ y: p2.y,
89
+ handler: controlHandler
90
+ });
91
+ }
92
+ }
93
+ return controls;
94
+ }
95
+ get nature() {
96
+ return NATURE;
97
+ }
98
+ }
99
+ /* target anchor의 움직임이 반영되지 못하므로, 일단 controls memoize를 제거함. */
100
+ // Component.memoize(Polyline.prototype, 'controls', false)
101
+ Component.register('polyline', Polyline);
102
+ //# sourceMappingURL=polyline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyline.js","sourceRoot":"","sources":["../src/polyline.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAA+B,IAAI,EAAY,MAAM,wBAAwB,CAAA;AAE/F,IAAI,cAAc,GAAG;IACnB,WAAW,EAAE,UAAU,KAAe,EAAE,K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,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBACpB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBACpB,OAAO,EAAE,cAAc;aACxB,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxB,QAAQ,CAAC,IAAI,CAAC;oBACZ,CAAC,EAAE,EAAE,CAAC,CAAC;oBACP,CAAC,EAAE,EAAE,CAAC,CAAC;oBACP,OAAO,EAAE,cAAc;iBACxB,CAAC,CAAA;aACH;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,8DAA8D;AAC9D,2DAA2D;AAE3D,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, ComponentNature, Properties, Line, POSITION } from '@hatiolab/things-scene'\n\nvar controlHandler = {\n ondragstart: function (point: POSITION, index: number, component: Component) {\n component.mutatePath(null, function (path) {\n path.splice(index, 0, point) // array.insert(index, point) 의 의미임.\n })\n },\n\n ondragmove: function (point: POSITION, index: number, component: Component) {\n component.mutatePath(null, function (path) {\n path[index] = point\n })\n },\n\n ondragend: function (point: POSITION, index: number, component: Component) {}\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: false,\n rotatable: false,\n properties: [\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0,\n max: 100,\n step: 1\n }\n }\n ],\n help: 'scene/component/polyline'\n}\n\nexport default class Polyline extends Line {\n _fromEnd: any\n _toEnd: any\n\n get pathExtendable() {\n return true\n }\n\n get path() {\n const { from, to } = this.state\n const { path } = this.state\n\n return [\n this.fromEnd?.position || from?.position || path[0],\n ...path.slice(1, -1),\n this.toEnd?.position || to?.position || path[path.length - 1]\n ]\n }\n\n set path(path) {\n const { from, to } = this.state\n\n delete this._fromEnd\n delete this._toEnd\n\n this.set({\n from: {\n ...from,\n position: path[0]\n },\n to: {\n ...to,\n position: path[path.length - 1]\n },\n path\n })\n }\n\n get controls() {\n // 폴리라인에서의 control은 새로운 path를 추가하는 포인트이다.\n var path = this.path\n var controls = []\n\n for (let i = 0; i < path.length - 1; i++) {\n let p1 = path[i]\n let p2 = path[i + 1]\n\n if (i == 0) {\n controls.push({\n x: p1.x,\n y: p1.y,\n handler: controlHandler\n })\n }\n\n controls.push({\n x: (p1.x + p2.x) / 2,\n y: (p1.y + p2.y) / 2,\n handler: controlHandler\n })\n\n if (i == path.length - 2) {\n controls.push({\n x: p2.x,\n y: p2.y,\n handler: controlHandler\n })\n }\n }\n\n return controls\n }\n\n get nature() {\n return NATURE\n }\n}\n\n/* target anchor의 움직임이 반영되지 못하므로, 일단 controls memoize를 제거함. */\n// Component.memoize(Polyline.prototype, 'controls', false)\n\nComponent.register('polyline', Polyline)\n"]}
package/dist/rect.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
2
+ declare const Rect_base: (new (...args: any[]) => {
3
+ findOutletLines(anchorName: string): import("@hatiolab/things-scene").Line[];
4
+ findOutletEnds(anchorName: string): Component[];
5
+ findInletLines(anchorName: string): import("@hatiolab/things-scene").Line[];
6
+ findInletEnds(anchorName: string): Component[];
7
+ }) & typeof Shape;
8
+ export default class Rect extends Rect_base {
9
+ is3dish(): boolean;
10
+ get controls(): {
11
+ x: any;
12
+ y: any;
13
+ handler: {
14
+ ondragmove: (point: import("@hatiolab/things-scene").DIMENSION, index: number, component: Component) => void;
15
+ };
16
+ }[];
17
+ get nature(): ComponentNature;
18
+ }
19
+ export {};
package/dist/rect.js ADDED
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { Component, Connectable, RectPath, Shape } from '@hatiolab/things-scene';
5
+ const NATURE = {
6
+ mutable: false,
7
+ resizable: true,
8
+ rotatable: true,
9
+ properties: [
10
+ {
11
+ type: 'number',
12
+ label: 'round',
13
+ name: 'round',
14
+ property: {
15
+ min: 0
16
+ }
17
+ }
18
+ ],
19
+ help: 'scene/component/rect'
20
+ };
21
+ var controlHandler = {
22
+ ondragmove: function (point, index, component) {
23
+ var { left, top, width, height } = component.model;
24
+ var transcoorded = component.transcoordP2S(point.x, point.y);
25
+ var round = ((transcoorded.x - left) / (width / 2)) * 100;
26
+ round = safeRound(round, width, height);
27
+ component.set({
28
+ round
29
+ });
30
+ }
31
+ };
32
+ function safeRound(round, width, height) {
33
+ var max = width > height ? (height / width) * 100 : 100;
34
+ if (round >= max)
35
+ round = max;
36
+ else if (round <= 0)
37
+ round = 0;
38
+ return round;
39
+ }
40
+ export default class Rect extends Connectable(RectPath(Shape)) {
41
+ is3dish() {
42
+ return true;
43
+ }
44
+ get controls() {
45
+ var { left, top, width, round, height } = this.state;
46
+ round = round == undefined ? 0 : safeRound(round, width, height);
47
+ return [
48
+ {
49
+ x: left + (width / 2) * (round / 100),
50
+ y: top,
51
+ handler: controlHandler
52
+ }
53
+ ];
54
+ }
55
+ get nature() {
56
+ return NATURE;
57
+ }
58
+ }
59
+ Component.register('rect', Rect);
60
+ //# sourceMappingURL=rect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rect.js","sourceRoot":"","sources":["../src/rect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAmB,WAAW,EAAwB,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEvH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,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,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QACpD,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAEhE,OAAO;YACL;gBACE,CAAC,EAAE,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC;gBACrC,CAAC,EAAE,GAAG;gBACN,OAAO,EAAE,cAAc;aACxB;SACF,CAAA;IACH,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ComponentNature, Connectable, POSITION, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0\n }\n }\n ],\n help: 'scene/component/rect'\n}\n\nvar controlHandler = {\n ondragmove: function (point: POSITION, index: number, component: Component) {\n var { left, top, width, height } = component.model\n\n var transcoorded = component.transcoordP2S(point.x, point.y)\n var round = ((transcoorded.x - left) / (width / 2)) * 100\n\n round = safeRound(round, width, height)\n\n component.set({\n round\n })\n }\n}\n\nfunction safeRound(round: number, width: number, height: number) {\n var max = width > height ? (height / width) * 100 : 100\n\n if (round >= max) round = max\n else if (round <= 0) round = 0\n\n return round\n}\n\nexport default class Rect extends Connectable(RectPath(Shape)) {\n is3dish() {\n return true\n }\n\n get controls() {\n var { left, top, width, round, height } = this.state\n round = round == undefined ? 0 : safeRound(round, width, height)\n\n return [\n {\n x: left + (width / 2) * (round / 100),\n y: top,\n handler: controlHandler\n }\n ]\n }\n\n get nature() {\n return NATURE\n }\n}\n\nComponent.register('rect', Rect)\n"]}
package/dist/star.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { Component, ComponentNature, Ellipse } from '@hatiolab/things-scene';
2
+ export default class Star extends Ellipse {
3
+ is3dish(): boolean;
4
+ render(ctx: CanvasRenderingContext2D): void;
5
+ get controls(): {
6
+ x: any;
7
+ y: number;
8
+ handler: {
9
+ ondragmove: (point: import("@hatiolab/things-scene").DIMENSION, index: number, component: Component) => void;
10
+ };
11
+ }[];
12
+ get nature(): ComponentNature;
13
+ }
package/dist/star.js ADDED
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { Component, Ellipse } from '@hatiolab/things-scene';
5
+ const NATURE = {
6
+ mutable: false,
7
+ resizable: true,
8
+ rotatable: true,
9
+ properties: [
10
+ {
11
+ type: 'number',
12
+ label: 'ratio',
13
+ name: 'ratio',
14
+ property: 'ratio'
15
+ },
16
+ {
17
+ type: 'number',
18
+ label: 'wing',
19
+ name: 'wing',
20
+ property: 'wing'
21
+ }
22
+ ],
23
+ help: 'scene/component/star'
24
+ };
25
+ var controlHandler = {
26
+ ondragmove: function (point, index, component) {
27
+ var controls = component.controls;
28
+ var { cy, ry } = component.model;
29
+ var transcoorded = component.transcoordP2S(point.x, point.y);
30
+ var ratio = ((transcoorded.y - cy) / ry) * 100 + 100;
31
+ if (ratio >= 100)
32
+ ratio = 100;
33
+ else if (ratio <= 0)
34
+ ratio = 0;
35
+ component.set({ ratio }); // ratio: ratio => ratio
36
+ }
37
+ };
38
+ export default class Star extends Ellipse {
39
+ is3dish() {
40
+ return false;
41
+ }
42
+ render(ctx) {
43
+ var { ratio = 30, wing = 5, cx, cy, rx, ry, startAngle, endAngle, anticlockwise } = this.state;
44
+ // 박스 그리기
45
+ if (wing < 3)
46
+ return;
47
+ const RADIAN = 1.5707963267948966; // 90도 뒤틀기
48
+ var a = (Math.PI * 2) / wing;
49
+ var xRatio = rx - (ratio / 100) * rx;
50
+ var yRatio = ry - (ratio / 100) * ry;
51
+ ctx.save();
52
+ ctx.beginPath();
53
+ ctx.translate(cx, cy);
54
+ ctx.moveTo(rx * Math.cos(-RADIAN), ry * Math.sin(-RADIAN));
55
+ ctx.lineTo(((rx - xRatio) * (Math.cos(a - RADIAN) + Math.cos(0 - RADIAN))) / 2, ((ry - yRatio) * (Math.sin(a - RADIAN) + Math.sin(0 - RADIAN))) / 2);
56
+ for (var i = 1; i < wing; i++) {
57
+ ctx.lineTo(rx * Math.cos(a * i - RADIAN), ry * Math.sin(a * i - RADIAN));
58
+ ctx.lineTo(((rx - xRatio) * (Math.cos(a * (i + 1) - RADIAN) + Math.cos(a * i - RADIAN))) / 2, ((ry - yRatio) * (Math.sin(a * (i + 1) - RADIAN) + Math.sin(a * i - RADIAN))) / 2);
59
+ }
60
+ // ratio /= 1.5;
61
+ ctx.closePath();
62
+ ctx.restore();
63
+ }
64
+ get controls() {
65
+ var { cx, cy, ry, ratio } = this.state;
66
+ return [
67
+ {
68
+ x: cx,
69
+ y: cy - ry + ry * (ratio / 100),
70
+ handler: controlHandler
71
+ }
72
+ ];
73
+ }
74
+ get nature() {
75
+ return NATURE;
76
+ }
77
+ }
78
+ Component.memoize(Star.prototype, 'controls', false);
79
+ Component.register('star', Star);
80
+ //# sourceMappingURL=star.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"star.js","sourceRoot":"","sources":["../src/star.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAmB,OAAO,EAAY,MAAM,wBAAwB,CAAA;AAEtF,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,OAAO;SAClB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb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CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EACjF,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAClF,CAAA;SACF;QACD,gBAAgB;QAChB,GAAG,CAAC,SAAS,EAAE,CAAA;QACf,GAAG,CAAC,OAAO,EAAE,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEtC,OAAO;YACL;gBACE,CAAC,EAAE,EAAE;gBACL,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC;gBAC/B,OAAO,EAAE,cAAc;aACxB;SACF,CAAA;IACH,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAEpD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ComponentNature, Ellipse, POSITION } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'ratio',\n name: 'ratio',\n property: 'ratio'\n },\n {\n type: 'number',\n label: 'wing',\n name: 'wing',\n property: 'wing'\n }\n ],\n help: 'scene/component/star'\n}\n\nvar controlHandler = {\n ondragmove: function (point: POSITION, index: number, component: Component) {\n var controls = component.controls\n var { cy, ry } = component.model\n\n var transcoorded = component.transcoordP2S(point.x, point.y)\n\n var ratio = ((transcoorded.y - cy) / ry) * 100 + 100\n\n if (ratio >= 100) ratio = 100\n else if (ratio <= 0) ratio = 0\n\n component.set({ ratio }) // ratio: ratio => ratio\n }\n}\n\nexport default class Star extends Ellipse {\n is3dish() {\n return false\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { ratio = 30, wing = 5, cx, cy, rx, ry, startAngle, endAngle, anticlockwise } = this.state\n\n // 박스 그리기\n\n if (wing < 3) return\n\n const RADIAN = 1.5707963267948966 // 90도 뒤틀기\n var a = (Math.PI * 2) / wing\n var xRatio = rx - (ratio / 100) * rx\n var yRatio = ry - (ratio / 100) * ry\n\n ctx.save()\n ctx.beginPath()\n\n ctx.translate(cx, cy)\n\n ctx.moveTo(rx * Math.cos(-RADIAN), ry * Math.sin(-RADIAN))\n ctx.lineTo(\n ((rx - xRatio) * (Math.cos(a - RADIAN) + Math.cos(0 - RADIAN))) / 2,\n ((ry - yRatio) * (Math.sin(a - RADIAN) + Math.sin(0 - RADIAN))) / 2\n )\n\n for (var i = 1; i < wing; i++) {\n ctx.lineTo(rx * Math.cos(a * i - RADIAN), ry * Math.sin(a * i - RADIAN))\n\n ctx.lineTo(\n ((rx - xRatio) * (Math.cos(a * (i + 1) - RADIAN) + Math.cos(a * i - RADIAN))) / 2,\n ((ry - yRatio) * (Math.sin(a * (i + 1) - RADIAN) + Math.sin(a * i - RADIAN))) / 2\n )\n }\n // ratio /= 1.5;\n ctx.closePath()\n ctx.restore()\n }\n\n get controls() {\n var { cx, cy, ry, ratio } = this.state\n\n return [\n {\n x: cx,\n y: cy - ry + ry * (ratio / 100),\n handler: controlHandler\n }\n ]\n }\n\n get nature() {\n return NATURE\n }\n}\n\nComponent.memoize(Star.prototype, 'controls', false)\n\nComponent.register('star', Star)\n"]}
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,15 @@
1
+ const audio = new URL('../../icons/audio.png', import.meta.url).href;
2
+ export default {
3
+ type: 'audio',
4
+ description: 'audio',
5
+ icon: audio,
6
+ group: 'textAndMedia',
7
+ model: {
8
+ type: 'audio',
9
+ left: 100,
10
+ top: 100,
11
+ width: 100,
12
+ height: 100
13
+ }
14
+ };
15
+ //# sourceMappingURL=audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/templates/audio.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEpE,eAAe;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;KACZ;CACF,CAAA","sourcesContent":["const audio = new URL('../../icons/audio.png', import.meta.url).href\n\nexport default {\n type: 'audio',\n description: 'audio',\n icon: audio,\n group: 'textAndMedia',\n model: {\n type: 'audio',\n left: 100,\n top: 100,\n width: 100,\n height: 100\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ isGray: boolean;
13
+ fillStyle: string;
14
+ strokeStyle: string;
15
+ alpha: number;
16
+ hidden: boolean;
17
+ lineWidth: number;
18
+ lineDash: string;
19
+ lineCap: string;
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,23 @@
1
+ const colorImage = new URL('../../icons/color-image.png', import.meta.url).href;
2
+ export default {
3
+ type: 'color image',
4
+ description: 'color image',
5
+ icon: colorImage,
6
+ group: 'textAndMedia',
7
+ model: {
8
+ type: 'image-view',
9
+ left: 100,
10
+ top: 100,
11
+ width: 100,
12
+ height: 100,
13
+ isGray: false,
14
+ fillStyle: '#fff',
15
+ strokeStyle: '#000',
16
+ alpha: 1,
17
+ hidden: false,
18
+ lineWidth: 1,
19
+ lineDash: 'solid',
20
+ lineCap: 'butt'
21
+ }
22
+ };
23
+ //# sourceMappingURL=color-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-image.js","sourceRoot":"","sources":["../../src/templates/color-image.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE/E,eAAe;IACb,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const colorImage = new URL('../../icons/color-image.png', import.meta.url).href\n\nexport default {\n type: 'color image',\n description: 'color image',\n icon: colorImage,\n group: 'textAndMedia',\n model: {\n type: 'image-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n isGray: false,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ rx: number;
9
+ ry: number;
10
+ cx: number;
11
+ cy: number;
12
+ ratio: number;
13
+ fillStyle: string;
14
+ strokeStyle: string;
15
+ alpha: number;
16
+ hidden: boolean;
17
+ lineWidth: number;
18
+ lineDash: string;
19
+ lineCap: string;
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,23 @@
1
+ const donut = new URL('../../icons/donut.png', import.meta.url).href;
2
+ export default {
3
+ type: 'donut',
4
+ description: 'donut shape',
5
+ icon: donut,
6
+ group: 'shape',
7
+ model: {
8
+ type: 'donut',
9
+ rx: 50,
10
+ ry: 50,
11
+ cx: 150,
12
+ cy: 150,
13
+ ratio: 30,
14
+ fillStyle: '#fff',
15
+ strokeStyle: '#000',
16
+ alpha: 1,
17
+ hidden: false,
18
+ lineWidth: 1,
19
+ lineDash: 'solid',
20
+ lineCap: 'butt'
21
+ }
22
+ };
23
+ //# sourceMappingURL=donut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donut.js","sourceRoot":"","sources":["../../src/templates/donut.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEpE,eAAe;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const donut = new URL('../../icons/donut.png', import.meta.url).href\n\nexport default {\n type: 'donut',\n description: 'donut shape',\n icon: donut,\n group: 'shape',\n model: {\n type: 'donut',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n ratio: 30,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ rx: number;
9
+ ry: number;
10
+ cx: number;
11
+ cy: number;
12
+ fillStyle: string;
13
+ strokeStyle: string;
14
+ alpha: number;
15
+ hidden: boolean;
16
+ lineWidth: number;
17
+ lineDash: string;
18
+ lineCap: string;
19
+ };
20
+ };
21
+ export default _default;
@@ -0,0 +1,22 @@
1
+ const ellipse = new URL('../../icons/ellipse.png', import.meta.url).href;
2
+ export default {
3
+ type: 'ellipse',
4
+ description: 'ellipse shape',
5
+ icon: ellipse,
6
+ group: 'shape',
7
+ model: {
8
+ type: 'ellipse',
9
+ rx: 50,
10
+ ry: 50,
11
+ cx: 150,
12
+ cy: 150,
13
+ fillStyle: '#fff',
14
+ strokeStyle: '#000',
15
+ alpha: 1,
16
+ hidden: false,
17
+ lineWidth: 1,
18
+ lineDash: 'solid',
19
+ lineCap: 'butt'
20
+ }
21
+ };
22
+ //# sourceMappingURL=ellipse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ellipse.js","sourceRoot":"","sources":["../../src/templates/ellipse.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAExE,eAAe;IACb,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,eAAe;IAC5B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const ellipse = new URL('../../icons/ellipse.png', import.meta.url).href\n\nexport default {\n type: 'ellipse',\n description: 'ellipse shape',\n icon: ellipse,\n group: 'shape',\n model: {\n type: 'ellipse',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,15 @@
1
+ const gifImage = new URL('../../icons/gif-image.png', import.meta.url).href;
2
+ export default {
3
+ type: 'gif image',
4
+ description: 'gif image',
5
+ icon: gifImage,
6
+ group: 'textAndMedia',
7
+ model: {
8
+ type: 'gif-view',
9
+ left: 100,
10
+ top: 100,
11
+ width: 100,
12
+ height: 100
13
+ }
14
+ };
15
+ //# sourceMappingURL=gif-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gif-image.js","sourceRoot":"","sources":["../../src/templates/gif-image.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE3E,eAAe;IACb,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;KACZ;CACF,CAAA","sourcesContent":["const gifImage = new URL('../../icons/gif-image.png', import.meta.url).href\n\nexport default {\n type: 'gif image',\n description: 'gif image',\n icon: gifImage,\n group: 'textAndMedia',\n model: {\n type: 'gif-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ icon: string;
5
+ group: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ isGray: boolean;
13
+ fillStyle: string;
14
+ strokeStyle: string;
15
+ alpha: number;
16
+ hidden: boolean;
17
+ lineWidth: number;
18
+ lineDash: string;
19
+ lineCap: string;
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,23 @@
1
+ const grayImage = new URL('../../icons/gray-image.png', import.meta.url).href;
2
+ export default {
3
+ type: 'gray image',
4
+ description: 'gray image',
5
+ icon: grayImage,
6
+ group: 'textAndMedia',
7
+ model: {
8
+ type: 'image-view',
9
+ left: 100,
10
+ top: 100,
11
+ width: 100,
12
+ height: 100,
13
+ isGray: true,
14
+ fillStyle: '#fff',
15
+ strokeStyle: '#000',
16
+ alpha: 1,
17
+ hidden: false,
18
+ lineWidth: 1,
19
+ lineDash: 'solid',
20
+ lineCap: 'butt'
21
+ }
22
+ };
23
+ //# sourceMappingURL=gray-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gray-image.js","sourceRoot":"","sources":["../../src/templates/gray-image.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE7E,eAAe;IACb,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const grayImage = new URL('../../icons/gray-image.png', import.meta.url).href\n\nexport default {\n type: 'gray image',\n description: 'gray image',\n icon: grayImage,\n group: 'textAndMedia',\n model: {\n type: 'image-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n isGray: true,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}