@yanqirenshi/d3.ter 0.0.2 → 0.0.6
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/index.js +2 -2
- package/dist/js/EntityTailor.js +4 -4
- package/package.json +1 -1
- package/dist/App.js +0 -19
- package/dist/App.test.js +0 -17
- package/dist/index.css +0 -13
- package/dist/js/AssholeD3TER.js +0 -279
- package/dist/js/Pool.js +0 -43
- package/dist/pages/D3Ter.js +0 -64
- package/dist/pages/Home.js +0 -32
- package/dist/pages/HomeTerData.js +0 -1
- package/dist/pages/TER_DATA.js +0 -130
- package/dist/serviceWorker.js +0 -124
- package/dist/setupTests.js +0 -3
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "Rectum", {
|
|
|
17
17
|
});
|
|
18
18
|
exports["default"] = void 0;
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _D3Ter = _interopRequireDefault(require("./components/D3Ter.js"));
|
|
21
21
|
|
|
22
22
|
var _Rectum = _interopRequireDefault(require("./js/Rectum.js"));
|
|
23
23
|
|
|
@@ -25,5 +25,5 @@ var _assh0le = require("@yanqirenshi/assh0le");
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
28
|
-
var _default =
|
|
28
|
+
var _default = _D3Ter["default"];
|
|
29
29
|
exports["default"] = _default;
|
package/dist/js/EntityTailor.js
CHANGED
|
@@ -524,9 +524,9 @@ var EntityTailor = /*#__PURE__*/function (_Builder) {
|
|
|
524
524
|
key: "positioningColumnItems",
|
|
525
525
|
value: function positioningColumnItems(d) {
|
|
526
526
|
var padding = d.padding;
|
|
527
|
-
var start = d.position.y;
|
|
527
|
+
var start = d.position.y + padding;
|
|
528
528
|
var line_height = this._default.line.height;
|
|
529
|
-
var
|
|
529
|
+
var num = 0;
|
|
530
530
|
|
|
531
531
|
var _iterator3 = _createForOfIteratorHelper(d.contents.list),
|
|
532
532
|
_step3;
|
|
@@ -536,8 +536,8 @@ var EntityTailor = /*#__PURE__*/function (_Builder) {
|
|
|
536
536
|
var item = _step3.value;
|
|
537
537
|
item.position.x = d.position.x + padding;
|
|
538
538
|
var item_h = line_height + item.name.padding * 2;
|
|
539
|
-
item.position.y = start +
|
|
540
|
-
|
|
539
|
+
item.position.y = start + num * item_h + item.name.padding;
|
|
540
|
+
num++;
|
|
541
541
|
}
|
|
542
542
|
} catch (err) {
|
|
543
543
|
_iterator3.e(err);
|
package/package.json
CHANGED
package/dist/App.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _Home = _interopRequireDefault(require("./pages/Home.js"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function App() {
|
|
15
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Home["default"], null));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _default = App;
|
|
19
|
-
exports["default"] = _default;
|
package/dist/App.test.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
var _App = _interopRequireDefault(require("./App"));
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
|
|
11
|
-
test('renders learn react link', function () {
|
|
12
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_App["default"], null)),
|
|
13
|
-
getByText = _render.getByText;
|
|
14
|
-
|
|
15
|
-
var linkElement = getByText(/learn react/i);
|
|
16
|
-
expect(linkElement).toBeInTheDocument();
|
|
17
|
-
});
|
package/dist/index.css
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
margin: 0;
|
|
3
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
4
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
5
|
-
sans-serif;
|
|
6
|
-
-webkit-font-smoothing: antialiased;
|
|
7
|
-
-moz-osx-font-smoothing: grayscale;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
code {
|
|
11
|
-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
12
|
-
monospace;
|
|
13
|
-
}
|
package/dist/js/AssholeD3TER.js
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
-
|
|
12
|
-
var _assh0le = _interopRequireDefault(require("@yanqirenshi/assh0le"));
|
|
13
|
-
|
|
14
|
-
var _Entity = _interopRequireDefault(require("./Entity.js"));
|
|
15
|
-
|
|
16
|
-
var _Identifier = _interopRequireDefault(require("./Identifier.js"));
|
|
17
|
-
|
|
18
|
-
var _IdentifierInstance = _interopRequireDefault(require("./IdentifierInstance.js"));
|
|
19
|
-
|
|
20
|
-
var _Attribute = _interopRequireDefault(require("./Attribute.js"));
|
|
21
|
-
|
|
22
|
-
var _AttributeInstance = _interopRequireDefault(require("./AttributeInstance.js"));
|
|
23
|
-
|
|
24
|
-
var _Relationship = _interopRequireDefault(require("./Relationship.js"));
|
|
25
|
-
|
|
26
|
-
var _Port = _interopRequireDefault(require("./Port.js"));
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
31
|
-
|
|
32
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
-
|
|
34
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
|
-
|
|
36
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
39
|
-
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
-
|
|
42
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
47
|
-
|
|
48
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
49
|
-
|
|
50
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
var AssholeD3TER = /*#__PURE__*/function (_Asshole) {
|
|
57
|
-
_inherits(AssholeD3TER, _Asshole);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(AssholeD3TER);
|
|
60
|
-
|
|
61
|
-
function AssholeD3TER() {
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
_classCallCheck(this, AssholeD3TER);
|
|
65
|
-
|
|
66
|
-
_this = _super.call(this);
|
|
67
|
-
_this.entity = new _Entity["default"]();
|
|
68
|
-
_this.relationship = new _Relationship["default"]();
|
|
69
|
-
_this.attribute = new _Attribute["default"]();
|
|
70
|
-
_this.attribute_instance = new _AttributeInstance["default"]();
|
|
71
|
-
_this.identifier = new _Identifier["default"]();
|
|
72
|
-
_this.identifier_instance = new _IdentifierInstance["default"]();
|
|
73
|
-
_this.port = new _Port["default"]();
|
|
74
|
-
_this._entities = _this.entity.list2pool([]);
|
|
75
|
-
_this._relationships = _this.relationship.list2pool([]);
|
|
76
|
-
_this._identifier = _this.identifier.list2pool([]);
|
|
77
|
-
_this._attribute = _this.attribute.list2pool([]);
|
|
78
|
-
_this._default = {
|
|
79
|
-
line: {
|
|
80
|
-
height: 14,
|
|
81
|
-
font: {
|
|
82
|
-
size: 14
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return _this;
|
|
87
|
-
}
|
|
88
|
-
/* **************************************************************** *
|
|
89
|
-
* Data manegement
|
|
90
|
-
* **************************************************************** */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_createClass(AssholeD3TER, [{
|
|
94
|
-
key: "isEntityClass",
|
|
95
|
-
value: function isEntityClass(_class) {
|
|
96
|
-
var classes = ['RESOURCE', 'RESOURCE-SUBSET', 'EVENT', 'EVENT-SUBSET'];
|
|
97
|
-
return classes.indexOf(_class) > -1;
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "buildRelationshipsWithPort",
|
|
101
|
-
value: function buildRelationshipsWithPort(relationships, entities) {
|
|
102
|
-
var out = {
|
|
103
|
-
list: [],
|
|
104
|
-
ht: {}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
var _iterator = _createForOfIteratorHelper(relationships),
|
|
108
|
-
_step;
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
112
|
-
var core = _step.value;
|
|
113
|
-
var identifier_from = this.entity.getIdentifier(core.from.id, entities);
|
|
114
|
-
var identifier_to = this.entity.getIdentifier(core.to.id, entities);
|
|
115
|
-
var port_from = this.port.build('from', core.from.position, identifier_from);
|
|
116
|
-
var port_to = this.port.build('to', core.to.position, identifier_to);
|
|
117
|
-
var element = this.relationship.build(core, port_from, port_to);
|
|
118
|
-
var entity_from = identifier_from._entity;
|
|
119
|
-
var entity_to = identifier_to._entity;
|
|
120
|
-
port_from._entity = entity_from;
|
|
121
|
-
port_to._entity = entity_to;
|
|
122
|
-
entity_from.ports.items.ht[port_from._id] = port_from;
|
|
123
|
-
entity_from.ports.items.list.push(port_from);
|
|
124
|
-
entity_to.ports.items.ht[port_to._id] = port_to;
|
|
125
|
-
entity_to.ports.items.list.push(port_to);
|
|
126
|
-
out.list.push(element);
|
|
127
|
-
out.ht[element._id] = element;
|
|
128
|
-
}
|
|
129
|
-
} catch (err) {
|
|
130
|
-
_iterator.e(err);
|
|
131
|
-
} finally {
|
|
132
|
-
_iterator.f();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return out;
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "dataCore",
|
|
139
|
-
value: function dataCore(data) {
|
|
140
|
-
var _this2 = this;
|
|
141
|
-
|
|
142
|
-
this._identifiers = this.identifier.list2pool(data.identifiers, function (d) {
|
|
143
|
-
return _this2.identifier.build(d);
|
|
144
|
-
});
|
|
145
|
-
this._attributes = this.identifier.list2pool(data.attributes, function (d) {
|
|
146
|
-
return _this2.attribute.build(d);
|
|
147
|
-
});
|
|
148
|
-
var elements = {
|
|
149
|
-
identifiers: this._identifiers,
|
|
150
|
-
attributes: this._attributes
|
|
151
|
-
};
|
|
152
|
-
this._entities = this.entity.list2pool(data.entities, function (d) {
|
|
153
|
-
return _this2.entity.build(d, elements);
|
|
154
|
-
});
|
|
155
|
-
this.entity.sizing(this._entities.list);
|
|
156
|
-
this._relationships = this.buildRelationshipsWithPort(data.relationships, this._entities);
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "data",
|
|
160
|
-
value: function data(_data) {
|
|
161
|
-
this.dataCore(_data);
|
|
162
|
-
this.draw();
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
/* **************************************************************** *
|
|
166
|
-
* Drag & Drop
|
|
167
|
-
* **************************************************************** */
|
|
168
|
-
|
|
169
|
-
}, {
|
|
170
|
-
key: "moveEdges",
|
|
171
|
-
value: function moveEdges(edges) {// TODO:
|
|
172
|
-
}
|
|
173
|
-
}, {
|
|
174
|
-
key: "moveEntity",
|
|
175
|
-
value: function moveEntity(entity) {
|
|
176
|
-
var selection = this.getLayerForeground().selectAll('g.entity').data([entity], function (d) {
|
|
177
|
-
return d._id;
|
|
178
|
-
});
|
|
179
|
-
selection.attr('transform', function (d) {
|
|
180
|
-
return 'translate(' + d.position.x + ',' + d.position.y + ')';
|
|
181
|
-
}); // this.moveEdges([...]);
|
|
182
|
-
}
|
|
183
|
-
}, {
|
|
184
|
-
key: "movePort",
|
|
185
|
-
value: function movePort(entity_core, port_core) {
|
|
186
|
-
var entity = this._data.find(function (d) {
|
|
187
|
-
return d._id === entity_core._id;
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var port = entity.ports.items.ht[port_core._id];
|
|
191
|
-
this.positioningPort(entity, port); // redraw ports
|
|
192
|
-
|
|
193
|
-
var ports = this.getLayerForeground().selectAll('circle.entity-port').data([port], function (d) {
|
|
194
|
-
return d._id;
|
|
195
|
-
});
|
|
196
|
-
this.drawPortsCore(ports); // redraw edge
|
|
197
|
-
|
|
198
|
-
var edges = [];
|
|
199
|
-
|
|
200
|
-
var add_edges = function add_edges(ht) {
|
|
201
|
-
for (var k in ht) {
|
|
202
|
-
var edge = ht[k];
|
|
203
|
-
if (edge.from_class === "PORT-TER" && edge.to_class === "PORT-TER") edges.push(edge);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
add_edges(this._relationships.indexes.from[port._id]);
|
|
208
|
-
add_edges(this._relationships.indexes.to[port._id]);
|
|
209
|
-
var elements = this.getLayerBackground().selectAll('line.connector').data(edges, function (d) {
|
|
210
|
-
return d._id;
|
|
211
|
-
});
|
|
212
|
-
this.drawEdgesCore(elements);
|
|
213
|
-
}
|
|
214
|
-
/* **************************************************************** *
|
|
215
|
-
* Draw
|
|
216
|
-
* **************************************************************** */
|
|
217
|
-
|
|
218
|
-
}, {
|
|
219
|
-
key: "draw",
|
|
220
|
-
value: function draw() {
|
|
221
|
-
this._callbacks = {};
|
|
222
|
-
this.entity.draw(this.getLayerForeground(), this._entities);
|
|
223
|
-
this.relationship.draw(this.getLayerBackground(), this._relationships);
|
|
224
|
-
}
|
|
225
|
-
/* **************************************************************** *
|
|
226
|
-
* move port
|
|
227
|
-
* **************************************************************** */
|
|
228
|
-
|
|
229
|
-
/* **************************************************************** *
|
|
230
|
-
* to Json
|
|
231
|
-
* **************************************************************** */
|
|
232
|
-
|
|
233
|
-
}, {
|
|
234
|
-
key: "stateTER2Json",
|
|
235
|
-
value: function stateTER2Json(state) {
|
|
236
|
-
var out = {};
|
|
237
|
-
out.cameras = state.cameras.list;
|
|
238
|
-
out.entities = state.entities.list;
|
|
239
|
-
|
|
240
|
-
var modifyColumns = function modifyColumns(obj) {
|
|
241
|
-
var new_data = Object.assign({}, obj);
|
|
242
|
-
delete new_data._entity;
|
|
243
|
-
delete new_data._parent;
|
|
244
|
-
return new_data;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
out.identifier_instances = state.identifier_instances.list.map(modifyColumns);
|
|
248
|
-
out.attribute_instances = state.attribute_instances.list.map(modifyColumns);
|
|
249
|
-
out.relationships = state.relationships.list.map(function (obj) {
|
|
250
|
-
var new_data = Object.assign({}, obj);
|
|
251
|
-
delete new_data._from;
|
|
252
|
-
delete new_data._to;
|
|
253
|
-
return new_data;
|
|
254
|
-
});
|
|
255
|
-
out.ports = state.ports.list.map(function (obj) {
|
|
256
|
-
var new_data = Object.assign({}, obj);
|
|
257
|
-
delete new_data._element;
|
|
258
|
-
return new_data;
|
|
259
|
-
});
|
|
260
|
-
return JSON.stringify(out, null, 3);
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "downloadJson",
|
|
264
|
-
value: function downloadJson(name, json) {
|
|
265
|
-
var blob = new Blob([json], {
|
|
266
|
-
type: 'application/json'
|
|
267
|
-
});
|
|
268
|
-
var a = document.createElement("a");
|
|
269
|
-
a.href = URL.createObjectURL(blob);
|
|
270
|
-
a.target = '_blank';
|
|
271
|
-
a.download = name + '.' + (0, _moment["default"])().format('YYYYMMDDHHmmssZZ') + '.json';
|
|
272
|
-
a.click();
|
|
273
|
-
}
|
|
274
|
-
}]);
|
|
275
|
-
|
|
276
|
-
return AssholeD3TER;
|
|
277
|
-
}(_assh0le["default"]);
|
|
278
|
-
|
|
279
|
-
exports["default"] = AssholeD3TER;
|
package/dist/js/Pool.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
|
|
10
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
|
-
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
|
|
14
|
-
var Pool = /*#__PURE__*/function () {
|
|
15
|
-
function Pool() {
|
|
16
|
-
_classCallCheck(this, Pool);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
_createClass(Pool, [{
|
|
20
|
-
key: "list2pool",
|
|
21
|
-
value: function list2pool(list, f) {
|
|
22
|
-
var pool = {
|
|
23
|
-
list: [],
|
|
24
|
-
ht: {}
|
|
25
|
-
};
|
|
26
|
-
if (!list) return pool;
|
|
27
|
-
if (f) return list.reduce(function (acc, val) {
|
|
28
|
-
var new_val = f(val);
|
|
29
|
-
acc.list.push(new_val);
|
|
30
|
-
acc.ht[new_val._id] = new_val;
|
|
31
|
-
return acc;
|
|
32
|
-
}, pool);else return list.reduce(function (acc, val) {
|
|
33
|
-
acc.list.push(val);
|
|
34
|
-
acc.ht[val.id] = val;
|
|
35
|
-
return acc;
|
|
36
|
-
}, pool);
|
|
37
|
-
}
|
|
38
|
-
}]);
|
|
39
|
-
|
|
40
|
-
return Pool;
|
|
41
|
-
}();
|
|
42
|
-
|
|
43
|
-
exports["default"] = Pool;
|
package/dist/pages/D3Ter.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _AssholeD3TER = _interopRequireDefault(require("../js/AssholeD3TER.js"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
|
|
22
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
-
|
|
24
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
|
|
26
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
27
|
-
|
|
28
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
-
|
|
30
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
32
|
-
var style = {
|
|
33
|
-
root: {
|
|
34
|
-
width: '100%',
|
|
35
|
-
height: '100%',
|
|
36
|
-
padding: 0,
|
|
37
|
-
margin: 0,
|
|
38
|
-
overflow: 'hidden',
|
|
39
|
-
background: 'rgba(254, 244, 244, 0.8)'
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
function D3Ter(props) {
|
|
44
|
-
var _useState = (0, _react.useState)(new _AssholeD3TER["default"]().init({
|
|
45
|
-
svg: {
|
|
46
|
-
selector: '#asshole-graph'
|
|
47
|
-
}
|
|
48
|
-
})),
|
|
49
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
50
|
-
ass = _useState2[0];
|
|
51
|
-
|
|
52
|
-
(0, _react.useEffect)(function () {
|
|
53
|
-
ass.focus();
|
|
54
|
-
ass.data(props.graph_data);
|
|
55
|
-
});
|
|
56
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
57
|
-
style: style.root
|
|
58
|
-
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
59
|
-
id: "asshole-graph"
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var _default = D3Ter;
|
|
64
|
-
exports["default"] = _default;
|
package/dist/pages/Home.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _D3Ter = _interopRequireDefault(require("./D3Ter.js"));
|
|
11
|
-
|
|
12
|
-
var _TER_DATA = _interopRequireDefault(require("./TER_DATA.js"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
var style = {
|
|
17
|
-
root: {
|
|
18
|
-
width: '100vw',
|
|
19
|
-
height: '100vh'
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function App() {
|
|
24
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
25
|
-
style: style.root
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement(_D3Ter["default"], {
|
|
27
|
-
graph_data: _TER_DATA["default"]
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var _default = App;
|
|
32
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/pages/TER_DATA.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var TER_DATA = {
|
|
8
|
-
identifiers: [{
|
|
9
|
-
id: 10,
|
|
10
|
-
name: {
|
|
11
|
-
physical: 'resource_id',
|
|
12
|
-
logical: 'リソースID'
|
|
13
|
-
}
|
|
14
|
-
}, {
|
|
15
|
-
id: 11,
|
|
16
|
-
name: {
|
|
17
|
-
physical: 'event_id',
|
|
18
|
-
logical: 'イベントID'
|
|
19
|
-
}
|
|
20
|
-
}],
|
|
21
|
-
attributes: [{
|
|
22
|
-
id: 20,
|
|
23
|
-
name: {
|
|
24
|
-
physical: 'aaa',
|
|
25
|
-
logical: 'bbb'
|
|
26
|
-
}
|
|
27
|
-
}, {
|
|
28
|
-
id: 21,
|
|
29
|
-
name: {
|
|
30
|
-
physical: 'ccc',
|
|
31
|
-
logical: 'ddd'
|
|
32
|
-
}
|
|
33
|
-
}],
|
|
34
|
-
entities: [{
|
|
35
|
-
id: 1,
|
|
36
|
-
type: 'RESOURCE',
|
|
37
|
-
name: {
|
|
38
|
-
physical: 'aaa',
|
|
39
|
-
logical: 'bbb'
|
|
40
|
-
},
|
|
41
|
-
position: {
|
|
42
|
-
x: 10,
|
|
43
|
-
y: -100
|
|
44
|
-
},
|
|
45
|
-
size: {
|
|
46
|
-
w: 100,
|
|
47
|
-
h: 200
|
|
48
|
-
},
|
|
49
|
-
identifiers: [{
|
|
50
|
-
id: 1000,
|
|
51
|
-
name: {
|
|
52
|
-
physical: '111',
|
|
53
|
-
logical: '222'
|
|
54
|
-
},
|
|
55
|
-
identifier: 10
|
|
56
|
-
}],
|
|
57
|
-
attributes: [{
|
|
58
|
-
id: 2000,
|
|
59
|
-
name: {
|
|
60
|
-
physical: 'aaa',
|
|
61
|
-
logical: 'bbb'
|
|
62
|
-
},
|
|
63
|
-
attribute: 20
|
|
64
|
-
}, {
|
|
65
|
-
id: 2001,
|
|
66
|
-
name: {
|
|
67
|
-
physical: 'ccc',
|
|
68
|
-
logical: 'ddd'
|
|
69
|
-
},
|
|
70
|
-
attribute: 21
|
|
71
|
-
}]
|
|
72
|
-
}, {
|
|
73
|
-
id: 2,
|
|
74
|
-
type: 'EVENT',
|
|
75
|
-
name: {
|
|
76
|
-
physical: 'ccc',
|
|
77
|
-
logical: 'ddd'
|
|
78
|
-
},
|
|
79
|
-
position: {
|
|
80
|
-
x: 500,
|
|
81
|
-
y: -100
|
|
82
|
-
},
|
|
83
|
-
size: {
|
|
84
|
-
w: 100,
|
|
85
|
-
h: 200
|
|
86
|
-
},
|
|
87
|
-
identifiers: [{
|
|
88
|
-
id: 1100,
|
|
89
|
-
name: {
|
|
90
|
-
physical: '555',
|
|
91
|
-
logical: '666'
|
|
92
|
-
},
|
|
93
|
-
identifier: 11
|
|
94
|
-
}, {
|
|
95
|
-
id: 1101,
|
|
96
|
-
name: {
|
|
97
|
-
physical: '777',
|
|
98
|
-
logical: '888'
|
|
99
|
-
},
|
|
100
|
-
identifier: 10
|
|
101
|
-
}],
|
|
102
|
-
attributes: [{
|
|
103
|
-
id: 2100,
|
|
104
|
-
name: {
|
|
105
|
-
physical: 'eee',
|
|
106
|
-
logical: 'fff'
|
|
107
|
-
},
|
|
108
|
-
attribute: 20
|
|
109
|
-
}, {
|
|
110
|
-
id: 2101,
|
|
111
|
-
name: {
|
|
112
|
-
physical: 'ggg',
|
|
113
|
-
logical: 'hhh'
|
|
114
|
-
},
|
|
115
|
-
attribute: 21
|
|
116
|
-
}]
|
|
117
|
-
}],
|
|
118
|
-
relationships: [{
|
|
119
|
-
from: {
|
|
120
|
-
id: 1000,
|
|
121
|
-
position: 270
|
|
122
|
-
},
|
|
123
|
-
to: {
|
|
124
|
-
id: 1101,
|
|
125
|
-
position: 90
|
|
126
|
-
}
|
|
127
|
-
}]
|
|
128
|
-
};
|
|
129
|
-
var _default = TER_DATA;
|
|
130
|
-
exports["default"] = _default;
|
package/dist/serviceWorker.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.register = register;
|
|
7
|
-
exports.unregister = unregister;
|
|
8
|
-
// This optional code is used to register a service worker.
|
|
9
|
-
// register() is not called by default.
|
|
10
|
-
// This lets the app load faster on subsequent visits in production, and gives
|
|
11
|
-
// it offline capabilities. However, it also means that developers (and users)
|
|
12
|
-
// will only see deployed updates on subsequent visits to a page, after all the
|
|
13
|
-
// existing tabs open on the page have been closed, since previously cached
|
|
14
|
-
// resources are updated in the background.
|
|
15
|
-
// To learn more about the benefits of this model and instructions on how to
|
|
16
|
-
// opt-in, read https://bit.ly/CRA-PWA
|
|
17
|
-
var isLocalhost = Boolean(window.location.hostname === 'localhost' || // [::1] is the IPv6 localhost address.
|
|
18
|
-
window.location.hostname === '[::1]' || // 127.0.0.0/8 are considered localhost for IPv4.
|
|
19
|
-
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));
|
|
20
|
-
|
|
21
|
-
function register(config) {
|
|
22
|
-
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
23
|
-
// The URL constructor is available in all browsers that support SW.
|
|
24
|
-
var publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
|
25
|
-
|
|
26
|
-
if (publicUrl.origin !== window.location.origin) {
|
|
27
|
-
// Our service worker won't work if PUBLIC_URL is on a different origin
|
|
28
|
-
// from what our page is served on. This might happen if a CDN is used to
|
|
29
|
-
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
window.addEventListener('load', function () {
|
|
34
|
-
var swUrl = "".concat(process.env.PUBLIC_URL, "/service-worker.js");
|
|
35
|
-
|
|
36
|
-
if (isLocalhost) {
|
|
37
|
-
// This is running on localhost. Let's check if a service worker still exists or not.
|
|
38
|
-
checkValidServiceWorker(swUrl, config); // Add some additional logging to localhost, pointing developers to the
|
|
39
|
-
// service worker/PWA documentation.
|
|
40
|
-
|
|
41
|
-
navigator.serviceWorker.ready.then(function () {
|
|
42
|
-
console.log('This web app is being served cache-first by a service ' + 'worker. To learn more, visit https://bit.ly/CRA-PWA');
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
// Is not localhost. Just register service worker
|
|
46
|
-
registerValidSW(swUrl, config);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function registerValidSW(swUrl, config) {
|
|
53
|
-
navigator.serviceWorker.register(swUrl).then(function (registration) {
|
|
54
|
-
registration.onupdatefound = function () {
|
|
55
|
-
var installingWorker = registration.installing;
|
|
56
|
-
|
|
57
|
-
if (installingWorker == null) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
installingWorker.onstatechange = function () {
|
|
62
|
-
if (installingWorker.state === 'installed') {
|
|
63
|
-
if (navigator.serviceWorker.controller) {
|
|
64
|
-
// At this point, the updated precached content has been fetched,
|
|
65
|
-
// but the previous service worker will still serve the older
|
|
66
|
-
// content until all client tabs are closed.
|
|
67
|
-
console.log('New content is available and will be used when all ' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'); // Execute callback
|
|
68
|
-
|
|
69
|
-
if (config && config.onUpdate) {
|
|
70
|
-
config.onUpdate(registration);
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
// At this point, everything has been precached.
|
|
74
|
-
// It's the perfect time to display a
|
|
75
|
-
// "Content is cached for offline use." message.
|
|
76
|
-
console.log('Content is cached for offline use.'); // Execute callback
|
|
77
|
-
|
|
78
|
-
if (config && config.onSuccess) {
|
|
79
|
-
config.onSuccess(registration);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
})["catch"](function (error) {
|
|
86
|
-
console.error('Error during service worker registration:', error);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function checkValidServiceWorker(swUrl, config) {
|
|
91
|
-
// Check if the service worker can be found. If it can't reload the page.
|
|
92
|
-
fetch(swUrl, {
|
|
93
|
-
headers: {
|
|
94
|
-
'Service-Worker': 'script'
|
|
95
|
-
}
|
|
96
|
-
}).then(function (response) {
|
|
97
|
-
// Ensure service worker exists, and that we really are getting a JS file.
|
|
98
|
-
var contentType = response.headers.get('content-type');
|
|
99
|
-
|
|
100
|
-
if (response.status === 404 || contentType != null && contentType.indexOf('javascript') === -1) {
|
|
101
|
-
// No service worker found. Probably a different app. Reload the page.
|
|
102
|
-
navigator.serviceWorker.ready.then(function (registration) {
|
|
103
|
-
registration.unregister().then(function () {
|
|
104
|
-
window.location.reload();
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
} else {
|
|
108
|
-
// Service worker found. Proceed as normal.
|
|
109
|
-
registerValidSW(swUrl, config);
|
|
110
|
-
}
|
|
111
|
-
})["catch"](function () {
|
|
112
|
-
console.log('No internet connection found. App is running in offline mode.');
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function unregister() {
|
|
117
|
-
if ('serviceWorker' in navigator) {
|
|
118
|
-
navigator.serviceWorker.ready.then(function (registration) {
|
|
119
|
-
registration.unregister();
|
|
120
|
-
})["catch"](function (error) {
|
|
121
|
-
console.error(error.message);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
package/dist/setupTests.js
DELETED