@yanqirenshi/d3.wireframe 0.2.0 → 0.2.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018-2026 Satoshi Iwasaki (yanqirenshi@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.markdown CHANGED
@@ -1,68 +1,68 @@
1
- # D3.Wireframe
2
-
3
- ワイヤーフレームをスケッチするためのライブラリです。
4
-
5
- # Expression
6
-
7
- 以下の要素を描画できます。
8
-
9
- | Element | element_type | type |
10
- |-----------------|----------------|------|
11
- | label | label | 1 |
12
- | button | button | 2 |
13
- | Frame(Plain) | frame | 2 |
14
- | Frame(Diagonal) | frame_diagonal | 2 |
15
- | input[text] | input_text | 2 |
16
- | input[radio] | input_radio | 3 |
17
- | input[checkbox] | input_checkbox | 3 |
18
- | tabs | tabs | 3 |
19
- | table | table | 3 |
20
-
21
- ## Data
22
-
23
- 描画するためのデータは三種類あります。
24
-
25
- ### Type 1
26
-
27
- ```
28
- {
29
- text: '',
30
- position: { x:0, y:0, z:0 },
31
- font: { size: '11px', bold: true }
32
- },
33
- ```
34
-
35
- ### Type 2
36
-
37
- ```
38
- {
39
- element_type: 'frame',
40
- rectangle: { w: 0, h: 0 },
41
- position: { x:0, y:0, z:0 },
42
- labels: [@type1...],
43
- children: [],
44
- },
45
- ```
46
-
47
- ### Type 3
48
-
49
- ```
50
- {
51
- element_type: '...',
52
- rectangle: { w: 0, h: 0 },
53
- position: { x:0, y:0, z:0 },
54
- labels: [@type1...],
55
- },
56
- ```
57
-
58
- # Authors
59
-
60
- + Satoshi Iwasaki (yanqirenshi@gmail.com)
61
-
62
- # Copyright
63
-
64
- Copyright (c) 2018 Satoshi Iwasaki (yanqirenshi@gmail.com)
65
-
66
- # Licence
67
-
68
- This software is released under the GNU GENERAL PUBLIC LICENSE Version 3, see [LICENSE](http://www.gnu.org/licenses/gpl-3.0.txt).
1
+ # D3.Wireframe
2
+
3
+ ワイヤーフレームをスケッチするためのライブラリです。
4
+
5
+ # Expression
6
+
7
+ 以下の要素を描画できます。
8
+
9
+ | Element | element_type | type |
10
+ |-----------------|----------------|------|
11
+ | label | label | 1 |
12
+ | button | button | 2 |
13
+ | Frame(Plain) | frame | 2 |
14
+ | Frame(Diagonal) | frame_diagonal | 2 |
15
+ | input[text] | input_text | 2 |
16
+ | input[radio] | input_radio | 3 |
17
+ | input[checkbox] | input_checkbox | 3 |
18
+ | tabs | tabs | 3 |
19
+ | table | table | 3 |
20
+
21
+ ## Data
22
+
23
+ 描画するためのデータは三種類あります。
24
+
25
+ ### Type 1
26
+
27
+ ```
28
+ {
29
+ text: '',
30
+ position: { x:0, y:0, z:0 },
31
+ font: { size: '11px', bold: true }
32
+ },
33
+ ```
34
+
35
+ ### Type 2
36
+
37
+ ```
38
+ {
39
+ element_type: 'frame',
40
+ rectangle: { w: 0, h: 0 },
41
+ position: { x:0, y:0, z:0 },
42
+ labels: [@type1...],
43
+ children: [],
44
+ },
45
+ ```
46
+
47
+ ### Type 3
48
+
49
+ ```
50
+ {
51
+ element_type: '...',
52
+ rectangle: { w: 0, h: 0 },
53
+ position: { x:0, y:0, z:0 },
54
+ labels: [@type1...],
55
+ },
56
+ ```
57
+
58
+ # Author
59
+
60
+ Satoshi Iwasaki (yanqirenshi@gmail.com)
61
+
62
+ # Copyright
63
+
64
+ Copyright (c) 2018-2026 Satoshi Iwasaki (yanqirenshi@gmail.com)
65
+
66
+ # License
67
+
68
+ Licensed under the MIT License.
package/dist/Digestion.js CHANGED
@@ -21,11 +21,11 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
21
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
23
  // https://yanqirenshi.github.io/D3.Sketch/dist/edge/Drawer.js
24
- /**
25
- * 幾何学計算するための Drawer です。
26
- *
27
- * @example
28
- * let drawer = new DrawerHierarchy();
24
+ /**
25
+ * 幾何学計算するための Drawer です。
26
+ *
27
+ * @example
28
+ * let drawer = new DrawerHierarchy();
29
29
  */
30
30
  var DigestionGeometry = exports.DigestionGeometry = /*#__PURE__*/function () {
31
31
  function DigestionGeometry() {
@@ -101,15 +101,15 @@ var DigestionGeometry = exports.DigestionGeometry = /*#__PURE__*/function () {
101
101
  }
102
102
  }]);
103
103
  }();
