@yanqirenshi/d3.wireframe 0.0.7 → 0.1.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/dist/DataBackground.js +37 -0
- package/dist/DataFont.js +39 -0
- package/dist/DataPosition.js +39 -0
- package/dist/DataRectangle.js +37 -0
- package/dist/DataStroke.js +37 -0
- package/dist/Digestion.js +320 -0
- package/dist/Drawer.js +317 -0
- package/dist/Element.js +98 -0
- package/dist/ElementButton.js +128 -0
- package/dist/ElementDialog.js +112 -0
- package/dist/ElementFounder.js +116 -0
- package/dist/ElementFrame.js +112 -0
- package/dist/ElementIcon.js +83 -0
- package/dist/ElementImage.js +112 -0
- package/dist/ElementLabel.js +82 -0
- package/dist/ElementModal.js +93 -0
- package/dist/Rectum.js +161 -0
- package/dist/components/D3Wireframe.js +16 -0
- package/dist/index.js +16 -0
- package/package.json +45 -35
- package/src/{D3Wireframe.js → Rectum.js} +115 -111
- package/src/components/D3Wireframe.js +9 -0
- package/src/index.js +9 -0
- package/babel.config.js +0 -14
- package/docs/asset-manifest.json +0 -23
- package/docs/favicon.ico +0 -0
- package/docs/index.html +0 -1
- package/docs/logo192.png +0 -0
- package/docs/logo512.png +0 -0
- package/docs/manifest.json +0 -25
- package/docs/precache-manifest.5f1fad934ed0507dbc92de6788eff788.js +0 -30
- package/docs/robots.txt +0 -3
- package/docs/service-worker.js +0 -39
- package/docs/static/css/main.5f361e03.chunk.css +0 -2
- package/docs/static/css/main.5f361e03.chunk.css.map +0 -1
- package/docs/static/js/2.e2326255.chunk.js +0 -3
- package/docs/static/js/2.e2326255.chunk.js.LICENSE.txt +0 -32
- package/docs/static/js/2.e2326255.chunk.js.map +0 -1
- package/docs/static/js/main.7f51684e.chunk.js +0 -2
- package/docs/static/js/main.7f51684e.chunk.js.map +0 -1
- package/docs/static/js/runtime-main.0c5b98f9.js +0 -2
- package/docs/static/js/runtime-main.0c5b98f9.js.map +0 -1
- package/docs/static/media/logo.5d5d9eef.svg +0 -7
- package/documents/README.md +0 -68
- package/documents/package-lock.json +0 -13792
- package/documents/package.json +0 -34
- package/documents/public/favicon.ico +0 -0
- package/documents/public/index.html +0 -43
- package/documents/public/logo192.png +0 -0
- package/documents/public/logo512.png +0 -0
- package/documents/public/manifest.json +0 -25
- package/documents/public/robots.txt +0 -3
- package/documents/src/App.css +0 -38
- package/documents/src/App.js +0 -26
- package/documents/src/App.test.js +0 -9
- package/documents/src/index.css +0 -13
- package/documents/src/index.js +0 -17
- package/documents/src/logo.svg +0 -7
- package/documents/src/serviceWorker.js +0 -141
- package/documents/src/setupTests.js +0 -5
- package/example/README.md +0 -68
- package/example/package-lock.json +0 -14729
- package/example/package.json +0 -36
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +0 -43
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +0 -25
- package/example/public/robots.txt +0 -3
- package/example/src/App.css +0 -38
- package/example/src/App.js +0 -14
- package/example/src/App.test.js +0 -9
- package/example/src/data/WIREFRAME_DATA.js +0 -11
- package/example/src/data/WIREFRAME_DATA_DIALOG.js +0 -65
- package/example/src/data/WIREFRAME_DATA_FRAME.js +0 -70
- package/example/src/data/WIREFRAME_DATA_MODAL.js +0 -10
- package/example/src/index.css +0 -13
- package/example/src/index.js +0 -17
- package/example/src/js/D3Wireframe.js +0 -111
- package/example/src/js/DataBackground.js +0 -23
- package/example/src/js/DataFont.js +0 -25
- package/example/src/js/DataPosition.js +0 -21
- package/example/src/js/DataRectangle.js +0 -20
- package/example/src/js/DataStroke.js +0 -23
- package/example/src/js/Digestion.js +0 -273
- package/example/src/js/Drawer.js +0 -270
- package/example/src/js/Element.js +0 -67
- package/example/src/js/ElementButton.js +0 -94
- package/example/src/js/ElementDialog.js +0 -77
- package/example/src/js/ElementFounder.js +0 -85
- package/example/src/js/ElementFrame.js +0 -77
- package/example/src/js/ElementIcon.js +0 -56
- package/example/src/js/ElementImage.js +0 -77
- package/example/src/js/ElementLabel.js +0 -51
- package/example/src/js/ElementModal.js +0 -65
- package/example/src/pages/ExampleGraph.js +0 -39
- package/example/src/pages/Explanation.js +0 -43
- package/example/src/pages/PageExample.js +0 -41
- package/example/src/serviceWorker.js +0 -141
- package/example/src/setupTests.js +0 -5
- package/index.js +0 -3
- package/jest.config.js +0 -17
- package/riot.v3/index.html +0 -21
- package/riot.v3/index.js +0 -86
- package/riot.v3/scketch.js +0 -96
- package/riot.v3/wireframe.js +0 -11
- package/tests/D3Wireframe.test.js +0 -7
package/dist/Rectum.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _assh0le = require("@yanqirenshi/assh0le");
|
|
9
|
+
var _Element = _interopRequireDefault(require("./Element"));
|
|
10
|
+
var _Drawer = require("./Drawer.js");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); }
|
|
20
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
21
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
22
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
25
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
26
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
27
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
28
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
29
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
|
+
/**
|
|
31
|
+
* データクラス。ワイヤーフレーム要素の構築・マージ・保持を行い、
|
|
32
|
+
* 描画は Element(各 Element クラス)へ委譲する。
|
|
33
|
+
*
|
|
34
|
+
* 旧 D3Wireframe(assh0le 0.0.3 の Asshole クラス継承)を
|
|
35
|
+
* 現行アーキテクチャ(Colon 継承 + React ラッパ)へ移行したもの。
|
|
36
|
+
*/
|
|
37
|
+
var Rectum = exports["default"] = /*#__PURE__*/function (_Colon) {
|
|
38
|
+
function Rectum(params) {
|
|
39
|
+
var _this;
|
|
40
|
+
_classCallCheck(this, Rectum);
|
|
41
|
+
_this = _callSuper(this, Rectum, [params]);
|
|
42
|
+
_this.element = new _Element["default"]();
|
|
43
|
+
_this._elements = {
|
|
44
|
+
ht: {},
|
|
45
|
+
list: []
|
|
46
|
+
};
|
|
47
|
+
return _this;
|
|
48
|
+
}
|
|
49
|
+
/* **************************************************************** *
|
|
50
|
+
* Make Elements
|
|
51
|
+
* **************************************************************** */
|
|
52
|
+
_inherits(Rectum, _Colon);
|
|
53
|
+
return _createClass(Rectum, [{
|
|
54
|
+
key: "firstObject",
|
|
55
|
+
value: function firstObject(list) {
|
|
56
|
+
if (list.length === 0) return null;
|
|
57
|
+
return list[0];
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "merge",
|
|
61
|
+
value: function merge(source, target) {
|
|
62
|
+
var source_sorted = source.sort(function (a, b) {
|
|
63
|
+
return a.id < b.id ? -1 : 1;
|
|
64
|
+
});
|
|
65
|
+
var target_sorted = target.sort(function (a, b) {
|
|
66
|
+
return a._core.id < b._core.id ? -1 : 1;
|
|
67
|
+
});
|
|
68
|
+
var out = [];
|
|
69
|
+
while (source_sorted.length > 0 || target_sorted.length > 0) {
|
|
70
|
+
var src = this.firstObject(source_sorted);
|
|
71
|
+
var trg = this.firstObject(target_sorted);
|
|
72
|
+
if (trg === null) {
|
|
73
|
+
// source にしか無いケース
|
|
74
|
+
if (src.visible !== false) out.push(this.element.makeElement(src));
|
|
75
|
+
source_sorted.shift();
|
|
76
|
+
} else if (src === null) {
|
|
77
|
+
// target にしか無いやつは削除する。
|
|
78
|
+
target_sorted.shift();
|
|
79
|
+
} else if (src.id === trg._core.id) {
|
|
80
|
+
out.push(this.element.mergeCore(src, trg));
|
|
81
|
+
source_sorted.shift();
|
|
82
|
+
target_sorted.shift();
|
|
83
|
+
} else if (src.id < trg._core.id) {
|
|
84
|
+
// source にしか無いケース
|
|
85
|
+
out.push(this.element.makeElement(src));
|
|
86
|
+
source_sorted.shift();
|
|
87
|
+
} else {
|
|
88
|
+
// target にしか無いやつは削除する。
|
|
89
|
+
target_sorted.shift();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "makeElements",
|
|
96
|
+
value: function makeElements(list) {
|
|
97
|
+
var new_list = this.merge(list, this._elements.list);
|
|
98
|
+
var pool = {
|
|
99
|
+
ht: {},
|
|
100
|
+
list: []
|
|
101
|
+
};
|
|
102
|
+
var dh = new _Drawer.DrawerHierarchy();
|
|
103
|
+
var _iterator = _createForOfIteratorHelper(new_list),
|
|
104
|
+
_step;
|
|
105
|
+
try {
|
|
106
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
107
|
+
var d = _step.value;
|
|
108
|
+
dh.fitting(d);
|
|
109
|
+
pool.ht[d._id] = d;
|
|
110
|
+
pool.list.push(d);
|
|
111
|
+
}
|
|
112
|
+
} catch (err) {
|
|
113
|
+
_iterator.e(err);
|
|
114
|
+
} finally {
|
|
115
|
+
_iterator.f();
|
|
116
|
+
}
|
|
117
|
+
return pool;
|
|
118
|
+
}
|
|
119
|
+
/* **************************************************************** *
|
|
120
|
+
* Draw
|
|
121
|
+
* **************************************************************** */
|
|
122
|
+
}, {
|
|
123
|
+
key: "flatten",
|
|
124
|
+
value: function flatten(data) {
|
|
125
|
+
var out = [];
|
|
126
|
+
var _iterator2 = _createForOfIteratorHelper(data),
|
|
127
|
+
_step2;
|
|
128
|
+
try {
|
|
129
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
130
|
+
var d = _step2.value;
|
|
131
|
+
out.push(d);
|
|
132
|
+
if (d.children.length === 0) continue;
|
|
133
|
+
out = out.concat(this.flatten(d.children));
|
|
134
|
+
}
|
|
135
|
+
} catch (err) {
|
|
136
|
+
_iterator2.e(err);
|
|
137
|
+
} finally {
|
|
138
|
+
_iterator2.f();
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "draw",
|
|
144
|
+
value: function draw() {
|
|
145
|
+
var data = this.flatten(this._elements.list);
|
|
146
|
+
var place = this.layer('foreground');
|
|
147
|
+
if (!place) return;
|
|
148
|
+
this.element.draw(place, data);
|
|
149
|
+
}
|
|
150
|
+
/* **************************************************************** *
|
|
151
|
+
* Data
|
|
152
|
+
* **************************************************************** */
|
|
153
|
+
}, {
|
|
154
|
+
key: "data",
|
|
155
|
+
value: function data(_data) {
|
|
156
|
+
if (arguments.length === 0) return _superPropGet(Rectum, "data", this, 3)([]);
|
|
157
|
+
this._elements = this.makeElements(_data);
|
|
158
|
+
return _superPropGet(Rectum, "data", this, 3)([this._elements]);
|
|
159
|
+
}
|
|
160
|
+
}]);
|
|
161
|
+
}(_assh0le.Colon);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = D3Wireframe;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _assh0le = _interopRequireDefault(require("@yanqirenshi/assh0le"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function D3Wireframe(props) {
|
|
11
|
+
var rectum = props.rectum;
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement(_assh0le["default"], {
|
|
13
|
+
id: "d3-wireframe-graph",
|
|
14
|
+
rectum: rectum
|
|
15
|
+
});
|
|
16
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Rectum", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Rectum["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports["default"] = void 0;
|
|
13
|
+
var _D3Wireframe = _interopRequireDefault(require("./components/D3Wireframe.js"));
|
|
14
|
+
var _Rectum = _interopRequireDefault(require("./Rectum.js"));
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
+
var _default = exports["default"] = _D3Wireframe["default"];
|
package/package.json
CHANGED
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@yanqirenshi/d3.wireframe",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@yanqirenshi/d3.wireframe",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Wireframe diagram renderer (frame / image / button / modal / dialog elements)",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"transpile": "babel src -d dist --copy-files",
|
|
12
|
+
"prepublishOnly": "npm run transpile",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"test:w": "jest --watch",
|
|
15
|
+
"test:coverage": "jest --coverage"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/yanqirenshi/D3.Wireframe.git"
|
|
20
|
+
},
|
|
21
|
+
"author": "yanqirenshi <yanqirenshi@gmail.com> (https://github.com/yanqirenshi)",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/yanqirenshi/D3.Wireframe/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://yanqirenshi.github.io/D3.Wireframe/#home",
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
29
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@yanqirenshi/assh0le": "^0.5.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/cli": "^7.8.4",
|
|
36
|
+
"@babel/core": "^7.9.0",
|
|
37
|
+
"@babel/preset-env": "^7.9.0",
|
|
38
|
+
"@babel/preset-react": "^7.14.5",
|
|
39
|
+
"babel-jest": "^25.2.4",
|
|
40
|
+
"jest": "^25.2.4"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,111 +1,115 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import Element from './Element';
|
|
4
|
-
|
|
5
|
-
import { DrawerHierarchy } from './Drawer.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
pool.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
import { Colon } from '@yanqirenshi/assh0le';
|
|
2
|
+
|
|
3
|
+
import Element from './Element';
|
|
4
|
+
|
|
5
|
+
import { DrawerHierarchy } from './Drawer.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* データクラス。ワイヤーフレーム要素の構築・マージ・保持を行い、
|
|
9
|
+
* 描画は Element(各 Element クラス)へ委譲する。
|
|
10
|
+
*
|
|
11
|
+
* 旧 D3Wireframe(assh0le 0.0.3 の Asshole クラス継承)を
|
|
12
|
+
* 現行アーキテクチャ(Colon 継承 + React ラッパ)へ移行したもの。
|
|
13
|
+
*/
|
|
14
|
+
export default class Rectum extends Colon {
|
|
15
|
+
constructor (params) {
|
|
16
|
+
super(params);
|
|
17
|
+
|
|
18
|
+
this.element = new Element();
|
|
19
|
+
this._elements = { ht: {}, list: [] };
|
|
20
|
+
}
|
|
21
|
+
/* **************************************************************** *
|
|
22
|
+
* Make Elements
|
|
23
|
+
* **************************************************************** */
|
|
24
|
+
firstObject (list) {
|
|
25
|
+
if (list.length===0)
|
|
26
|
+
return null;
|
|
27
|
+
return list[0];
|
|
28
|
+
}
|
|
29
|
+
merge (source, target) {
|
|
30
|
+
const source_sorted = source.sort((a, b) => { return a.id<b.id ? -1 : 1; });
|
|
31
|
+
const target_sorted = target.sort((a, b) => {
|
|
32
|
+
return a._core.id < b._core.id ? -1 : 1;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
let out = [];
|
|
36
|
+
while (source_sorted.length>0 || target_sorted.length>0) {
|
|
37
|
+
let src = this.firstObject(source_sorted);
|
|
38
|
+
let trg = this.firstObject(target_sorted);
|
|
39
|
+
if (trg===null) {
|
|
40
|
+
// source にしか無いケース
|
|
41
|
+
if (src.visible!==false)
|
|
42
|
+
out.push(this.element.makeElement(src));
|
|
43
|
+
source_sorted.shift();
|
|
44
|
+
} else if (src===null) {
|
|
45
|
+
// target にしか無いやつは削除する。
|
|
46
|
+
target_sorted.shift();
|
|
47
|
+
} else if (src.id === trg._core.id) {
|
|
48
|
+
out.push(this.element.mergeCore(src, trg));
|
|
49
|
+
source_sorted.shift();
|
|
50
|
+
target_sorted.shift();
|
|
51
|
+
} else if (src.id < trg._core.id) {
|
|
52
|
+
// source にしか無いケース
|
|
53
|
+
out.push(this.element.makeElement(src));
|
|
54
|
+
source_sorted.shift();
|
|
55
|
+
} else {
|
|
56
|
+
// target にしか無いやつは削除する。
|
|
57
|
+
target_sorted.shift();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
makeElements (list) {
|
|
64
|
+
let new_list = this.merge(list, this._elements.list);
|
|
65
|
+
|
|
66
|
+
let pool = { ht: {}, list: [] };
|
|
67
|
+
|
|
68
|
+
const dh = new DrawerHierarchy();
|
|
69
|
+
for (let d of new_list) {
|
|
70
|
+
dh.fitting(d);
|
|
71
|
+
|
|
72
|
+
pool.ht[d._id] = d;
|
|
73
|
+
pool.list.push(d);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return pool;
|
|
77
|
+
}
|
|
78
|
+
/* **************************************************************** *
|
|
79
|
+
* Draw
|
|
80
|
+
* **************************************************************** */
|
|
81
|
+
flatten (data) {
|
|
82
|
+
let out = [];
|
|
83
|
+
|
|
84
|
+
for (let d of data) {
|
|
85
|
+
out.push(d);
|
|
86
|
+
|
|
87
|
+
if (d.children.length===0)
|
|
88
|
+
continue;
|
|
89
|
+
|
|
90
|
+
out = out.concat(this.flatten(d.children));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
draw () {
|
|
96
|
+
const data = this.flatten(this._elements.list);
|
|
97
|
+
const place = this.layer('foreground');
|
|
98
|
+
|
|
99
|
+
if (!place)
|
|
100
|
+
return;
|
|
101
|
+
|
|
102
|
+
this.element.draw(place, data);
|
|
103
|
+
}
|
|
104
|
+
/* **************************************************************** *
|
|
105
|
+
* Data
|
|
106
|
+
* **************************************************************** */
|
|
107
|
+
data (data) {
|
|
108
|
+
if (arguments.length===0)
|
|
109
|
+
return super.data();
|
|
110
|
+
|
|
111
|
+
this._elements = this.makeElements(data);
|
|
112
|
+
|
|
113
|
+
return super.data(this._elements);
|
|
114
|
+
}
|
|
115
|
+
}
|
package/src/index.js
ADDED
package/babel.config.js
DELETED
package/docs/asset-manifest.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"main.css": "/static/css/main.5f361e03.chunk.css",
|
|
4
|
-
"main.js": "/static/js/main.7f51684e.chunk.js",
|
|
5
|
-
"main.js.map": "/static/js/main.7f51684e.chunk.js.map",
|
|
6
|
-
"runtime-main.js": "/static/js/runtime-main.0c5b98f9.js",
|
|
7
|
-
"runtime-main.js.map": "/static/js/runtime-main.0c5b98f9.js.map",
|
|
8
|
-
"static/js/2.e2326255.chunk.js": "/static/js/2.e2326255.chunk.js",
|
|
9
|
-
"static/js/2.e2326255.chunk.js.map": "/static/js/2.e2326255.chunk.js.map",
|
|
10
|
-
"index.html": "/index.html",
|
|
11
|
-
"precache-manifest.5f1fad934ed0507dbc92de6788eff788.js": "/precache-manifest.5f1fad934ed0507dbc92de6788eff788.js",
|
|
12
|
-
"service-worker.js": "/service-worker.js",
|
|
13
|
-
"static/css/main.5f361e03.chunk.css.map": "/static/css/main.5f361e03.chunk.css.map",
|
|
14
|
-
"static/js/2.e2326255.chunk.js.LICENSE.txt": "/static/js/2.e2326255.chunk.js.LICENSE.txt",
|
|
15
|
-
"static/media/logo.svg": "/static/media/logo.5d5d9eef.svg"
|
|
16
|
-
},
|
|
17
|
-
"entrypoints": [
|
|
18
|
-
"static/js/runtime-main.0c5b98f9.js",
|
|
19
|
-
"static/js/2.e2326255.chunk.js",
|
|
20
|
-
"static/css/main.5f361e03.chunk.css",
|
|
21
|
-
"static/js/main.7f51684e.chunk.js"
|
|
22
|
-
]
|
|
23
|
-
}
|
package/docs/favicon.ico
DELETED
|
Binary file
|
package/docs/index.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/main.5f361e03.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,f,i=r[0],l=r[1],a=r[2],p=0,s=[];p<i.length;p++)f=i[p],Object.prototype.hasOwnProperty.call(o,f)&&o[f]&&s.push(o[f][0]),o[f]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var l=t[i];0!==o[l]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={1:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var i=this["webpackJsonpd3.wireframe.docs"]=this["webpackJsonpd3.wireframe.docs"]||[],l=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var c=l;t()}([])</script><script src="/static/js/2.e2326255.chunk.js"></script><script src="/static/js/main.7f51684e.chunk.js"></script></body></html>
|
package/docs/logo192.png
DELETED
|
Binary file
|
package/docs/logo512.png
DELETED
|
Binary file
|
package/docs/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
self.__precacheManifest = (self.__precacheManifest || []).concat([
|
|
2
|
-
{
|
|
3
|
-
"revision": "74f4986114a315bc4def7bc7e06741bc",
|
|
4
|
-
"url": "/index.html"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"revision": "43559e4e70704f2b1162",
|
|
8
|
-
"url": "/static/css/main.5f361e03.chunk.css"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"revision": "d2baff32e3e1664d9a91",
|
|
12
|
-
"url": "/static/js/2.e2326255.chunk.js"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"revision": "e88a3e95b5364d46e95b35ae8c0dc27d",
|
|
16
|
-
"url": "/static/js/2.e2326255.chunk.js.LICENSE.txt"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"revision": "43559e4e70704f2b1162",
|
|
20
|
-
"url": "/static/js/main.7f51684e.chunk.js"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"revision": "52cf867a072fb12b9e66",
|
|
24
|
-
"url": "/static/js/runtime-main.0c5b98f9.js"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"revision": "5d5d9eefa31e5e13a6610d9fa7a283bb",
|
|
28
|
-
"url": "/static/media/logo.5d5d9eef.svg"
|
|
29
|
-
}
|
|
30
|
-
]);
|
package/docs/robots.txt
DELETED