104
- /**
105
- * Drawer の共通要素とての Core です。
106
- * 各 Drawer の要素を整えるメッソッドをまとめているクラスです。
107
- * いろいろと共通なものがあると思うので。
108
- * また見通しも良くなるかと。
109
- * 作る必要があるのかはアレですが。。。
110
- *
111
- * @example
112
- * let drawer = new DrawerHierarchy();
104
+ /**
105
+ * Drawer の共通要素とての Core です。
106
+ * 各 Drawer の要素を整えるメッソッドをまとめているクラスです。
107
+ * いろいろと共通なものがあると思うので。
108
+ * また見通しも良くなるかと。
109
+ * 作る必要があるのかはアレですが。。。
110
+ *
111
+ * @example
112
+ * let drawer = new DrawerHierarchy();
113
113
  */
114
114
  var DigestionCore = exports.DigestionCore = /*#__PURE__*/function () {
115
115
  function DigestionCore() {
@@ -212,12 +212,12 @@ var DigestionCore = exports.DigestionCore = /*#__PURE__*/function () {
212
212
  }
213
213
  }]);
214
214
  }();
215
- /**
216
- * 階層構造のデータの Drawer です。
217
- * Data の 位置、サイズ を整えます。
218
- *
219
- * @example
220
- * let drawer = new DrawerHierarchy();
215
+ /**
216
+ * 階層構造のデータの Drawer です。
217
+ * Data の 位置、サイズ を整えます。
218
+ *
219
+ * @example
220
+ * let drawer = new DrawerHierarchy();
221
221
  */
222
222
  var DigestionHierarchy = exports.DigestionHierarchy = /*#__PURE__*/function (_DigestionCore) {
223
223
  function DigestionHierarchy() {
package/dist/Drawer.js CHANGED
@@ -21,11 +21,11 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
21
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
23
  // https://yanqirenshi.github.io/D3.Sketch/dist/edge/Drawer.js
24
- /**
25
- * 幾何学計算するための Drawer です。
26
- *
27
- * @example
28
- * let drawer = new DrawerHierarchy();
24
+ /**
25
+ * 幾何学計算するための Drawer です。
26
+ *
27
+ * @example
28
+ * let drawer = new DrawerHierarchy();
29
29
  */
30
30
  var DrawerGeometry = exports.DrawerGeometry = /*#__PURE__*/function () {
31
31
  function DrawerGeometry() {
@@ -101,15 +101,15 @@ var DrawerGeometry = exports.DrawerGeometry = /*#__PURE__*/function () {
101
101
  }
102
102
  }]);
103
103
  }();
104
- /**
105
- * Drawer の共通要素とての Core です。
106
- * 各 Drawer の要素を整えるメッソッドをまとめているクラスです。
107
- * いろいろと共通なものがあると思うので。
108
- * また見通しも良くなるかと。
109
- * 作る必要があるのかはアレですが。。。
110
- *
111
- * @example
112
- * let drawer = new DrawerHierarchy();
104
+ /**
105
+ * Drawer の共通要素とての Core です。
106
+ * 各 Drawer の要素を整えるメッソッドをまとめているクラスです。
107
+ * いろいろと共通なものがあると思うので。
108
+ * また見通しも良くなるかと。
109
+ * 作る必要があるのかはアレですが。。。
110
+ *
111
+ * @example
112
+ * let drawer = new DrawerHierarchy();
113
113
  */
114
114
  var Drawer = exports.Drawer = /*#__PURE__*/function () {
115
115
  function Drawer() {
@@ -212,12 +212,12 @@ var Drawer = exports.Drawer = /*#__PURE__*/function () {
212
212
  }
213
213
  }]);
214
214
  }();
215
- /**
216
- * 階層構造のデータの Drawer です。
217
- * Data の 位置、サイズ を整えます。
218
- *
219
- * @example
220
- * let drawer = new DrawerHierarchy();
215
+ /**
216
+ * 階層構造のデータの Drawer です。
217
+ * Data の 位置、サイズ を整えます。
218
+ *
219
+ * @example
220
+ * let drawer = new DrawerHierarchy();
221
221
  */
222
222
  var DrawerHierarchy = exports.DrawerHierarchy = /*#__PURE__*/function (_Drawer) {
223
223
  function DrawerHierarchy() {
package/dist/Element.js CHANGED
@@ -42,8 +42,8 @@ var Element = exports["default"] = /*#__PURE__*/function () {
42
42
  }, {
43
43
  key: "elementClass",
44
44
  value:
45
- /* **************************************************************** *
46
- * Element Class
45
+ /* **************************************************************** *
46
+ * Element Class
47
47
  * **************************************************************** */
48
48
  function elementClass(data) {
49
49
  var element_type = data.element_type;
@@ -51,8 +51,8 @@ var Element = exports["default"] = /*#__PURE__*/function () {
51
51
  if (!element_class) throw new Error('Not supported yet. element_type=' + element_type);
52
52
  return element_class;
53
53
  }
54
- /* **************************************************************** *
55
- * Element Class
54
+ /* **************************************************************** *
55
+ * Element Class
56
56
  * **************************************************************** */
57
57
  }, {
58
58
  key: "makeElement",
@@ -74,8 +74,8 @@ var Element = exports["default"] = /*#__PURE__*/function () {
74
74
  var element_class = this.elementClass(core);
75
75
  return element_class.merge(core, element);
76
76
  }
77
- /* **************************************************************** *
78
- * Draw
77
+ /* **************************************************************** *
78
+ * Draw
79
79
  * **************************************************************** */
80
80
  }, {
81
81
  key: "draw",
@@ -35,8 +35,8 @@ var ElementButton = exports["default"] = /*#__PURE__*/function (_ElementFounder)
35
35
  });
36
36
  return _this;
37
37
  }
38
- /* **************************************************************** *
39
- * Data
38
+ /* **************************************************************** *
39
+ * Data
40
40
  * **************************************************************** */
41
41
  _inherits(ElementButton, _ElementFounder);
42
42
  return _createClass(ElementButton, [{
@@ -73,8 +73,8 @@ var ElementButton = exports["default"] = /*#__PURE__*/function (_ElementFounder)
73
73
  element._core = core;
74
74
  core._element = element;
75
75
  }
76
- /* **************************************************************** *
77
- * Draw
76
+ /* **************************************************************** *
77
+ * Draw
78
78
  * **************************************************************** */
79
79
  }, {
80
80
  key: "drawAdd",
@@ -30,8 +30,8 @@ var ElementDialog = exports["default"] = /*#__PURE__*/function (_ElementFounder)
30
30
  });
31
31
  return _this;
32
32
  }
33
- /* **************************************************************** *
34
- * Data
33
+ /* **************************************************************** *
34
+ * Data
35
35
  * **************************************************************** */
36
36
  _inherits(ElementDialog, _ElementFounder);
37
37
  return _createClass(ElementDialog, [{
@@ -58,8 +58,8 @@ var ElementDialog = exports["default"] = /*#__PURE__*/function (_ElementFounder)
58
58
  element.labels = this.label.makeElements(core.labels);
59
59
  return element;
60
60
  }
61
- /* **************************************************************** *
62
- * Draw
61
+ /* **************************************************************** *
62
+ * Draw
63
63
  * **************************************************************** */
64
64
  }, {
65
65
  key: "drawAdd",
@@ -25,8 +25,8 @@ var ElementFounder = exports["default"] = /*#__PURE__*/function () {
25
25
  this.name = name;
26
26
  this.idm = params.idm;
27
27
  }
28
- /* **************************************************************** *
29
- * Data
28
+ /* **************************************************************** *
29
+ * Data
30
30
  * **************************************************************** */
31
31
  return _createClass(ElementFounder, [{
32
32
  key: "makeTemplateElement",
@@ -95,12 +95,12 @@ var ElementFounder = exports["default"] = /*#__PURE__*/function () {
95
95
  }, {
96
96
  key: "merge",
97
97
  value: function merge(core, element) {}
98
- /* **************************************************************** *
99
- * Draw
98
+ /* **************************************************************** *
99
+ * Draw
100
100
  * **************************************************************** */
101
- /**
102
- * グループの transform。回転ビュー(projector あり)では絶対座標を
103
- * 射影して描くため translate は使わない。
101
+ /**
102
+ * グループの transform。回転ビュー(projector あり)では絶対座標を
103
+ * 射影して描くため translate は使わない。
104
104
  */
105
105
  }, {
106
106
  key: "groupTransform",
@@ -108,11 +108,11 @@ var ElementFounder = exports["default"] = /*#__PURE__*/function () {
108
108
  if (projector) return null;
109
109
  return "translate(".concat(d.position.x, ", ").concat(d.position.y, ")");
110
110
  }
111
- /**
112
- * 要素の下地(base)を描く。通常はグループ局所座標の rect、
113
- * 回転ビューでは絶対座標の4頂点を射影した polygon(角丸 round は
114
- * 回転ビューでは省略される)。fill/stroke は共通で適用し、
115
- * 追加の属性は返り値の selection に呼び出し側で付ける。
111
+ /**
112
+ * 要素の下地(base)を描く。通常はグループ局所座標の rect、
113
+ * 回転ビューでは絶対座標の4頂点を射影した polygon(角丸 round は
114
+ * 回転ビューでは省略される)。fill/stroke は共通で適用し、
115
+ * 追加の属性は返り値の selection に呼び出し側で付ける。
116
116
  */
117
117
  }, {
118
118
  key: "drawBase",
@@ -30,8 +30,8 @@ var ElementFrame = exports["default"] = /*#__PURE__*/function (_ElementFounder)
30
30
  });
31
31
  return _this;
32
32
  }
33
- /* **************************************************************** *
34
- * Data
33
+ /* **************************************************************** *
34
+ * Data
35
35
  * **************************************************************** */
36
36
  _inherits(ElementFrame, _ElementFounder);
37
37
  return _createClass(ElementFrame, [{
@@ -58,8 +58,8 @@ var ElementFrame = exports["default"] = /*#__PURE__*/function (_ElementFounder)
58
58
  element.labels = this.label.makeElements(core.labels);
59
59
  return element;
60
60
  }
61
- /* **************************************************************** *
62
- * Draw
61
+ /* **************************************************************** *
62
+ * Draw
63
63
  * **************************************************************** */
64
64
  }, {
65
65
  key: "drawAdd",
@@ -27,8 +27,8 @@ var ElementIcon = exports["default"] = /*#__PURE__*/function (_ElementFounder) {
27
27
  _this.idm = params.idm;
28
28
  return _this;
29
29
  }
30
- /* **************************************************************** *
31
- * Data
30
+ /* **************************************************************** *
31
+ * Data
32
32
  * **************************************************************** */
33
33
  _inherits(ElementIcon, _ElementFounder);
34
34
  return _createClass(ElementIcon, [{
@@ -59,13 +59,13 @@ var ElementIcon = exports["default"] = /*#__PURE__*/function (_ElementFounder) {
59
59
  return _this2.makeElement(icon, parent);
60
60
  });
61
61
  }
62
- /* **************************************************************** *
63
- * Draw
62
+ /* **************************************************************** *
63
+ * Draw
64
64
  * **************************************************************** */
65
- /**
66
- * アイコン(画像)を描く。SVG の <image> は polygon 化できないため、
67
- * 回転ビュー(projector あり)では要素の3隅を正確に写す近似 affine
68
- * 行列で変形する(アイコンは小さいので誤差は実用上見えない)。
65
+ /**
66
+ * アイコン(画像)を描く。SVG の <image> は polygon 化できないため、
67
+ * 回転ビュー(projector あり)では要素の3隅を正確に写す近似 affine
68
+ * 行列で変形する(アイコンは小さいので誤差は実用上見えない)。
69
69
  */
70
70
  }, {
71
71
  key: "draw",
@@ -30,8 +30,8 @@ var ElementImage = exports["default"] = /*#__PURE__*/function (_ElementFounder)
30
30
  });
31
31
  return _this;
32
32
  }
33
- /* **************************************************************** *
34
- * Data
33
+ /* **************************************************************** *
34
+ * Data
35
35
  * **************************************************************** */
36
36
  _inherits(ElementImage, _ElementFounder);
37
37
  return _createClass(ElementImage, [{
@@ -58,8 +58,8 @@ var ElementImage = exports["default"] = /*#__PURE__*/function (_ElementFounder)
58
58
  element.labels = this.label.makeElements(core.labels);
59
59
  return element;
60
60
  }
61
- /* **************************************************************** *
62
- * Draw
61
+ /* **************************************************************** *
62
+ * Draw
63
63
  * **************************************************************** */
64
64
  }, {
65
65
  key: "drawAdd",
@@ -24,8 +24,8 @@ var ElementLabel = exports["default"] = /*#__PURE__*/function (_ElementFounder)
24
24
  _classCallCheck(this, ElementLabel);
25
25
  return _callSuper(this, ElementLabel, ['label', params]);
26
26
  }
27
- /* **************************************************************** *
28
- * Data
27
+ /* **************************************************************** *
28
+ * Data
29
29
  * **************************************************************** */
30
30
  _inherits(ElementLabel, _ElementFounder);
31
31
  return _createClass(ElementLabel, [{
@@ -56,13 +56,13 @@ var ElementLabel = exports["default"] = /*#__PURE__*/function (_ElementFounder)
56
56
  return _this.makeElement(d);
57
57
  });
58
58
  }
59
- /* **************************************************************** *
60
- * Draw
59
+ /* **************************************************************** *
60
+ * Draw
61
61
  * **************************************************************** */
62
- /**
63
- * ラベルを描く。回転ビュー(projector あり)では、親要素の絶対位置 +
64
- * ラベル相対位置を射影した点に置き、フォントサイズは距離スケール(k)で
65
- * 近似する(SVG の文字は遠近で歪ませられないため、位置と大きさのみ)。
62
+ /**
63
+ * ラベルを描く。回転ビュー(projector あり)では、親要素の絶対位置 +
64
+ * ラベル相対位置を射影した点に置き、フォントサイズは距離スケール(k)で
65
+ * 近似する(SVG の文字は遠近で歪ませられないため、位置と大きさのみ)。
66
66
  */
67
67
  }, {
68
68
  key: "draw",
@@ -24,8 +24,8 @@ var ElementModal = exports["default"] = /*#__PURE__*/function (_ElementFounder)
24
24
  _classCallCheck(this, ElementModal);
25
25
  return _callSuper(this, ElementModal, ['modal', params]);
26
26
  }
27
- /* **************************************************************** *
28
- * Data
27
+ /* **************************************************************** *
28
+ * Data
29
29
  * **************************************************************** */
30
30
  _inherits(ElementModal, _ElementFounder);
31
31
  return _createClass(ElementModal, [{
@@ -47,8 +47,8 @@ var ElementModal = exports["default"] = /*#__PURE__*/function (_ElementFounder)
47
47
  this.fittingBackground(element, core);
48
48
  return element;
49
49
  }
50
- /* **************************************************************** *
51
- * Draw
50
+ /* **************************************************************** *
51
+ * Draw
52
52
  * **************************************************************** */
53
53
  }, {
54
54
  key: "drawAdd",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yanqirenshi/d3.wireframe",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Wireframe diagram renderer (frame / image / button / modal / dialog elements)",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -8,7 +8,7 @@
8
8
  "src"
9
9
  ],
10
10
  "scripts": {
11
- "transpile": "babel src -d dist --copy-files",
11
+ "transpile": "babel src -d dist --copy-files --delete-dir-on-start",
12
12
  "prepublishOnly": "npm run transpile",
13
13
  "test": "jest",
14
14
  "test:w": "jest --watch",
@@ -16,14 +16,15 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/yanqirenshi/D3.Wireframe.git"
19
+ "url": "git+https://github.com/Foolsgolds/Assholes.git",
20
+ "directory": "packages/d3.wireframe"
20
21
  },
21
22
  "author": "yanqirenshi <yanqirenshi@gmail.com> (https://github.com/yanqirenshi)",
22
- "license": "ISC",
23
+ "license": "MIT",
23
24
  "bugs": {
24
- "url": "https://github.com/yanqirenshi/D3.Wireframe/issues"
25
+ "url": "https://github.com/Foolsgolds/Assholes/issues"
25
26
  },
26
- "homepage": "https://yanqirenshi.github.io/D3.Wireframe/#home",
27
+ "homepage": "https://github.com/Foolsgolds/Assholes/tree/main/packages/d3.wireframe#readme",
27
28
  "peerDependencies": {
28
29
  "react": "^18.0.0 || ^19.0.0",
29
30
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -1,23 +1,23 @@
1
- class DataBackground {
2
- template () {
3
- return {
4
- color: '#fff',
5
- opacity: 1.0,
6
- };
7
- }
8
- build (data) {
9
- let out = this.template();
10
-
11
- if (!data)
12
- return out;
13
-
14
- if (data.color) out.color = data.color;
15
- if (data.opacity) out.opacity = data.opacity;
16
-
17
- return out;
18
- };
19
- }
20
-
21
- const BACKGROUND = new DataBackground();
22
-
23
- export default BACKGROUND;
1
+ class DataBackground {
2
+ template () {
3
+ return {
4
+ color: '#fff',
5
+ opacity: 1.0,
6
+ };
7
+ }
8
+ build (data) {
9
+ let out = this.template();
10
+
11
+ if (!data)
12
+ return out;
13
+
14
+ if (data.color) out.color = data.color;
15
+ if (data.opacity) out.opacity = data.opacity;
16
+
17
+ return out;
18
+ };
19
+ }
20
+
21
+ const BACKGROUND = new DataBackground();
22
+
23
+ export default BACKGROUND;