polly-graph 0.1.0
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 +21 -0
- package/README.md +217 -0
- package/dist/index.cjs +4548 -0
- package/dist/index.css +76 -0
- package/dist/index.d.cts +97 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +4521 -0
- package/package.json +75 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4521 @@
|
|
|
1
|
+
// node_modules/d3-selection/src/namespaces.js
|
|
2
|
+
var xhtml = "http://www.w3.org/1999/xhtml";
|
|
3
|
+
var namespaces_default = {
|
|
4
|
+
svg: "http://www.w3.org/2000/svg",
|
|
5
|
+
xhtml,
|
|
6
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
7
|
+
xml: "http://www.w3.org/XML/1998/namespace",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// node_modules/d3-selection/src/namespace.js
|
|
12
|
+
function namespace_default(name) {
|
|
13
|
+
var prefix = name += "", i = prefix.indexOf(":");
|
|
14
|
+
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
|
|
15
|
+
return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// node_modules/d3-selection/src/creator.js
|
|
19
|
+
function creatorInherit(name) {
|
|
20
|
+
return function() {
|
|
21
|
+
var document2 = this.ownerDocument, uri = this.namespaceURI;
|
|
22
|
+
return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function creatorFixed(fullname) {
|
|
26
|
+
return function() {
|
|
27
|
+
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function creator_default(name) {
|
|
31
|
+
var fullname = namespace_default(name);
|
|
32
|
+
return (fullname.local ? creatorFixed : creatorInherit)(fullname);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// node_modules/d3-selection/src/selector.js
|
|
36
|
+
function none() {
|
|
37
|
+
}
|
|
38
|
+
function selector_default(selector) {
|
|
39
|
+
return selector == null ? none : function() {
|
|
40
|
+
return this.querySelector(selector);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// node_modules/d3-selection/src/selection/select.js
|
|
45
|
+
function select_default(select) {
|
|
46
|
+
if (typeof select !== "function") select = selector_default(select);
|
|
47
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
48
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
49
|
+
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
|
50
|
+
if ("__data__" in node) subnode.__data__ = node.__data__;
|
|
51
|
+
subgroup[i] = subnode;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return new Selection(subgroups, this._parents);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// node_modules/d3-selection/src/array.js
|
|
59
|
+
function array(x3) {
|
|
60
|
+
return x3 == null ? [] : Array.isArray(x3) ? x3 : Array.from(x3);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// node_modules/d3-selection/src/selectorAll.js
|
|
64
|
+
function empty() {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
function selectorAll_default(selector) {
|
|
68
|
+
return selector == null ? empty : function() {
|
|
69
|
+
return this.querySelectorAll(selector);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// node_modules/d3-selection/src/selection/selectAll.js
|
|
74
|
+
function arrayAll(select) {
|
|
75
|
+
return function() {
|
|
76
|
+
return array(select.apply(this, arguments));
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function selectAll_default(select) {
|
|
80
|
+
if (typeof select === "function") select = arrayAll(select);
|
|
81
|
+
else select = selectorAll_default(select);
|
|
82
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
|
|
83
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
84
|
+
if (node = group[i]) {
|
|
85
|
+
subgroups.push(select.call(node, node.__data__, i, group));
|
|
86
|
+
parents.push(node);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return new Selection(subgroups, parents);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// node_modules/d3-selection/src/matcher.js
|
|
94
|
+
function matcher_default(selector) {
|
|
95
|
+
return function() {
|
|
96
|
+
return this.matches(selector);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function childMatcher(selector) {
|
|
100
|
+
return function(node) {
|
|
101
|
+
return node.matches(selector);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// node_modules/d3-selection/src/selection/selectChild.js
|
|
106
|
+
var find = Array.prototype.find;
|
|
107
|
+
function childFind(match) {
|
|
108
|
+
return function() {
|
|
109
|
+
return find.call(this.children, match);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function childFirst() {
|
|
113
|
+
return this.firstElementChild;
|
|
114
|
+
}
|
|
115
|
+
function selectChild_default(match) {
|
|
116
|
+
return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// node_modules/d3-selection/src/selection/selectChildren.js
|
|
120
|
+
var filter = Array.prototype.filter;
|
|
121
|
+
function children() {
|
|
122
|
+
return Array.from(this.children);
|
|
123
|
+
}
|
|
124
|
+
function childrenFilter(match) {
|
|
125
|
+
return function() {
|
|
126
|
+
return filter.call(this.children, match);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function selectChildren_default(match) {
|
|
130
|
+
return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// node_modules/d3-selection/src/selection/filter.js
|
|
134
|
+
function filter_default(match) {
|
|
135
|
+
if (typeof match !== "function") match = matcher_default(match);
|
|
136
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
137
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
138
|
+
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
139
|
+
subgroup.push(node);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return new Selection(subgroups, this._parents);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// node_modules/d3-selection/src/selection/sparse.js
|
|
147
|
+
function sparse_default(update) {
|
|
148
|
+
return new Array(update.length);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// node_modules/d3-selection/src/selection/enter.js
|
|
152
|
+
function enter_default() {
|
|
153
|
+
return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
|
|
154
|
+
}
|
|
155
|
+
function EnterNode(parent, datum2) {
|
|
156
|
+
this.ownerDocument = parent.ownerDocument;
|
|
157
|
+
this.namespaceURI = parent.namespaceURI;
|
|
158
|
+
this._next = null;
|
|
159
|
+
this._parent = parent;
|
|
160
|
+
this.__data__ = datum2;
|
|
161
|
+
}
|
|
162
|
+
EnterNode.prototype = {
|
|
163
|
+
constructor: EnterNode,
|
|
164
|
+
appendChild: function(child) {
|
|
165
|
+
return this._parent.insertBefore(child, this._next);
|
|
166
|
+
},
|
|
167
|
+
insertBefore: function(child, next) {
|
|
168
|
+
return this._parent.insertBefore(child, next);
|
|
169
|
+
},
|
|
170
|
+
querySelector: function(selector) {
|
|
171
|
+
return this._parent.querySelector(selector);
|
|
172
|
+
},
|
|
173
|
+
querySelectorAll: function(selector) {
|
|
174
|
+
return this._parent.querySelectorAll(selector);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// node_modules/d3-selection/src/constant.js
|
|
179
|
+
function constant_default(x3) {
|
|
180
|
+
return function() {
|
|
181
|
+
return x3;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// node_modules/d3-selection/src/selection/data.js
|
|
186
|
+
function bindIndex(parent, group, enter, update, exit, data) {
|
|
187
|
+
var i = 0, node, groupLength = group.length, dataLength = data.length;
|
|
188
|
+
for (; i < dataLength; ++i) {
|
|
189
|
+
if (node = group[i]) {
|
|
190
|
+
node.__data__ = data[i];
|
|
191
|
+
update[i] = node;
|
|
192
|
+
} else {
|
|
193
|
+
enter[i] = new EnterNode(parent, data[i]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (; i < groupLength; ++i) {
|
|
197
|
+
if (node = group[i]) {
|
|
198
|
+
exit[i] = node;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function bindKey(parent, group, enter, update, exit, data, key) {
|
|
203
|
+
var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
|
|
204
|
+
for (i = 0; i < groupLength; ++i) {
|
|
205
|
+
if (node = group[i]) {
|
|
206
|
+
keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
|
|
207
|
+
if (nodeByKeyValue.has(keyValue)) {
|
|
208
|
+
exit[i] = node;
|
|
209
|
+
} else {
|
|
210
|
+
nodeByKeyValue.set(keyValue, node);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
for (i = 0; i < dataLength; ++i) {
|
|
215
|
+
keyValue = key.call(parent, data[i], i, data) + "";
|
|
216
|
+
if (node = nodeByKeyValue.get(keyValue)) {
|
|
217
|
+
update[i] = node;
|
|
218
|
+
node.__data__ = data[i];
|
|
219
|
+
nodeByKeyValue.delete(keyValue);
|
|
220
|
+
} else {
|
|
221
|
+
enter[i] = new EnterNode(parent, data[i]);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
for (i = 0; i < groupLength; ++i) {
|
|
225
|
+
if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
|
|
226
|
+
exit[i] = node;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function datum(node) {
|
|
231
|
+
return node.__data__;
|
|
232
|
+
}
|
|
233
|
+
function data_default(value, key) {
|
|
234
|
+
if (!arguments.length) return Array.from(this, datum);
|
|
235
|
+
var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
|
|
236
|
+
if (typeof value !== "function") value = constant_default(value);
|
|
237
|
+
for (var m2 = groups.length, update = new Array(m2), enter = new Array(m2), exit = new Array(m2), j = 0; j < m2; ++j) {
|
|
238
|
+
var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
|
|
239
|
+
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
|
240
|
+
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
|
|
241
|
+
if (previous = enterGroup[i0]) {
|
|
242
|
+
if (i0 >= i1) i1 = i0 + 1;
|
|
243
|
+
while (!(next = updateGroup[i1]) && ++i1 < dataLength) ;
|
|
244
|
+
previous._next = next || null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
update = new Selection(update, parents);
|
|
249
|
+
update._enter = enter;
|
|
250
|
+
update._exit = exit;
|
|
251
|
+
return update;
|
|
252
|
+
}
|
|
253
|
+
function arraylike(data) {
|
|
254
|
+
return typeof data === "object" && "length" in data ? data : Array.from(data);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// node_modules/d3-selection/src/selection/exit.js
|
|
258
|
+
function exit_default() {
|
|
259
|
+
return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// node_modules/d3-selection/src/selection/join.js
|
|
263
|
+
function join_default(onenter, onupdate, onexit) {
|
|
264
|
+
var enter = this.enter(), update = this, exit = this.exit();
|
|
265
|
+
if (typeof onenter === "function") {
|
|
266
|
+
enter = onenter(enter);
|
|
267
|
+
if (enter) enter = enter.selection();
|
|
268
|
+
} else {
|
|
269
|
+
enter = enter.append(onenter + "");
|
|
270
|
+
}
|
|
271
|
+
if (onupdate != null) {
|
|
272
|
+
update = onupdate(update);
|
|
273
|
+
if (update) update = update.selection();
|
|
274
|
+
}
|
|
275
|
+
if (onexit == null) exit.remove();
|
|
276
|
+
else onexit(exit);
|
|
277
|
+
return enter && update ? enter.merge(update).order() : update;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// node_modules/d3-selection/src/selection/merge.js
|
|
281
|
+
function merge_default(context) {
|
|
282
|
+
var selection2 = context.selection ? context.selection() : context;
|
|
283
|
+
for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
|
|
284
|
+
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
285
|
+
if (node = group0[i] || group1[i]) {
|
|
286
|
+
merge[i] = node;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
for (; j < m0; ++j) {
|
|
291
|
+
merges[j] = groups0[j];
|
|
292
|
+
}
|
|
293
|
+
return new Selection(merges, this._parents);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// node_modules/d3-selection/src/selection/order.js
|
|
297
|
+
function order_default() {
|
|
298
|
+
for (var groups = this._groups, j = -1, m2 = groups.length; ++j < m2; ) {
|
|
299
|
+
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
|
|
300
|
+
if (node = group[i]) {
|
|
301
|
+
if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
|
|
302
|
+
next = node;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return this;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// node_modules/d3-selection/src/selection/sort.js
|
|
310
|
+
function sort_default(compare) {
|
|
311
|
+
if (!compare) compare = ascending;
|
|
312
|
+
function compareNode(a2, b) {
|
|
313
|
+
return a2 && b ? compare(a2.__data__, b.__data__) : !a2 - !b;
|
|
314
|
+
}
|
|
315
|
+
for (var groups = this._groups, m2 = groups.length, sortgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
316
|
+
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
317
|
+
if (node = group[i]) {
|
|
318
|
+
sortgroup[i] = node;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
sortgroup.sort(compareNode);
|
|
322
|
+
}
|
|
323
|
+
return new Selection(sortgroups, this._parents).order();
|
|
324
|
+
}
|
|
325
|
+
function ascending(a2, b) {
|
|
326
|
+
return a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// node_modules/d3-selection/src/selection/call.js
|
|
330
|
+
function call_default() {
|
|
331
|
+
var callback = arguments[0];
|
|
332
|
+
arguments[0] = this;
|
|
333
|
+
callback.apply(null, arguments);
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// node_modules/d3-selection/src/selection/nodes.js
|
|
338
|
+
function nodes_default() {
|
|
339
|
+
return Array.from(this);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// node_modules/d3-selection/src/selection/node.js
|
|
343
|
+
function node_default() {
|
|
344
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
345
|
+
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
|
|
346
|
+
var node = group[i];
|
|
347
|
+
if (node) return node;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// node_modules/d3-selection/src/selection/size.js
|
|
354
|
+
function size_default() {
|
|
355
|
+
let size = 0;
|
|
356
|
+
for (const node of this) ++size;
|
|
357
|
+
return size;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// node_modules/d3-selection/src/selection/empty.js
|
|
361
|
+
function empty_default() {
|
|
362
|
+
return !this.node();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// node_modules/d3-selection/src/selection/each.js
|
|
366
|
+
function each_default(callback) {
|
|
367
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
368
|
+
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
369
|
+
if (node = group[i]) callback.call(node, node.__data__, i, group);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return this;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// node_modules/d3-selection/src/selection/attr.js
|
|
376
|
+
function attrRemove(name) {
|
|
377
|
+
return function() {
|
|
378
|
+
this.removeAttribute(name);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function attrRemoveNS(fullname) {
|
|
382
|
+
return function() {
|
|
383
|
+
this.removeAttributeNS(fullname.space, fullname.local);
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function attrConstant(name, value) {
|
|
387
|
+
return function() {
|
|
388
|
+
this.setAttribute(name, value);
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
function attrConstantNS(fullname, value) {
|
|
392
|
+
return function() {
|
|
393
|
+
this.setAttributeNS(fullname.space, fullname.local, value);
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function attrFunction(name, value) {
|
|
397
|
+
return function() {
|
|
398
|
+
var v = value.apply(this, arguments);
|
|
399
|
+
if (v == null) this.removeAttribute(name);
|
|
400
|
+
else this.setAttribute(name, v);
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function attrFunctionNS(fullname, value) {
|
|
404
|
+
return function() {
|
|
405
|
+
var v = value.apply(this, arguments);
|
|
406
|
+
if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
|
|
407
|
+
else this.setAttributeNS(fullname.space, fullname.local, v);
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function attr_default(name, value) {
|
|
411
|
+
var fullname = namespace_default(name);
|
|
412
|
+
if (arguments.length < 2) {
|
|
413
|
+
var node = this.node();
|
|
414
|
+
return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
|
|
415
|
+
}
|
|
416
|
+
return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// node_modules/d3-selection/src/window.js
|
|
420
|
+
function window_default(node) {
|
|
421
|
+
return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// node_modules/d3-selection/src/selection/style.js
|
|
425
|
+
function styleRemove(name) {
|
|
426
|
+
return function() {
|
|
427
|
+
this.style.removeProperty(name);
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function styleConstant(name, value, priority) {
|
|
431
|
+
return function() {
|
|
432
|
+
this.style.setProperty(name, value, priority);
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
function styleFunction(name, value, priority) {
|
|
436
|
+
return function() {
|
|
437
|
+
var v = value.apply(this, arguments);
|
|
438
|
+
if (v == null) this.style.removeProperty(name);
|
|
439
|
+
else this.style.setProperty(name, v, priority);
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function style_default(name, value, priority) {
|
|
443
|
+
return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
|
|
444
|
+
}
|
|
445
|
+
function styleValue(node, name) {
|
|
446
|
+
return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// node_modules/d3-selection/src/selection/property.js
|
|
450
|
+
function propertyRemove(name) {
|
|
451
|
+
return function() {
|
|
452
|
+
delete this[name];
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
function propertyConstant(name, value) {
|
|
456
|
+
return function() {
|
|
457
|
+
this[name] = value;
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
function propertyFunction(name, value) {
|
|
461
|
+
return function() {
|
|
462
|
+
var v = value.apply(this, arguments);
|
|
463
|
+
if (v == null) delete this[name];
|
|
464
|
+
else this[name] = v;
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function property_default(name, value) {
|
|
468
|
+
return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// node_modules/d3-selection/src/selection/classed.js
|
|
472
|
+
function classArray(string) {
|
|
473
|
+
return string.trim().split(/^|\s+/);
|
|
474
|
+
}
|
|
475
|
+
function classList(node) {
|
|
476
|
+
return node.classList || new ClassList(node);
|
|
477
|
+
}
|
|
478
|
+
function ClassList(node) {
|
|
479
|
+
this._node = node;
|
|
480
|
+
this._names = classArray(node.getAttribute("class") || "");
|
|
481
|
+
}
|
|
482
|
+
ClassList.prototype = {
|
|
483
|
+
add: function(name) {
|
|
484
|
+
var i = this._names.indexOf(name);
|
|
485
|
+
if (i < 0) {
|
|
486
|
+
this._names.push(name);
|
|
487
|
+
this._node.setAttribute("class", this._names.join(" "));
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
remove: function(name) {
|
|
491
|
+
var i = this._names.indexOf(name);
|
|
492
|
+
if (i >= 0) {
|
|
493
|
+
this._names.splice(i, 1);
|
|
494
|
+
this._node.setAttribute("class", this._names.join(" "));
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
contains: function(name) {
|
|
498
|
+
return this._names.indexOf(name) >= 0;
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
function classedAdd(node, names) {
|
|
502
|
+
var list = classList(node), i = -1, n = names.length;
|
|
503
|
+
while (++i < n) list.add(names[i]);
|
|
504
|
+
}
|
|
505
|
+
function classedRemove(node, names) {
|
|
506
|
+
var list = classList(node), i = -1, n = names.length;
|
|
507
|
+
while (++i < n) list.remove(names[i]);
|
|
508
|
+
}
|
|
509
|
+
function classedTrue(names) {
|
|
510
|
+
return function() {
|
|
511
|
+
classedAdd(this, names);
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function classedFalse(names) {
|
|
515
|
+
return function() {
|
|
516
|
+
classedRemove(this, names);
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function classedFunction(names, value) {
|
|
520
|
+
return function() {
|
|
521
|
+
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function classed_default(name, value) {
|
|
525
|
+
var names = classArray(name + "");
|
|
526
|
+
if (arguments.length < 2) {
|
|
527
|
+
var list = classList(this.node()), i = -1, n = names.length;
|
|
528
|
+
while (++i < n) if (!list.contains(names[i])) return false;
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// node_modules/d3-selection/src/selection/text.js
|
|
535
|
+
function textRemove() {
|
|
536
|
+
this.textContent = "";
|
|
537
|
+
}
|
|
538
|
+
function textConstant(value) {
|
|
539
|
+
return function() {
|
|
540
|
+
this.textContent = value;
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function textFunction(value) {
|
|
544
|
+
return function() {
|
|
545
|
+
var v = value.apply(this, arguments);
|
|
546
|
+
this.textContent = v == null ? "" : v;
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function text_default(value) {
|
|
550
|
+
return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// node_modules/d3-selection/src/selection/html.js
|
|
554
|
+
function htmlRemove() {
|
|
555
|
+
this.innerHTML = "";
|
|
556
|
+
}
|
|
557
|
+
function htmlConstant(value) {
|
|
558
|
+
return function() {
|
|
559
|
+
this.innerHTML = value;
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
function htmlFunction(value) {
|
|
563
|
+
return function() {
|
|
564
|
+
var v = value.apply(this, arguments);
|
|
565
|
+
this.innerHTML = v == null ? "" : v;
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function html_default(value) {
|
|
569
|
+
return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// node_modules/d3-selection/src/selection/raise.js
|
|
573
|
+
function raise() {
|
|
574
|
+
if (this.nextSibling) this.parentNode.appendChild(this);
|
|
575
|
+
}
|
|
576
|
+
function raise_default() {
|
|
577
|
+
return this.each(raise);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// node_modules/d3-selection/src/selection/lower.js
|
|
581
|
+
function lower() {
|
|
582
|
+
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
|
583
|
+
}
|
|
584
|
+
function lower_default() {
|
|
585
|
+
return this.each(lower);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// node_modules/d3-selection/src/selection/append.js
|
|
589
|
+
function append_default(name) {
|
|
590
|
+
var create2 = typeof name === "function" ? name : creator_default(name);
|
|
591
|
+
return this.select(function() {
|
|
592
|
+
return this.appendChild(create2.apply(this, arguments));
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// node_modules/d3-selection/src/selection/insert.js
|
|
597
|
+
function constantNull() {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
function insert_default(name, before) {
|
|
601
|
+
var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
|
|
602
|
+
return this.select(function() {
|
|
603
|
+
return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// node_modules/d3-selection/src/selection/remove.js
|
|
608
|
+
function remove() {
|
|
609
|
+
var parent = this.parentNode;
|
|
610
|
+
if (parent) parent.removeChild(this);
|
|
611
|
+
}
|
|
612
|
+
function remove_default() {
|
|
613
|
+
return this.each(remove);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// node_modules/d3-selection/src/selection/clone.js
|
|
617
|
+
function selection_cloneShallow() {
|
|
618
|
+
var clone = this.cloneNode(false), parent = this.parentNode;
|
|
619
|
+
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
620
|
+
}
|
|
621
|
+
function selection_cloneDeep() {
|
|
622
|
+
var clone = this.cloneNode(true), parent = this.parentNode;
|
|
623
|
+
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
624
|
+
}
|
|
625
|
+
function clone_default(deep) {
|
|
626
|
+
return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// node_modules/d3-selection/src/selection/datum.js
|
|
630
|
+
function datum_default(value) {
|
|
631
|
+
return arguments.length ? this.property("__data__", value) : this.node().__data__;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// node_modules/d3-selection/src/selection/on.js
|
|
635
|
+
function contextListener(listener) {
|
|
636
|
+
return function(event) {
|
|
637
|
+
listener.call(this, event, this.__data__);
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function parseTypenames(typenames) {
|
|
641
|
+
return typenames.trim().split(/^|\s+/).map(function(t) {
|
|
642
|
+
var name = "", i = t.indexOf(".");
|
|
643
|
+
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
|
644
|
+
return { type: t, name };
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
function onRemove(typename) {
|
|
648
|
+
return function() {
|
|
649
|
+
var on = this.__on;
|
|
650
|
+
if (!on) return;
|
|
651
|
+
for (var j = 0, i = -1, m2 = on.length, o; j < m2; ++j) {
|
|
652
|
+
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
|
|
653
|
+
this.removeEventListener(o.type, o.listener, o.options);
|
|
654
|
+
} else {
|
|
655
|
+
on[++i] = o;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
if (++i) on.length = i;
|
|
659
|
+
else delete this.__on;
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function onAdd(typename, value, options) {
|
|
663
|
+
return function() {
|
|
664
|
+
var on = this.__on, o, listener = contextListener(value);
|
|
665
|
+
if (on) for (var j = 0, m2 = on.length; j < m2; ++j) {
|
|
666
|
+
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
667
|
+
this.removeEventListener(o.type, o.listener, o.options);
|
|
668
|
+
this.addEventListener(o.type, o.listener = listener, o.options = options);
|
|
669
|
+
o.value = value;
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
this.addEventListener(typename.type, listener, options);
|
|
674
|
+
o = { type: typename.type, name: typename.name, value, listener, options };
|
|
675
|
+
if (!on) this.__on = [o];
|
|
676
|
+
else on.push(o);
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function on_default(typename, value, options) {
|
|
680
|
+
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
|
|
681
|
+
if (arguments.length < 2) {
|
|
682
|
+
var on = this.node().__on;
|
|
683
|
+
if (on) for (var j = 0, m2 = on.length, o; j < m2; ++j) {
|
|
684
|
+
for (i = 0, o = on[j]; i < n; ++i) {
|
|
685
|
+
if ((t = typenames[i]).type === o.type && t.name === o.name) {
|
|
686
|
+
return o.value;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
on = value ? onAdd : onRemove;
|
|
693
|
+
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
|
|
694
|
+
return this;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// node_modules/d3-selection/src/selection/dispatch.js
|
|
698
|
+
function dispatchEvent(node, type, params) {
|
|
699
|
+
var window2 = window_default(node), event = window2.CustomEvent;
|
|
700
|
+
if (typeof event === "function") {
|
|
701
|
+
event = new event(type, params);
|
|
702
|
+
} else {
|
|
703
|
+
event = window2.document.createEvent("Event");
|
|
704
|
+
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
|
|
705
|
+
else event.initEvent(type, false, false);
|
|
706
|
+
}
|
|
707
|
+
node.dispatchEvent(event);
|
|
708
|
+
}
|
|
709
|
+
function dispatchConstant(type, params) {
|
|
710
|
+
return function() {
|
|
711
|
+
return dispatchEvent(this, type, params);
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
function dispatchFunction(type, params) {
|
|
715
|
+
return function() {
|
|
716
|
+
return dispatchEvent(this, type, params.apply(this, arguments));
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
function dispatch_default(type, params) {
|
|
720
|
+
return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// node_modules/d3-selection/src/selection/iterator.js
|
|
724
|
+
function* iterator_default() {
|
|
725
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
726
|
+
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
727
|
+
if (node = group[i]) yield node;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// node_modules/d3-selection/src/selection/index.js
|
|
733
|
+
var root = [null];
|
|
734
|
+
function Selection(groups, parents) {
|
|
735
|
+
this._groups = groups;
|
|
736
|
+
this._parents = parents;
|
|
737
|
+
}
|
|
738
|
+
function selection() {
|
|
739
|
+
return new Selection([[document.documentElement]], root);
|
|
740
|
+
}
|
|
741
|
+
function selection_selection() {
|
|
742
|
+
return this;
|
|
743
|
+
}
|
|
744
|
+
Selection.prototype = selection.prototype = {
|
|
745
|
+
constructor: Selection,
|
|
746
|
+
select: select_default,
|
|
747
|
+
selectAll: selectAll_default,
|
|
748
|
+
selectChild: selectChild_default,
|
|
749
|
+
selectChildren: selectChildren_default,
|
|
750
|
+
filter: filter_default,
|
|
751
|
+
data: data_default,
|
|
752
|
+
enter: enter_default,
|
|
753
|
+
exit: exit_default,
|
|
754
|
+
join: join_default,
|
|
755
|
+
merge: merge_default,
|
|
756
|
+
selection: selection_selection,
|
|
757
|
+
order: order_default,
|
|
758
|
+
sort: sort_default,
|
|
759
|
+
call: call_default,
|
|
760
|
+
nodes: nodes_default,
|
|
761
|
+
node: node_default,
|
|
762
|
+
size: size_default,
|
|
763
|
+
empty: empty_default,
|
|
764
|
+
each: each_default,
|
|
765
|
+
attr: attr_default,
|
|
766
|
+
style: style_default,
|
|
767
|
+
property: property_default,
|
|
768
|
+
classed: classed_default,
|
|
769
|
+
text: text_default,
|
|
770
|
+
html: html_default,
|
|
771
|
+
raise: raise_default,
|
|
772
|
+
lower: lower_default,
|
|
773
|
+
append: append_default,
|
|
774
|
+
insert: insert_default,
|
|
775
|
+
remove: remove_default,
|
|
776
|
+
clone: clone_default,
|
|
777
|
+
datum: datum_default,
|
|
778
|
+
on: on_default,
|
|
779
|
+
dispatch: dispatch_default,
|
|
780
|
+
[Symbol.iterator]: iterator_default
|
|
781
|
+
};
|
|
782
|
+
var selection_default = selection;
|
|
783
|
+
|
|
784
|
+
// node_modules/d3-selection/src/select.js
|
|
785
|
+
function select_default2(selector) {
|
|
786
|
+
return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// node_modules/d3-selection/src/sourceEvent.js
|
|
790
|
+
function sourceEvent_default(event) {
|
|
791
|
+
let sourceEvent;
|
|
792
|
+
while (sourceEvent = event.sourceEvent) event = sourceEvent;
|
|
793
|
+
return event;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// node_modules/d3-selection/src/pointer.js
|
|
797
|
+
function pointer_default(event, node) {
|
|
798
|
+
event = sourceEvent_default(event);
|
|
799
|
+
if (node === void 0) node = event.currentTarget;
|
|
800
|
+
if (node) {
|
|
801
|
+
var svg = node.ownerSVGElement || node;
|
|
802
|
+
if (svg.createSVGPoint) {
|
|
803
|
+
var point = svg.createSVGPoint();
|
|
804
|
+
point.x = event.clientX, point.y = event.clientY;
|
|
805
|
+
point = point.matrixTransform(node.getScreenCTM().inverse());
|
|
806
|
+
return [point.x, point.y];
|
|
807
|
+
}
|
|
808
|
+
if (node.getBoundingClientRect) {
|
|
809
|
+
var rect = node.getBoundingClientRect();
|
|
810
|
+
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
return [event.pageX, event.pageY];
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// node_modules/d3-dispatch/src/dispatch.js
|
|
817
|
+
var noop = { value: () => {
|
|
818
|
+
} };
|
|
819
|
+
function dispatch() {
|
|
820
|
+
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
|
|
821
|
+
if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
|
|
822
|
+
_[t] = [];
|
|
823
|
+
}
|
|
824
|
+
return new Dispatch(_);
|
|
825
|
+
}
|
|
826
|
+
function Dispatch(_) {
|
|
827
|
+
this._ = _;
|
|
828
|
+
}
|
|
829
|
+
function parseTypenames2(typenames, types) {
|
|
830
|
+
return typenames.trim().split(/^|\s+/).map(function(t) {
|
|
831
|
+
var name = "", i = t.indexOf(".");
|
|
832
|
+
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
|
833
|
+
if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
|
834
|
+
return { type: t, name };
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
Dispatch.prototype = dispatch.prototype = {
|
|
838
|
+
constructor: Dispatch,
|
|
839
|
+
on: function(typename, callback) {
|
|
840
|
+
var _ = this._, T = parseTypenames2(typename + "", _), t, i = -1, n = T.length;
|
|
841
|
+
if (arguments.length < 2) {
|
|
842
|
+
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
|
|
846
|
+
while (++i < n) {
|
|
847
|
+
if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);
|
|
848
|
+
else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
|
|
849
|
+
}
|
|
850
|
+
return this;
|
|
851
|
+
},
|
|
852
|
+
copy: function() {
|
|
853
|
+
var copy = {}, _ = this._;
|
|
854
|
+
for (var t in _) copy[t] = _[t].slice();
|
|
855
|
+
return new Dispatch(copy);
|
|
856
|
+
},
|
|
857
|
+
call: function(type, that) {
|
|
858
|
+
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
|
|
859
|
+
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
|
860
|
+
for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
|
861
|
+
},
|
|
862
|
+
apply: function(type, that, args) {
|
|
863
|
+
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
|
864
|
+
for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
function get(type, name) {
|
|
868
|
+
for (var i = 0, n = type.length, c2; i < n; ++i) {
|
|
869
|
+
if ((c2 = type[i]).name === name) {
|
|
870
|
+
return c2.value;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
function set(type, name, callback) {
|
|
875
|
+
for (var i = 0, n = type.length; i < n; ++i) {
|
|
876
|
+
if (type[i].name === name) {
|
|
877
|
+
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
if (callback != null) type.push({ name, value: callback });
|
|
882
|
+
return type;
|
|
883
|
+
}
|
|
884
|
+
var dispatch_default2 = dispatch;
|
|
885
|
+
|
|
886
|
+
// node_modules/d3-timer/src/timer.js
|
|
887
|
+
var frame = 0;
|
|
888
|
+
var timeout = 0;
|
|
889
|
+
var interval = 0;
|
|
890
|
+
var pokeDelay = 1e3;
|
|
891
|
+
var taskHead;
|
|
892
|
+
var taskTail;
|
|
893
|
+
var clockLast = 0;
|
|
894
|
+
var clockNow = 0;
|
|
895
|
+
var clockSkew = 0;
|
|
896
|
+
var clock = typeof performance === "object" && performance.now ? performance : Date;
|
|
897
|
+
var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
|
898
|
+
setTimeout(f, 17);
|
|
899
|
+
};
|
|
900
|
+
function now() {
|
|
901
|
+
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
902
|
+
}
|
|
903
|
+
function clearNow() {
|
|
904
|
+
clockNow = 0;
|
|
905
|
+
}
|
|
906
|
+
function Timer() {
|
|
907
|
+
this._call = this._time = this._next = null;
|
|
908
|
+
}
|
|
909
|
+
Timer.prototype = timer.prototype = {
|
|
910
|
+
constructor: Timer,
|
|
911
|
+
restart: function(callback, delay, time) {
|
|
912
|
+
if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
|
913
|
+
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
|
914
|
+
if (!this._next && taskTail !== this) {
|
|
915
|
+
if (taskTail) taskTail._next = this;
|
|
916
|
+
else taskHead = this;
|
|
917
|
+
taskTail = this;
|
|
918
|
+
}
|
|
919
|
+
this._call = callback;
|
|
920
|
+
this._time = time;
|
|
921
|
+
sleep();
|
|
922
|
+
},
|
|
923
|
+
stop: function() {
|
|
924
|
+
if (this._call) {
|
|
925
|
+
this._call = null;
|
|
926
|
+
this._time = Infinity;
|
|
927
|
+
sleep();
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
function timer(callback, delay, time) {
|
|
932
|
+
var t = new Timer();
|
|
933
|
+
t.restart(callback, delay, time);
|
|
934
|
+
return t;
|
|
935
|
+
}
|
|
936
|
+
function timerFlush() {
|
|
937
|
+
now();
|
|
938
|
+
++frame;
|
|
939
|
+
var t = taskHead, e;
|
|
940
|
+
while (t) {
|
|
941
|
+
if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
|
|
942
|
+
t = t._next;
|
|
943
|
+
}
|
|
944
|
+
--frame;
|
|
945
|
+
}
|
|
946
|
+
function wake() {
|
|
947
|
+
clockNow = (clockLast = clock.now()) + clockSkew;
|
|
948
|
+
frame = timeout = 0;
|
|
949
|
+
try {
|
|
950
|
+
timerFlush();
|
|
951
|
+
} finally {
|
|
952
|
+
frame = 0;
|
|
953
|
+
nap();
|
|
954
|
+
clockNow = 0;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
function poke() {
|
|
958
|
+
var now2 = clock.now(), delay = now2 - clockLast;
|
|
959
|
+
if (delay > pokeDelay) clockSkew -= delay, clockLast = now2;
|
|
960
|
+
}
|
|
961
|
+
function nap() {
|
|
962
|
+
var t0, t1 = taskHead, t2, time = Infinity;
|
|
963
|
+
while (t1) {
|
|
964
|
+
if (t1._call) {
|
|
965
|
+
if (time > t1._time) time = t1._time;
|
|
966
|
+
t0 = t1, t1 = t1._next;
|
|
967
|
+
} else {
|
|
968
|
+
t2 = t1._next, t1._next = null;
|
|
969
|
+
t1 = t0 ? t0._next = t2 : taskHead = t2;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
taskTail = t0;
|
|
973
|
+
sleep(time);
|
|
974
|
+
}
|
|
975
|
+
function sleep(time) {
|
|
976
|
+
if (frame) return;
|
|
977
|
+
if (timeout) timeout = clearTimeout(timeout);
|
|
978
|
+
var delay = time - clockNow;
|
|
979
|
+
if (delay > 24) {
|
|
980
|
+
if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
|
|
981
|
+
if (interval) interval = clearInterval(interval);
|
|
982
|
+
} else {
|
|
983
|
+
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
|
984
|
+
frame = 1, setFrame(wake);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// node_modules/d3-timer/src/timeout.js
|
|
989
|
+
function timeout_default(callback, delay, time) {
|
|
990
|
+
var t = new Timer();
|
|
991
|
+
delay = delay == null ? 0 : +delay;
|
|
992
|
+
t.restart((elapsed) => {
|
|
993
|
+
t.stop();
|
|
994
|
+
callback(elapsed + delay);
|
|
995
|
+
}, delay, time);
|
|
996
|
+
return t;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// node_modules/d3-transition/src/transition/schedule.js
|
|
1000
|
+
var emptyOn = dispatch_default2("start", "end", "cancel", "interrupt");
|
|
1001
|
+
var emptyTween = [];
|
|
1002
|
+
var CREATED = 0;
|
|
1003
|
+
var SCHEDULED = 1;
|
|
1004
|
+
var STARTING = 2;
|
|
1005
|
+
var STARTED = 3;
|
|
1006
|
+
var RUNNING = 4;
|
|
1007
|
+
var ENDING = 5;
|
|
1008
|
+
var ENDED = 6;
|
|
1009
|
+
function schedule_default(node, name, id2, index2, group, timing) {
|
|
1010
|
+
var schedules = node.__transition;
|
|
1011
|
+
if (!schedules) node.__transition = {};
|
|
1012
|
+
else if (id2 in schedules) return;
|
|
1013
|
+
create(node, id2, {
|
|
1014
|
+
name,
|
|
1015
|
+
index: index2,
|
|
1016
|
+
// For context during callback.
|
|
1017
|
+
group,
|
|
1018
|
+
// For context during callback.
|
|
1019
|
+
on: emptyOn,
|
|
1020
|
+
tween: emptyTween,
|
|
1021
|
+
time: timing.time,
|
|
1022
|
+
delay: timing.delay,
|
|
1023
|
+
duration: timing.duration,
|
|
1024
|
+
ease: timing.ease,
|
|
1025
|
+
timer: null,
|
|
1026
|
+
state: CREATED
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
function init(node, id2) {
|
|
1030
|
+
var schedule = get2(node, id2);
|
|
1031
|
+
if (schedule.state > CREATED) throw new Error("too late; already scheduled");
|
|
1032
|
+
return schedule;
|
|
1033
|
+
}
|
|
1034
|
+
function set2(node, id2) {
|
|
1035
|
+
var schedule = get2(node, id2);
|
|
1036
|
+
if (schedule.state > STARTED) throw new Error("too late; already running");
|
|
1037
|
+
return schedule;
|
|
1038
|
+
}
|
|
1039
|
+
function get2(node, id2) {
|
|
1040
|
+
var schedule = node.__transition;
|
|
1041
|
+
if (!schedule || !(schedule = schedule[id2])) throw new Error("transition not found");
|
|
1042
|
+
return schedule;
|
|
1043
|
+
}
|
|
1044
|
+
function create(node, id2, self) {
|
|
1045
|
+
var schedules = node.__transition, tween;
|
|
1046
|
+
schedules[id2] = self;
|
|
1047
|
+
self.timer = timer(schedule, 0, self.time);
|
|
1048
|
+
function schedule(elapsed) {
|
|
1049
|
+
self.state = SCHEDULED;
|
|
1050
|
+
self.timer.restart(start2, self.delay, self.time);
|
|
1051
|
+
if (self.delay <= elapsed) start2(elapsed - self.delay);
|
|
1052
|
+
}
|
|
1053
|
+
function start2(elapsed) {
|
|
1054
|
+
var i, j, n, o;
|
|
1055
|
+
if (self.state !== SCHEDULED) return stop();
|
|
1056
|
+
for (i in schedules) {
|
|
1057
|
+
o = schedules[i];
|
|
1058
|
+
if (o.name !== self.name) continue;
|
|
1059
|
+
if (o.state === STARTED) return timeout_default(start2);
|
|
1060
|
+
if (o.state === RUNNING) {
|
|
1061
|
+
o.state = ENDED;
|
|
1062
|
+
o.timer.stop();
|
|
1063
|
+
o.on.call("interrupt", node, node.__data__, o.index, o.group);
|
|
1064
|
+
delete schedules[i];
|
|
1065
|
+
} else if (+i < id2) {
|
|
1066
|
+
o.state = ENDED;
|
|
1067
|
+
o.timer.stop();
|
|
1068
|
+
o.on.call("cancel", node, node.__data__, o.index, o.group);
|
|
1069
|
+
delete schedules[i];
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
timeout_default(function() {
|
|
1073
|
+
if (self.state === STARTED) {
|
|
1074
|
+
self.state = RUNNING;
|
|
1075
|
+
self.timer.restart(tick, self.delay, self.time);
|
|
1076
|
+
tick(elapsed);
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
self.state = STARTING;
|
|
1080
|
+
self.on.call("start", node, node.__data__, self.index, self.group);
|
|
1081
|
+
if (self.state !== STARTING) return;
|
|
1082
|
+
self.state = STARTED;
|
|
1083
|
+
tween = new Array(n = self.tween.length);
|
|
1084
|
+
for (i = 0, j = -1; i < n; ++i) {
|
|
1085
|
+
if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
|
|
1086
|
+
tween[++j] = o;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
tween.length = j + 1;
|
|
1090
|
+
}
|
|
1091
|
+
function tick(elapsed) {
|
|
1092
|
+
var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length;
|
|
1093
|
+
while (++i < n) {
|
|
1094
|
+
tween[i].call(node, t);
|
|
1095
|
+
}
|
|
1096
|
+
if (self.state === ENDING) {
|
|
1097
|
+
self.on.call("end", node, node.__data__, self.index, self.group);
|
|
1098
|
+
stop();
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
function stop() {
|
|
1102
|
+
self.state = ENDED;
|
|
1103
|
+
self.timer.stop();
|
|
1104
|
+
delete schedules[id2];
|
|
1105
|
+
for (var i in schedules) return;
|
|
1106
|
+
delete node.__transition;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// node_modules/d3-transition/src/interrupt.js
|
|
1111
|
+
function interrupt_default(node, name) {
|
|
1112
|
+
var schedules = node.__transition, schedule, active, empty2 = true, i;
|
|
1113
|
+
if (!schedules) return;
|
|
1114
|
+
name = name == null ? null : name + "";
|
|
1115
|
+
for (i in schedules) {
|
|
1116
|
+
if ((schedule = schedules[i]).name !== name) {
|
|
1117
|
+
empty2 = false;
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
active = schedule.state > STARTING && schedule.state < ENDING;
|
|
1121
|
+
schedule.state = ENDED;
|
|
1122
|
+
schedule.timer.stop();
|
|
1123
|
+
schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
|
|
1124
|
+
delete schedules[i];
|
|
1125
|
+
}
|
|
1126
|
+
if (empty2) delete node.__transition;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// node_modules/d3-transition/src/selection/interrupt.js
|
|
1130
|
+
function interrupt_default2(name) {
|
|
1131
|
+
return this.each(function() {
|
|
1132
|
+
interrupt_default(this, name);
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// node_modules/d3-color/src/define.js
|
|
1137
|
+
function define_default(constructor, factory, prototype) {
|
|
1138
|
+
constructor.prototype = factory.prototype = prototype;
|
|
1139
|
+
prototype.constructor = constructor;
|
|
1140
|
+
}
|
|
1141
|
+
function extend(parent, definition) {
|
|
1142
|
+
var prototype = Object.create(parent.prototype);
|
|
1143
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
1144
|
+
return prototype;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// node_modules/d3-color/src/color.js
|
|
1148
|
+
function Color() {
|
|
1149
|
+
}
|
|
1150
|
+
var darker = 0.7;
|
|
1151
|
+
var brighter = 1 / darker;
|
|
1152
|
+
var reI = "\\s*([+-]?\\d+)\\s*";
|
|
1153
|
+
var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
|
|
1154
|
+
var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
|
|
1155
|
+
var reHex = /^#([0-9a-f]{3,8})$/;
|
|
1156
|
+
var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
|
|
1157
|
+
var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
|
|
1158
|
+
var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
|
|
1159
|
+
var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
|
|
1160
|
+
var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
|
|
1161
|
+
var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
1162
|
+
var named = {
|
|
1163
|
+
aliceblue: 15792383,
|
|
1164
|
+
antiquewhite: 16444375,
|
|
1165
|
+
aqua: 65535,
|
|
1166
|
+
aquamarine: 8388564,
|
|
1167
|
+
azure: 15794175,
|
|
1168
|
+
beige: 16119260,
|
|
1169
|
+
bisque: 16770244,
|
|
1170
|
+
black: 0,
|
|
1171
|
+
blanchedalmond: 16772045,
|
|
1172
|
+
blue: 255,
|
|
1173
|
+
blueviolet: 9055202,
|
|
1174
|
+
brown: 10824234,
|
|
1175
|
+
burlywood: 14596231,
|
|
1176
|
+
cadetblue: 6266528,
|
|
1177
|
+
chartreuse: 8388352,
|
|
1178
|
+
chocolate: 13789470,
|
|
1179
|
+
coral: 16744272,
|
|
1180
|
+
cornflowerblue: 6591981,
|
|
1181
|
+
cornsilk: 16775388,
|
|
1182
|
+
crimson: 14423100,
|
|
1183
|
+
cyan: 65535,
|
|
1184
|
+
darkblue: 139,
|
|
1185
|
+
darkcyan: 35723,
|
|
1186
|
+
darkgoldenrod: 12092939,
|
|
1187
|
+
darkgray: 11119017,
|
|
1188
|
+
darkgreen: 25600,
|
|
1189
|
+
darkgrey: 11119017,
|
|
1190
|
+
darkkhaki: 12433259,
|
|
1191
|
+
darkmagenta: 9109643,
|
|
1192
|
+
darkolivegreen: 5597999,
|
|
1193
|
+
darkorange: 16747520,
|
|
1194
|
+
darkorchid: 10040012,
|
|
1195
|
+
darkred: 9109504,
|
|
1196
|
+
darksalmon: 15308410,
|
|
1197
|
+
darkseagreen: 9419919,
|
|
1198
|
+
darkslateblue: 4734347,
|
|
1199
|
+
darkslategray: 3100495,
|
|
1200
|
+
darkslategrey: 3100495,
|
|
1201
|
+
darkturquoise: 52945,
|
|
1202
|
+
darkviolet: 9699539,
|
|
1203
|
+
deeppink: 16716947,
|
|
1204
|
+
deepskyblue: 49151,
|
|
1205
|
+
dimgray: 6908265,
|
|
1206
|
+
dimgrey: 6908265,
|
|
1207
|
+
dodgerblue: 2003199,
|
|
1208
|
+
firebrick: 11674146,
|
|
1209
|
+
floralwhite: 16775920,
|
|
1210
|
+
forestgreen: 2263842,
|
|
1211
|
+
fuchsia: 16711935,
|
|
1212
|
+
gainsboro: 14474460,
|
|
1213
|
+
ghostwhite: 16316671,
|
|
1214
|
+
gold: 16766720,
|
|
1215
|
+
goldenrod: 14329120,
|
|
1216
|
+
gray: 8421504,
|
|
1217
|
+
green: 32768,
|
|
1218
|
+
greenyellow: 11403055,
|
|
1219
|
+
grey: 8421504,
|
|
1220
|
+
honeydew: 15794160,
|
|
1221
|
+
hotpink: 16738740,
|
|
1222
|
+
indianred: 13458524,
|
|
1223
|
+
indigo: 4915330,
|
|
1224
|
+
ivory: 16777200,
|
|
1225
|
+
khaki: 15787660,
|
|
1226
|
+
lavender: 15132410,
|
|
1227
|
+
lavenderblush: 16773365,
|
|
1228
|
+
lawngreen: 8190976,
|
|
1229
|
+
lemonchiffon: 16775885,
|
|
1230
|
+
lightblue: 11393254,
|
|
1231
|
+
lightcoral: 15761536,
|
|
1232
|
+
lightcyan: 14745599,
|
|
1233
|
+
lightgoldenrodyellow: 16448210,
|
|
1234
|
+
lightgray: 13882323,
|
|
1235
|
+
lightgreen: 9498256,
|
|
1236
|
+
lightgrey: 13882323,
|
|
1237
|
+
lightpink: 16758465,
|
|
1238
|
+
lightsalmon: 16752762,
|
|
1239
|
+
lightseagreen: 2142890,
|
|
1240
|
+
lightskyblue: 8900346,
|
|
1241
|
+
lightslategray: 7833753,
|
|
1242
|
+
lightslategrey: 7833753,
|
|
1243
|
+
lightsteelblue: 11584734,
|
|
1244
|
+
lightyellow: 16777184,
|
|
1245
|
+
lime: 65280,
|
|
1246
|
+
limegreen: 3329330,
|
|
1247
|
+
linen: 16445670,
|
|
1248
|
+
magenta: 16711935,
|
|
1249
|
+
maroon: 8388608,
|
|
1250
|
+
mediumaquamarine: 6737322,
|
|
1251
|
+
mediumblue: 205,
|
|
1252
|
+
mediumorchid: 12211667,
|
|
1253
|
+
mediumpurple: 9662683,
|
|
1254
|
+
mediumseagreen: 3978097,
|
|
1255
|
+
mediumslateblue: 8087790,
|
|
1256
|
+
mediumspringgreen: 64154,
|
|
1257
|
+
mediumturquoise: 4772300,
|
|
1258
|
+
mediumvioletred: 13047173,
|
|
1259
|
+
midnightblue: 1644912,
|
|
1260
|
+
mintcream: 16121850,
|
|
1261
|
+
mistyrose: 16770273,
|
|
1262
|
+
moccasin: 16770229,
|
|
1263
|
+
navajowhite: 16768685,
|
|
1264
|
+
navy: 128,
|
|
1265
|
+
oldlace: 16643558,
|
|
1266
|
+
olive: 8421376,
|
|
1267
|
+
olivedrab: 7048739,
|
|
1268
|
+
orange: 16753920,
|
|
1269
|
+
orangered: 16729344,
|
|
1270
|
+
orchid: 14315734,
|
|
1271
|
+
palegoldenrod: 15657130,
|
|
1272
|
+
palegreen: 10025880,
|
|
1273
|
+
paleturquoise: 11529966,
|
|
1274
|
+
palevioletred: 14381203,
|
|
1275
|
+
papayawhip: 16773077,
|
|
1276
|
+
peachpuff: 16767673,
|
|
1277
|
+
peru: 13468991,
|
|
1278
|
+
pink: 16761035,
|
|
1279
|
+
plum: 14524637,
|
|
1280
|
+
powderblue: 11591910,
|
|
1281
|
+
purple: 8388736,
|
|
1282
|
+
rebeccapurple: 6697881,
|
|
1283
|
+
red: 16711680,
|
|
1284
|
+
rosybrown: 12357519,
|
|
1285
|
+
royalblue: 4286945,
|
|
1286
|
+
saddlebrown: 9127187,
|
|
1287
|
+
salmon: 16416882,
|
|
1288
|
+
sandybrown: 16032864,
|
|
1289
|
+
seagreen: 3050327,
|
|
1290
|
+
seashell: 16774638,
|
|
1291
|
+
sienna: 10506797,
|
|
1292
|
+
silver: 12632256,
|
|
1293
|
+
skyblue: 8900331,
|
|
1294
|
+
slateblue: 6970061,
|
|
1295
|
+
slategray: 7372944,
|
|
1296
|
+
slategrey: 7372944,
|
|
1297
|
+
snow: 16775930,
|
|
1298
|
+
springgreen: 65407,
|
|
1299
|
+
steelblue: 4620980,
|
|
1300
|
+
tan: 13808780,
|
|
1301
|
+
teal: 32896,
|
|
1302
|
+
thistle: 14204888,
|
|
1303
|
+
tomato: 16737095,
|
|
1304
|
+
turquoise: 4251856,
|
|
1305
|
+
violet: 15631086,
|
|
1306
|
+
wheat: 16113331,
|
|
1307
|
+
white: 16777215,
|
|
1308
|
+
whitesmoke: 16119285,
|
|
1309
|
+
yellow: 16776960,
|
|
1310
|
+
yellowgreen: 10145074
|
|
1311
|
+
};
|
|
1312
|
+
define_default(Color, color, {
|
|
1313
|
+
copy(channels) {
|
|
1314
|
+
return Object.assign(new this.constructor(), this, channels);
|
|
1315
|
+
},
|
|
1316
|
+
displayable() {
|
|
1317
|
+
return this.rgb().displayable();
|
|
1318
|
+
},
|
|
1319
|
+
hex: color_formatHex,
|
|
1320
|
+
// Deprecated! Use color.formatHex.
|
|
1321
|
+
formatHex: color_formatHex,
|
|
1322
|
+
formatHex8: color_formatHex8,
|
|
1323
|
+
formatHsl: color_formatHsl,
|
|
1324
|
+
formatRgb: color_formatRgb,
|
|
1325
|
+
toString: color_formatRgb
|
|
1326
|
+
});
|
|
1327
|
+
function color_formatHex() {
|
|
1328
|
+
return this.rgb().formatHex();
|
|
1329
|
+
}
|
|
1330
|
+
function color_formatHex8() {
|
|
1331
|
+
return this.rgb().formatHex8();
|
|
1332
|
+
}
|
|
1333
|
+
function color_formatHsl() {
|
|
1334
|
+
return hslConvert(this).formatHsl();
|
|
1335
|
+
}
|
|
1336
|
+
function color_formatRgb() {
|
|
1337
|
+
return this.rgb().formatRgb();
|
|
1338
|
+
}
|
|
1339
|
+
function color(format) {
|
|
1340
|
+
var m2, l;
|
|
1341
|
+
format = (format + "").trim().toLowerCase();
|
|
1342
|
+
return (m2 = reHex.exec(format)) ? (l = m2[1].length, m2 = parseInt(m2[1], 16), l === 6 ? rgbn(m2) : l === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
1343
|
+
}
|
|
1344
|
+
function rgbn(n) {
|
|
1345
|
+
return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
|
1346
|
+
}
|
|
1347
|
+
function rgba(r, g, b, a2) {
|
|
1348
|
+
if (a2 <= 0) r = g = b = NaN;
|
|
1349
|
+
return new Rgb(r, g, b, a2);
|
|
1350
|
+
}
|
|
1351
|
+
function rgbConvert(o) {
|
|
1352
|
+
if (!(o instanceof Color)) o = color(o);
|
|
1353
|
+
if (!o) return new Rgb();
|
|
1354
|
+
o = o.rgb();
|
|
1355
|
+
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
1356
|
+
}
|
|
1357
|
+
function rgb(r, g, b, opacity) {
|
|
1358
|
+
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
1359
|
+
}
|
|
1360
|
+
function Rgb(r, g, b, opacity) {
|
|
1361
|
+
this.r = +r;
|
|
1362
|
+
this.g = +g;
|
|
1363
|
+
this.b = +b;
|
|
1364
|
+
this.opacity = +opacity;
|
|
1365
|
+
}
|
|
1366
|
+
define_default(Rgb, rgb, extend(Color, {
|
|
1367
|
+
brighter(k) {
|
|
1368
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1369
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1370
|
+
},
|
|
1371
|
+
darker(k) {
|
|
1372
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
1373
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1374
|
+
},
|
|
1375
|
+
rgb() {
|
|
1376
|
+
return this;
|
|
1377
|
+
},
|
|
1378
|
+
clamp() {
|
|
1379
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
1380
|
+
},
|
|
1381
|
+
displayable() {
|
|
1382
|
+
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
|
|
1383
|
+
},
|
|
1384
|
+
hex: rgb_formatHex,
|
|
1385
|
+
// Deprecated! Use color.formatHex.
|
|
1386
|
+
formatHex: rgb_formatHex,
|
|
1387
|
+
formatHex8: rgb_formatHex8,
|
|
1388
|
+
formatRgb: rgb_formatRgb,
|
|
1389
|
+
toString: rgb_formatRgb
|
|
1390
|
+
}));
|
|
1391
|
+
function rgb_formatHex() {
|
|
1392
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
1393
|
+
}
|
|
1394
|
+
function rgb_formatHex8() {
|
|
1395
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1396
|
+
}
|
|
1397
|
+
function rgb_formatRgb() {
|
|
1398
|
+
const a2 = clampa(this.opacity);
|
|
1399
|
+
return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
|
|
1400
|
+
}
|
|
1401
|
+
function clampa(opacity) {
|
|
1402
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
1403
|
+
}
|
|
1404
|
+
function clampi(value) {
|
|
1405
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
1406
|
+
}
|
|
1407
|
+
function hex(value) {
|
|
1408
|
+
value = clampi(value);
|
|
1409
|
+
return (value < 16 ? "0" : "") + value.toString(16);
|
|
1410
|
+
}
|
|
1411
|
+
function hsla(h, s, l, a2) {
|
|
1412
|
+
if (a2 <= 0) h = s = l = NaN;
|
|
1413
|
+
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
1414
|
+
else if (s <= 0) h = NaN;
|
|
1415
|
+
return new Hsl(h, s, l, a2);
|
|
1416
|
+
}
|
|
1417
|
+
function hslConvert(o) {
|
|
1418
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
1419
|
+
if (!(o instanceof Color)) o = color(o);
|
|
1420
|
+
if (!o) return new Hsl();
|
|
1421
|
+
if (o instanceof Hsl) return o;
|
|
1422
|
+
o = o.rgb();
|
|
1423
|
+
var r = o.r / 255, g = o.g / 255, b = o.b / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), h = NaN, s = max - min, l = (max + min) / 2;
|
|
1424
|
+
if (s) {
|
|
1425
|
+
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
1426
|
+
else if (g === max) h = (b - r) / s + 2;
|
|
1427
|
+
else h = (r - g) / s + 4;
|
|
1428
|
+
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
1429
|
+
h *= 60;
|
|
1430
|
+
} else {
|
|
1431
|
+
s = l > 0 && l < 1 ? 0 : h;
|
|
1432
|
+
}
|
|
1433
|
+
return new Hsl(h, s, l, o.opacity);
|
|
1434
|
+
}
|
|
1435
|
+
function hsl(h, s, l, opacity) {
|
|
1436
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
1437
|
+
}
|
|
1438
|
+
function Hsl(h, s, l, opacity) {
|
|
1439
|
+
this.h = +h;
|
|
1440
|
+
this.s = +s;
|
|
1441
|
+
this.l = +l;
|
|
1442
|
+
this.opacity = +opacity;
|
|
1443
|
+
}
|
|
1444
|
+
define_default(Hsl, hsl, extend(Color, {
|
|
1445
|
+
brighter(k) {
|
|
1446
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1447
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1448
|
+
},
|
|
1449
|
+
darker(k) {
|
|
1450
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
1451
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1452
|
+
},
|
|
1453
|
+
rgb() {
|
|
1454
|
+
var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
|
1455
|
+
return new Rgb(
|
|
1456
|
+
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
1457
|
+
hsl2rgb(h, m1, m2),
|
|
1458
|
+
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
1459
|
+
this.opacity
|
|
1460
|
+
);
|
|
1461
|
+
},
|
|
1462
|
+
clamp() {
|
|
1463
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
1464
|
+
},
|
|
1465
|
+
displayable() {
|
|
1466
|
+
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
|
|
1467
|
+
},
|
|
1468
|
+
formatHsl() {
|
|
1469
|
+
const a2 = clampa(this.opacity);
|
|
1470
|
+
return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
|
|
1471
|
+
}
|
|
1472
|
+
}));
|
|
1473
|
+
function clamph(value) {
|
|
1474
|
+
value = (value || 0) % 360;
|
|
1475
|
+
return value < 0 ? value + 360 : value;
|
|
1476
|
+
}
|
|
1477
|
+
function clampt(value) {
|
|
1478
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
1479
|
+
}
|
|
1480
|
+
function hsl2rgb(h, m1, m2) {
|
|
1481
|
+
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
// node_modules/d3-interpolate/src/basis.js
|
|
1485
|
+
function basis(t1, v0, v1, v2, v3) {
|
|
1486
|
+
var t2 = t1 * t1, t3 = t2 * t1;
|
|
1487
|
+
return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
|
|
1488
|
+
}
|
|
1489
|
+
function basis_default(values) {
|
|
1490
|
+
var n = values.length - 1;
|
|
1491
|
+
return function(t) {
|
|
1492
|
+
var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), v1 = values[i], v2 = values[i + 1], v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
|
1493
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
// node_modules/d3-interpolate/src/basisClosed.js
|
|
1498
|
+
function basisClosed_default(values) {
|
|
1499
|
+
var n = values.length;
|
|
1500
|
+
return function(t) {
|
|
1501
|
+
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), v0 = values[(i + n - 1) % n], v1 = values[i % n], v2 = values[(i + 1) % n], v3 = values[(i + 2) % n];
|
|
1502
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// node_modules/d3-interpolate/src/constant.js
|
|
1507
|
+
var constant_default2 = (x3) => () => x3;
|
|
1508
|
+
|
|
1509
|
+
// node_modules/d3-interpolate/src/color.js
|
|
1510
|
+
function linear(a2, d) {
|
|
1511
|
+
return function(t) {
|
|
1512
|
+
return a2 + t * d;
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
function exponential(a2, b, y3) {
|
|
1516
|
+
return a2 = Math.pow(a2, y3), b = Math.pow(b, y3) - a2, y3 = 1 / y3, function(t) {
|
|
1517
|
+
return Math.pow(a2 + t * b, y3);
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
function gamma(y3) {
|
|
1521
|
+
return (y3 = +y3) === 1 ? nogamma : function(a2, b) {
|
|
1522
|
+
return b - a2 ? exponential(a2, b, y3) : constant_default2(isNaN(a2) ? b : a2);
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
function nogamma(a2, b) {
|
|
1526
|
+
var d = b - a2;
|
|
1527
|
+
return d ? linear(a2, d) : constant_default2(isNaN(a2) ? b : a2);
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
// node_modules/d3-interpolate/src/rgb.js
|
|
1531
|
+
var rgb_default = (function rgbGamma(y3) {
|
|
1532
|
+
var color2 = gamma(y3);
|
|
1533
|
+
function rgb2(start2, end) {
|
|
1534
|
+
var r = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
|
1535
|
+
return function(t) {
|
|
1536
|
+
start2.r = r(t);
|
|
1537
|
+
start2.g = g(t);
|
|
1538
|
+
start2.b = b(t);
|
|
1539
|
+
start2.opacity = opacity(t);
|
|
1540
|
+
return start2 + "";
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
rgb2.gamma = rgbGamma;
|
|
1544
|
+
return rgb2;
|
|
1545
|
+
})(1);
|
|
1546
|
+
function rgbSpline(spline) {
|
|
1547
|
+
return function(colors) {
|
|
1548
|
+
var n = colors.length, r = new Array(n), g = new Array(n), b = new Array(n), i, color2;
|
|
1549
|
+
for (i = 0; i < n; ++i) {
|
|
1550
|
+
color2 = rgb(colors[i]);
|
|
1551
|
+
r[i] = color2.r || 0;
|
|
1552
|
+
g[i] = color2.g || 0;
|
|
1553
|
+
b[i] = color2.b || 0;
|
|
1554
|
+
}
|
|
1555
|
+
r = spline(r);
|
|
1556
|
+
g = spline(g);
|
|
1557
|
+
b = spline(b);
|
|
1558
|
+
color2.opacity = 1;
|
|
1559
|
+
return function(t) {
|
|
1560
|
+
color2.r = r(t);
|
|
1561
|
+
color2.g = g(t);
|
|
1562
|
+
color2.b = b(t);
|
|
1563
|
+
return color2 + "";
|
|
1564
|
+
};
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
var rgbBasis = rgbSpline(basis_default);
|
|
1568
|
+
var rgbBasisClosed = rgbSpline(basisClosed_default);
|
|
1569
|
+
|
|
1570
|
+
// node_modules/d3-interpolate/src/number.js
|
|
1571
|
+
function number_default(a2, b) {
|
|
1572
|
+
return a2 = +a2, b = +b, function(t) {
|
|
1573
|
+
return a2 * (1 - t) + b * t;
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// node_modules/d3-interpolate/src/string.js
|
|
1578
|
+
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
|
|
1579
|
+
var reB = new RegExp(reA.source, "g");
|
|
1580
|
+
function zero(b) {
|
|
1581
|
+
return function() {
|
|
1582
|
+
return b;
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
function one(b) {
|
|
1586
|
+
return function(t) {
|
|
1587
|
+
return b(t) + "";
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
function string_default(a2, b) {
|
|
1591
|
+
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
|
|
1592
|
+
a2 = a2 + "", b = b + "";
|
|
1593
|
+
while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
|
|
1594
|
+
if ((bs = bm.index) > bi) {
|
|
1595
|
+
bs = b.slice(bi, bs);
|
|
1596
|
+
if (s[i]) s[i] += bs;
|
|
1597
|
+
else s[++i] = bs;
|
|
1598
|
+
}
|
|
1599
|
+
if ((am = am[0]) === (bm = bm[0])) {
|
|
1600
|
+
if (s[i]) s[i] += bm;
|
|
1601
|
+
else s[++i] = bm;
|
|
1602
|
+
} else {
|
|
1603
|
+
s[++i] = null;
|
|
1604
|
+
q.push({ i, x: number_default(am, bm) });
|
|
1605
|
+
}
|
|
1606
|
+
bi = reB.lastIndex;
|
|
1607
|
+
}
|
|
1608
|
+
if (bi < b.length) {
|
|
1609
|
+
bs = b.slice(bi);
|
|
1610
|
+
if (s[i]) s[i] += bs;
|
|
1611
|
+
else s[++i] = bs;
|
|
1612
|
+
}
|
|
1613
|
+
return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
|
|
1614
|
+
for (var i2 = 0, o; i2 < b; ++i2) s[(o = q[i2]).i] = o.x(t);
|
|
1615
|
+
return s.join("");
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// node_modules/d3-interpolate/src/transform/decompose.js
|
|
1620
|
+
var degrees = 180 / Math.PI;
|
|
1621
|
+
var identity = {
|
|
1622
|
+
translateX: 0,
|
|
1623
|
+
translateY: 0,
|
|
1624
|
+
rotate: 0,
|
|
1625
|
+
skewX: 0,
|
|
1626
|
+
scaleX: 1,
|
|
1627
|
+
scaleY: 1
|
|
1628
|
+
};
|
|
1629
|
+
function decompose_default(a2, b, c2, d, e, f) {
|
|
1630
|
+
var scaleX, scaleY, skewX;
|
|
1631
|
+
if (scaleX = Math.sqrt(a2 * a2 + b * b)) a2 /= scaleX, b /= scaleX;
|
|
1632
|
+
if (skewX = a2 * c2 + b * d) c2 -= a2 * skewX, d -= b * skewX;
|
|
1633
|
+
if (scaleY = Math.sqrt(c2 * c2 + d * d)) c2 /= scaleY, d /= scaleY, skewX /= scaleY;
|
|
1634
|
+
if (a2 * d < b * c2) a2 = -a2, b = -b, skewX = -skewX, scaleX = -scaleX;
|
|
1635
|
+
return {
|
|
1636
|
+
translateX: e,
|
|
1637
|
+
translateY: f,
|
|
1638
|
+
rotate: Math.atan2(b, a2) * degrees,
|
|
1639
|
+
skewX: Math.atan(skewX) * degrees,
|
|
1640
|
+
scaleX,
|
|
1641
|
+
scaleY
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
// node_modules/d3-interpolate/src/transform/parse.js
|
|
1646
|
+
var svgNode;
|
|
1647
|
+
function parseCss(value) {
|
|
1648
|
+
const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
1649
|
+
return m2.isIdentity ? identity : decompose_default(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
|
|
1650
|
+
}
|
|
1651
|
+
function parseSvg(value) {
|
|
1652
|
+
if (value == null) return identity;
|
|
1653
|
+
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1654
|
+
svgNode.setAttribute("transform", value);
|
|
1655
|
+
if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
|
|
1656
|
+
value = value.matrix;
|
|
1657
|
+
return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
// node_modules/d3-interpolate/src/transform/index.js
|
|
1661
|
+
function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
1662
|
+
function pop(s) {
|
|
1663
|
+
return s.length ? s.pop() + " " : "";
|
|
1664
|
+
}
|
|
1665
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
1666
|
+
if (xa !== xb || ya !== yb) {
|
|
1667
|
+
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
1668
|
+
q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) });
|
|
1669
|
+
} else if (xb || yb) {
|
|
1670
|
+
s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
function rotate(a2, b, s, q) {
|
|
1674
|
+
if (a2 !== b) {
|
|
1675
|
+
if (a2 - b > 180) b += 360;
|
|
1676
|
+
else if (b - a2 > 180) a2 += 360;
|
|
1677
|
+
q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number_default(a2, b) });
|
|
1678
|
+
} else if (b) {
|
|
1679
|
+
s.push(pop(s) + "rotate(" + b + degParen);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
function skewX(a2, b, s, q) {
|
|
1683
|
+
if (a2 !== b) {
|
|
1684
|
+
q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number_default(a2, b) });
|
|
1685
|
+
} else if (b) {
|
|
1686
|
+
s.push(pop(s) + "skewX(" + b + degParen);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
function scale(xa, ya, xb, yb, s, q) {
|
|
1690
|
+
if (xa !== xb || ya !== yb) {
|
|
1691
|
+
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
1692
|
+
q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) });
|
|
1693
|
+
} else if (xb !== 1 || yb !== 1) {
|
|
1694
|
+
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
return function(a2, b) {
|
|
1698
|
+
var s = [], q = [];
|
|
1699
|
+
a2 = parse(a2), b = parse(b);
|
|
1700
|
+
translate(a2.translateX, a2.translateY, b.translateX, b.translateY, s, q);
|
|
1701
|
+
rotate(a2.rotate, b.rotate, s, q);
|
|
1702
|
+
skewX(a2.skewX, b.skewX, s, q);
|
|
1703
|
+
scale(a2.scaleX, a2.scaleY, b.scaleX, b.scaleY, s, q);
|
|
1704
|
+
a2 = b = null;
|
|
1705
|
+
return function(t) {
|
|
1706
|
+
var i = -1, n = q.length, o;
|
|
1707
|
+
while (++i < n) s[(o = q[i]).i] = o.x(t);
|
|
1708
|
+
return s.join("");
|
|
1709
|
+
};
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
|
1713
|
+
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
|
1714
|
+
|
|
1715
|
+
// node_modules/d3-interpolate/src/zoom.js
|
|
1716
|
+
var epsilon2 = 1e-12;
|
|
1717
|
+
function cosh(x3) {
|
|
1718
|
+
return ((x3 = Math.exp(x3)) + 1 / x3) / 2;
|
|
1719
|
+
}
|
|
1720
|
+
function sinh(x3) {
|
|
1721
|
+
return ((x3 = Math.exp(x3)) - 1 / x3) / 2;
|
|
1722
|
+
}
|
|
1723
|
+
function tanh(x3) {
|
|
1724
|
+
return ((x3 = Math.exp(2 * x3)) - 1) / (x3 + 1);
|
|
1725
|
+
}
|
|
1726
|
+
var zoom_default = (function zoomRho(rho, rho2, rho4) {
|
|
1727
|
+
function zoom(p0, p1) {
|
|
1728
|
+
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
|
|
1729
|
+
if (d2 < epsilon2) {
|
|
1730
|
+
S = Math.log(w1 / w0) / rho;
|
|
1731
|
+
i = function(t) {
|
|
1732
|
+
return [
|
|
1733
|
+
ux0 + t * dx,
|
|
1734
|
+
uy0 + t * dy,
|
|
1735
|
+
w0 * Math.exp(rho * t * S)
|
|
1736
|
+
];
|
|
1737
|
+
};
|
|
1738
|
+
} else {
|
|
1739
|
+
var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
1740
|
+
S = (r1 - r0) / rho;
|
|
1741
|
+
i = function(t) {
|
|
1742
|
+
var s = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
1743
|
+
return [
|
|
1744
|
+
ux0 + u * dx,
|
|
1745
|
+
uy0 + u * dy,
|
|
1746
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
1747
|
+
];
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
i.duration = S * 1e3 * rho / Math.SQRT2;
|
|
1751
|
+
return i;
|
|
1752
|
+
}
|
|
1753
|
+
zoom.rho = function(_) {
|
|
1754
|
+
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
1755
|
+
return zoomRho(_1, _2, _4);
|
|
1756
|
+
};
|
|
1757
|
+
return zoom;
|
|
1758
|
+
})(Math.SQRT2, 2, 4);
|
|
1759
|
+
|
|
1760
|
+
// node_modules/d3-transition/src/transition/tween.js
|
|
1761
|
+
function tweenRemove(id2, name) {
|
|
1762
|
+
var tween0, tween1;
|
|
1763
|
+
return function() {
|
|
1764
|
+
var schedule = set2(this, id2), tween = schedule.tween;
|
|
1765
|
+
if (tween !== tween0) {
|
|
1766
|
+
tween1 = tween0 = tween;
|
|
1767
|
+
for (var i = 0, n = tween1.length; i < n; ++i) {
|
|
1768
|
+
if (tween1[i].name === name) {
|
|
1769
|
+
tween1 = tween1.slice();
|
|
1770
|
+
tween1.splice(i, 1);
|
|
1771
|
+
break;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
schedule.tween = tween1;
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
function tweenFunction(id2, name, value) {
|
|
1779
|
+
var tween0, tween1;
|
|
1780
|
+
if (typeof value !== "function") throw new Error();
|
|
1781
|
+
return function() {
|
|
1782
|
+
var schedule = set2(this, id2), tween = schedule.tween;
|
|
1783
|
+
if (tween !== tween0) {
|
|
1784
|
+
tween1 = (tween0 = tween).slice();
|
|
1785
|
+
for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) {
|
|
1786
|
+
if (tween1[i].name === name) {
|
|
1787
|
+
tween1[i] = t;
|
|
1788
|
+
break;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
if (i === n) tween1.push(t);
|
|
1792
|
+
}
|
|
1793
|
+
schedule.tween = tween1;
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
function tween_default(name, value) {
|
|
1797
|
+
var id2 = this._id;
|
|
1798
|
+
name += "";
|
|
1799
|
+
if (arguments.length < 2) {
|
|
1800
|
+
var tween = get2(this.node(), id2).tween;
|
|
1801
|
+
for (var i = 0, n = tween.length, t; i < n; ++i) {
|
|
1802
|
+
if ((t = tween[i]).name === name) {
|
|
1803
|
+
return t.value;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
return null;
|
|
1807
|
+
}
|
|
1808
|
+
return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
|
|
1809
|
+
}
|
|
1810
|
+
function tweenValue(transition2, name, value) {
|
|
1811
|
+
var id2 = transition2._id;
|
|
1812
|
+
transition2.each(function() {
|
|
1813
|
+
var schedule = set2(this, id2);
|
|
1814
|
+
(schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
|
|
1815
|
+
});
|
|
1816
|
+
return function(node) {
|
|
1817
|
+
return get2(node, id2).value[name];
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
// node_modules/d3-transition/src/transition/interpolate.js
|
|
1822
|
+
function interpolate_default(a2, b) {
|
|
1823
|
+
var c2;
|
|
1824
|
+
return (typeof b === "number" ? number_default : b instanceof color ? rgb_default : (c2 = color(b)) ? (b = c2, rgb_default) : string_default)(a2, b);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
// node_modules/d3-transition/src/transition/attr.js
|
|
1828
|
+
function attrRemove2(name) {
|
|
1829
|
+
return function() {
|
|
1830
|
+
this.removeAttribute(name);
|
|
1831
|
+
};
|
|
1832
|
+
}
|
|
1833
|
+
function attrRemoveNS2(fullname) {
|
|
1834
|
+
return function() {
|
|
1835
|
+
this.removeAttributeNS(fullname.space, fullname.local);
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
function attrConstant2(name, interpolate, value1) {
|
|
1839
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
1840
|
+
return function() {
|
|
1841
|
+
var string0 = this.getAttribute(name);
|
|
1842
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
function attrConstantNS2(fullname, interpolate, value1) {
|
|
1846
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
1847
|
+
return function() {
|
|
1848
|
+
var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
1849
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
function attrFunction2(name, interpolate, value) {
|
|
1853
|
+
var string00, string10, interpolate0;
|
|
1854
|
+
return function() {
|
|
1855
|
+
var string0, value1 = value(this), string1;
|
|
1856
|
+
if (value1 == null) return void this.removeAttribute(name);
|
|
1857
|
+
string0 = this.getAttribute(name);
|
|
1858
|
+
string1 = value1 + "";
|
|
1859
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
function attrFunctionNS2(fullname, interpolate, value) {
|
|
1863
|
+
var string00, string10, interpolate0;
|
|
1864
|
+
return function() {
|
|
1865
|
+
var string0, value1 = value(this), string1;
|
|
1866
|
+
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
|
|
1867
|
+
string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
1868
|
+
string1 = value1 + "";
|
|
1869
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
|
1870
|
+
};
|
|
1871
|
+
}
|
|
1872
|
+
function attr_default2(name, value) {
|
|
1873
|
+
var fullname = namespace_default(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
|
|
1874
|
+
return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i, value));
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
// node_modules/d3-transition/src/transition/attrTween.js
|
|
1878
|
+
function attrInterpolate(name, i) {
|
|
1879
|
+
return function(t) {
|
|
1880
|
+
this.setAttribute(name, i.call(this, t));
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
function attrInterpolateNS(fullname, i) {
|
|
1884
|
+
return function(t) {
|
|
1885
|
+
this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
function attrTweenNS(fullname, value) {
|
|
1889
|
+
var t0, i0;
|
|
1890
|
+
function tween() {
|
|
1891
|
+
var i = value.apply(this, arguments);
|
|
1892
|
+
if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
|
1893
|
+
return t0;
|
|
1894
|
+
}
|
|
1895
|
+
tween._value = value;
|
|
1896
|
+
return tween;
|
|
1897
|
+
}
|
|
1898
|
+
function attrTween(name, value) {
|
|
1899
|
+
var t0, i0;
|
|
1900
|
+
function tween() {
|
|
1901
|
+
var i = value.apply(this, arguments);
|
|
1902
|
+
if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
|
|
1903
|
+
return t0;
|
|
1904
|
+
}
|
|
1905
|
+
tween._value = value;
|
|
1906
|
+
return tween;
|
|
1907
|
+
}
|
|
1908
|
+
function attrTween_default(name, value) {
|
|
1909
|
+
var key = "attr." + name;
|
|
1910
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
1911
|
+
if (value == null) return this.tween(key, null);
|
|
1912
|
+
if (typeof value !== "function") throw new Error();
|
|
1913
|
+
var fullname = namespace_default(name);
|
|
1914
|
+
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
// node_modules/d3-transition/src/transition/delay.js
|
|
1918
|
+
function delayFunction(id2, value) {
|
|
1919
|
+
return function() {
|
|
1920
|
+
init(this, id2).delay = +value.apply(this, arguments);
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
function delayConstant(id2, value) {
|
|
1924
|
+
return value = +value, function() {
|
|
1925
|
+
init(this, id2).delay = value;
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
function delay_default(value) {
|
|
1929
|
+
var id2 = this._id;
|
|
1930
|
+
return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get2(this.node(), id2).delay;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
// node_modules/d3-transition/src/transition/duration.js
|
|
1934
|
+
function durationFunction(id2, value) {
|
|
1935
|
+
return function() {
|
|
1936
|
+
set2(this, id2).duration = +value.apply(this, arguments);
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
function durationConstant(id2, value) {
|
|
1940
|
+
return value = +value, function() {
|
|
1941
|
+
set2(this, id2).duration = value;
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
function duration_default(value) {
|
|
1945
|
+
var id2 = this._id;
|
|
1946
|
+
return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get2(this.node(), id2).duration;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
// node_modules/d3-transition/src/transition/ease.js
|
|
1950
|
+
function easeConstant(id2, value) {
|
|
1951
|
+
if (typeof value !== "function") throw new Error();
|
|
1952
|
+
return function() {
|
|
1953
|
+
set2(this, id2).ease = value;
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
function ease_default(value) {
|
|
1957
|
+
var id2 = this._id;
|
|
1958
|
+
return arguments.length ? this.each(easeConstant(id2, value)) : get2(this.node(), id2).ease;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
// node_modules/d3-transition/src/transition/easeVarying.js
|
|
1962
|
+
function easeVarying(id2, value) {
|
|
1963
|
+
return function() {
|
|
1964
|
+
var v = value.apply(this, arguments);
|
|
1965
|
+
if (typeof v !== "function") throw new Error();
|
|
1966
|
+
set2(this, id2).ease = v;
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
function easeVarying_default(value) {
|
|
1970
|
+
if (typeof value !== "function") throw new Error();
|
|
1971
|
+
return this.each(easeVarying(this._id, value));
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
// node_modules/d3-transition/src/transition/filter.js
|
|
1975
|
+
function filter_default2(match) {
|
|
1976
|
+
if (typeof match !== "function") match = matcher_default(match);
|
|
1977
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
1978
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
1979
|
+
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
1980
|
+
subgroup.push(node);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
return new Transition(subgroups, this._parents, this._name, this._id);
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
// node_modules/d3-transition/src/transition/merge.js
|
|
1988
|
+
function merge_default2(transition2) {
|
|
1989
|
+
if (transition2._id !== this._id) throw new Error();
|
|
1990
|
+
for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
|
|
1991
|
+
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
1992
|
+
if (node = group0[i] || group1[i]) {
|
|
1993
|
+
merge[i] = node;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
for (; j < m0; ++j) {
|
|
1998
|
+
merges[j] = groups0[j];
|
|
1999
|
+
}
|
|
2000
|
+
return new Transition(merges, this._parents, this._name, this._id);
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
// node_modules/d3-transition/src/transition/on.js
|
|
2004
|
+
function start(name) {
|
|
2005
|
+
return (name + "").trim().split(/^|\s+/).every(function(t) {
|
|
2006
|
+
var i = t.indexOf(".");
|
|
2007
|
+
if (i >= 0) t = t.slice(0, i);
|
|
2008
|
+
return !t || t === "start";
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
function onFunction(id2, name, listener) {
|
|
2012
|
+
var on0, on1, sit = start(name) ? init : set2;
|
|
2013
|
+
return function() {
|
|
2014
|
+
var schedule = sit(this, id2), on = schedule.on;
|
|
2015
|
+
if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
|
|
2016
|
+
schedule.on = on1;
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
function on_default2(name, listener) {
|
|
2020
|
+
var id2 = this._id;
|
|
2021
|
+
return arguments.length < 2 ? get2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
// node_modules/d3-transition/src/transition/remove.js
|
|
2025
|
+
function removeFunction(id2) {
|
|
2026
|
+
return function() {
|
|
2027
|
+
var parent = this.parentNode;
|
|
2028
|
+
for (var i in this.__transition) if (+i !== id2) return;
|
|
2029
|
+
if (parent) parent.removeChild(this);
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
function remove_default2() {
|
|
2033
|
+
return this.on("end.remove", removeFunction(this._id));
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
// node_modules/d3-transition/src/transition/select.js
|
|
2037
|
+
function select_default3(select) {
|
|
2038
|
+
var name = this._name, id2 = this._id;
|
|
2039
|
+
if (typeof select !== "function") select = selector_default(select);
|
|
2040
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
2041
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
2042
|
+
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
|
2043
|
+
if ("__data__" in node) subnode.__data__ = node.__data__;
|
|
2044
|
+
subgroup[i] = subnode;
|
|
2045
|
+
schedule_default(subgroup[i], name, id2, i, subgroup, get2(node, id2));
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
return new Transition(subgroups, this._parents, name, id2);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
// node_modules/d3-transition/src/transition/selectAll.js
|
|
2053
|
+
function selectAll_default2(select) {
|
|
2054
|
+
var name = this._name, id2 = this._id;
|
|
2055
|
+
if (typeof select !== "function") select = selectorAll_default(select);
|
|
2056
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
|
|
2057
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2058
|
+
if (node = group[i]) {
|
|
2059
|
+
for (var children2 = select.call(node, node.__data__, i, group), child, inherit2 = get2(node, id2), k = 0, l = children2.length; k < l; ++k) {
|
|
2060
|
+
if (child = children2[k]) {
|
|
2061
|
+
schedule_default(child, name, id2, k, children2, inherit2);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
subgroups.push(children2);
|
|
2065
|
+
parents.push(node);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
return new Transition(subgroups, parents, name, id2);
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
// node_modules/d3-transition/src/transition/selection.js
|
|
2073
|
+
var Selection2 = selection_default.prototype.constructor;
|
|
2074
|
+
function selection_default2() {
|
|
2075
|
+
return new Selection2(this._groups, this._parents);
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
// node_modules/d3-transition/src/transition/style.js
|
|
2079
|
+
function styleNull(name, interpolate) {
|
|
2080
|
+
var string00, string10, interpolate0;
|
|
2081
|
+
return function() {
|
|
2082
|
+
var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
|
|
2083
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
function styleRemove2(name) {
|
|
2087
|
+
return function() {
|
|
2088
|
+
this.style.removeProperty(name);
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
function styleConstant2(name, interpolate, value1) {
|
|
2092
|
+
var string00, string1 = value1 + "", interpolate0;
|
|
2093
|
+
return function() {
|
|
2094
|
+
var string0 = styleValue(this, name);
|
|
2095
|
+
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
function styleFunction2(name, interpolate, value) {
|
|
2099
|
+
var string00, string10, interpolate0;
|
|
2100
|
+
return function() {
|
|
2101
|
+
var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
|
|
2102
|
+
if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
|
|
2103
|
+
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
function styleMaybeRemove(id2, name) {
|
|
2107
|
+
var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
|
|
2108
|
+
return function() {
|
|
2109
|
+
var schedule = set2(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0;
|
|
2110
|
+
if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
|
|
2111
|
+
schedule.on = on1;
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
function style_default2(name, value, priority) {
|
|
2115
|
+
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
|
|
2116
|
+
return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove2(name)) : typeof value === "function" ? this.styleTween(name, styleFunction2(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i, value), priority).on("end.style." + name, null);
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
// node_modules/d3-transition/src/transition/styleTween.js
|
|
2120
|
+
function styleInterpolate(name, i, priority) {
|
|
2121
|
+
return function(t) {
|
|
2122
|
+
this.style.setProperty(name, i.call(this, t), priority);
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
function styleTween(name, value, priority) {
|
|
2126
|
+
var t, i0;
|
|
2127
|
+
function tween() {
|
|
2128
|
+
var i = value.apply(this, arguments);
|
|
2129
|
+
if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
|
|
2130
|
+
return t;
|
|
2131
|
+
}
|
|
2132
|
+
tween._value = value;
|
|
2133
|
+
return tween;
|
|
2134
|
+
}
|
|
2135
|
+
function styleTween_default(name, value, priority) {
|
|
2136
|
+
var key = "style." + (name += "");
|
|
2137
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
2138
|
+
if (value == null) return this.tween(key, null);
|
|
2139
|
+
if (typeof value !== "function") throw new Error();
|
|
2140
|
+
return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
// node_modules/d3-transition/src/transition/text.js
|
|
2144
|
+
function textConstant2(value) {
|
|
2145
|
+
return function() {
|
|
2146
|
+
this.textContent = value;
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
function textFunction2(value) {
|
|
2150
|
+
return function() {
|
|
2151
|
+
var value1 = value(this);
|
|
2152
|
+
this.textContent = value1 == null ? "" : value1;
|
|
2153
|
+
};
|
|
2154
|
+
}
|
|
2155
|
+
function text_default2(value) {
|
|
2156
|
+
return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + ""));
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
// node_modules/d3-transition/src/transition/textTween.js
|
|
2160
|
+
function textInterpolate(i) {
|
|
2161
|
+
return function(t) {
|
|
2162
|
+
this.textContent = i.call(this, t);
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
function textTween(value) {
|
|
2166
|
+
var t0, i0;
|
|
2167
|
+
function tween() {
|
|
2168
|
+
var i = value.apply(this, arguments);
|
|
2169
|
+
if (i !== i0) t0 = (i0 = i) && textInterpolate(i);
|
|
2170
|
+
return t0;
|
|
2171
|
+
}
|
|
2172
|
+
tween._value = value;
|
|
2173
|
+
return tween;
|
|
2174
|
+
}
|
|
2175
|
+
function textTween_default(value) {
|
|
2176
|
+
var key = "text";
|
|
2177
|
+
if (arguments.length < 1) return (key = this.tween(key)) && key._value;
|
|
2178
|
+
if (value == null) return this.tween(key, null);
|
|
2179
|
+
if (typeof value !== "function") throw new Error();
|
|
2180
|
+
return this.tween(key, textTween(value));
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
// node_modules/d3-transition/src/transition/transition.js
|
|
2184
|
+
function transition_default() {
|
|
2185
|
+
var name = this._name, id0 = this._id, id1 = newId();
|
|
2186
|
+
for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
|
|
2187
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2188
|
+
if (node = group[i]) {
|
|
2189
|
+
var inherit2 = get2(node, id0);
|
|
2190
|
+
schedule_default(node, name, id1, i, group, {
|
|
2191
|
+
time: inherit2.time + inherit2.delay + inherit2.duration,
|
|
2192
|
+
delay: 0,
|
|
2193
|
+
duration: inherit2.duration,
|
|
2194
|
+
ease: inherit2.ease
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
return new Transition(groups, this._parents, name, id1);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
// node_modules/d3-transition/src/transition/end.js
|
|
2203
|
+
function end_default() {
|
|
2204
|
+
var on0, on1, that = this, id2 = that._id, size = that.size();
|
|
2205
|
+
return new Promise(function(resolve, reject) {
|
|
2206
|
+
var cancel = { value: reject }, end = { value: function() {
|
|
2207
|
+
if (--size === 0) resolve();
|
|
2208
|
+
} };
|
|
2209
|
+
that.each(function() {
|
|
2210
|
+
var schedule = set2(this, id2), on = schedule.on;
|
|
2211
|
+
if (on !== on0) {
|
|
2212
|
+
on1 = (on0 = on).copy();
|
|
2213
|
+
on1._.cancel.push(cancel);
|
|
2214
|
+
on1._.interrupt.push(cancel);
|
|
2215
|
+
on1._.end.push(end);
|
|
2216
|
+
}
|
|
2217
|
+
schedule.on = on1;
|
|
2218
|
+
});
|
|
2219
|
+
if (size === 0) resolve();
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
// node_modules/d3-transition/src/transition/index.js
|
|
2224
|
+
var id = 0;
|
|
2225
|
+
function Transition(groups, parents, name, id2) {
|
|
2226
|
+
this._groups = groups;
|
|
2227
|
+
this._parents = parents;
|
|
2228
|
+
this._name = name;
|
|
2229
|
+
this._id = id2;
|
|
2230
|
+
}
|
|
2231
|
+
function transition(name) {
|
|
2232
|
+
return selection_default().transition(name);
|
|
2233
|
+
}
|
|
2234
|
+
function newId() {
|
|
2235
|
+
return ++id;
|
|
2236
|
+
}
|
|
2237
|
+
var selection_prototype = selection_default.prototype;
|
|
2238
|
+
Transition.prototype = transition.prototype = {
|
|
2239
|
+
constructor: Transition,
|
|
2240
|
+
select: select_default3,
|
|
2241
|
+
selectAll: selectAll_default2,
|
|
2242
|
+
selectChild: selection_prototype.selectChild,
|
|
2243
|
+
selectChildren: selection_prototype.selectChildren,
|
|
2244
|
+
filter: filter_default2,
|
|
2245
|
+
merge: merge_default2,
|
|
2246
|
+
selection: selection_default2,
|
|
2247
|
+
transition: transition_default,
|
|
2248
|
+
call: selection_prototype.call,
|
|
2249
|
+
nodes: selection_prototype.nodes,
|
|
2250
|
+
node: selection_prototype.node,
|
|
2251
|
+
size: selection_prototype.size,
|
|
2252
|
+
empty: selection_prototype.empty,
|
|
2253
|
+
each: selection_prototype.each,
|
|
2254
|
+
on: on_default2,
|
|
2255
|
+
attr: attr_default2,
|
|
2256
|
+
attrTween: attrTween_default,
|
|
2257
|
+
style: style_default2,
|
|
2258
|
+
styleTween: styleTween_default,
|
|
2259
|
+
text: text_default2,
|
|
2260
|
+
textTween: textTween_default,
|
|
2261
|
+
remove: remove_default2,
|
|
2262
|
+
tween: tween_default,
|
|
2263
|
+
delay: delay_default,
|
|
2264
|
+
duration: duration_default,
|
|
2265
|
+
ease: ease_default,
|
|
2266
|
+
easeVarying: easeVarying_default,
|
|
2267
|
+
end: end_default,
|
|
2268
|
+
[Symbol.iterator]: selection_prototype[Symbol.iterator]
|
|
2269
|
+
};
|
|
2270
|
+
|
|
2271
|
+
// node_modules/d3-ease/src/cubic.js
|
|
2272
|
+
function cubicInOut(t) {
|
|
2273
|
+
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
// node_modules/d3-transition/src/selection/transition.js
|
|
2277
|
+
var defaultTiming = {
|
|
2278
|
+
time: null,
|
|
2279
|
+
// Set on use.
|
|
2280
|
+
delay: 0,
|
|
2281
|
+
duration: 250,
|
|
2282
|
+
ease: cubicInOut
|
|
2283
|
+
};
|
|
2284
|
+
function inherit(node, id2) {
|
|
2285
|
+
var timing;
|
|
2286
|
+
while (!(timing = node.__transition) || !(timing = timing[id2])) {
|
|
2287
|
+
if (!(node = node.parentNode)) {
|
|
2288
|
+
throw new Error(`transition ${id2} not found`);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
return timing;
|
|
2292
|
+
}
|
|
2293
|
+
function transition_default2(name) {
|
|
2294
|
+
var id2, timing;
|
|
2295
|
+
if (name instanceof Transition) {
|
|
2296
|
+
id2 = name._id, name = name._name;
|
|
2297
|
+
} else {
|
|
2298
|
+
id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
|
2299
|
+
}
|
|
2300
|
+
for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
|
|
2301
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2302
|
+
if (node = group[i]) {
|
|
2303
|
+
schedule_default(node, name, id2, i, group, timing || inherit(node, id2));
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return new Transition(groups, this._parents, name, id2);
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
// node_modules/d3-transition/src/selection/index.js
|
|
2311
|
+
selection_default.prototype.interrupt = interrupt_default2;
|
|
2312
|
+
selection_default.prototype.transition = transition_default2;
|
|
2313
|
+
|
|
2314
|
+
// node_modules/d3-drag/src/noevent.js
|
|
2315
|
+
var nonpassive = { passive: false };
|
|
2316
|
+
var nonpassivecapture = { capture: true, passive: false };
|
|
2317
|
+
function nopropagation(event) {
|
|
2318
|
+
event.stopImmediatePropagation();
|
|
2319
|
+
}
|
|
2320
|
+
function noevent_default(event) {
|
|
2321
|
+
event.preventDefault();
|
|
2322
|
+
event.stopImmediatePropagation();
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
// node_modules/d3-drag/src/nodrag.js
|
|
2326
|
+
function nodrag_default(view) {
|
|
2327
|
+
var root2 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", noevent_default, nonpassivecapture);
|
|
2328
|
+
if ("onselectstart" in root2) {
|
|
2329
|
+
selection2.on("selectstart.drag", noevent_default, nonpassivecapture);
|
|
2330
|
+
} else {
|
|
2331
|
+
root2.__noselect = root2.style.MozUserSelect;
|
|
2332
|
+
root2.style.MozUserSelect = "none";
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
function yesdrag(view, noclick) {
|
|
2336
|
+
var root2 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", null);
|
|
2337
|
+
if (noclick) {
|
|
2338
|
+
selection2.on("click.drag", noevent_default, nonpassivecapture);
|
|
2339
|
+
setTimeout(function() {
|
|
2340
|
+
selection2.on("click.drag", null);
|
|
2341
|
+
}, 0);
|
|
2342
|
+
}
|
|
2343
|
+
if ("onselectstart" in root2) {
|
|
2344
|
+
selection2.on("selectstart.drag", null);
|
|
2345
|
+
} else {
|
|
2346
|
+
root2.style.MozUserSelect = root2.__noselect;
|
|
2347
|
+
delete root2.__noselect;
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
// node_modules/d3-drag/src/constant.js
|
|
2352
|
+
var constant_default3 = (x3) => () => x3;
|
|
2353
|
+
|
|
2354
|
+
// node_modules/d3-drag/src/event.js
|
|
2355
|
+
function DragEvent(type, {
|
|
2356
|
+
sourceEvent,
|
|
2357
|
+
subject,
|
|
2358
|
+
target,
|
|
2359
|
+
identifier,
|
|
2360
|
+
active,
|
|
2361
|
+
x: x3,
|
|
2362
|
+
y: y3,
|
|
2363
|
+
dx,
|
|
2364
|
+
dy,
|
|
2365
|
+
dispatch: dispatch2
|
|
2366
|
+
}) {
|
|
2367
|
+
Object.defineProperties(this, {
|
|
2368
|
+
type: { value: type, enumerable: true, configurable: true },
|
|
2369
|
+
sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
|
|
2370
|
+
subject: { value: subject, enumerable: true, configurable: true },
|
|
2371
|
+
target: { value: target, enumerable: true, configurable: true },
|
|
2372
|
+
identifier: { value: identifier, enumerable: true, configurable: true },
|
|
2373
|
+
active: { value: active, enumerable: true, configurable: true },
|
|
2374
|
+
x: { value: x3, enumerable: true, configurable: true },
|
|
2375
|
+
y: { value: y3, enumerable: true, configurable: true },
|
|
2376
|
+
dx: { value: dx, enumerable: true, configurable: true },
|
|
2377
|
+
dy: { value: dy, enumerable: true, configurable: true },
|
|
2378
|
+
_: { value: dispatch2 }
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
DragEvent.prototype.on = function() {
|
|
2382
|
+
var value = this._.on.apply(this._, arguments);
|
|
2383
|
+
return value === this._ ? this : value;
|
|
2384
|
+
};
|
|
2385
|
+
|
|
2386
|
+
// node_modules/d3-drag/src/drag.js
|
|
2387
|
+
function defaultFilter(event) {
|
|
2388
|
+
return !event.ctrlKey && !event.button;
|
|
2389
|
+
}
|
|
2390
|
+
function defaultContainer() {
|
|
2391
|
+
return this.parentNode;
|
|
2392
|
+
}
|
|
2393
|
+
function defaultSubject(event, d) {
|
|
2394
|
+
return d == null ? { x: event.x, y: event.y } : d;
|
|
2395
|
+
}
|
|
2396
|
+
function defaultTouchable() {
|
|
2397
|
+
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
2398
|
+
}
|
|
2399
|
+
function drag_default() {
|
|
2400
|
+
var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch_default2("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
|
|
2401
|
+
function drag(selection2) {
|
|
2402
|
+
selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
2403
|
+
}
|
|
2404
|
+
function mousedowned(event, d) {
|
|
2405
|
+
if (touchending || !filter2.call(this, event, d)) return;
|
|
2406
|
+
var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
|
|
2407
|
+
if (!gesture) return;
|
|
2408
|
+
select_default2(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
|
|
2409
|
+
nodrag_default(event.view);
|
|
2410
|
+
nopropagation(event);
|
|
2411
|
+
mousemoving = false;
|
|
2412
|
+
mousedownx = event.clientX;
|
|
2413
|
+
mousedowny = event.clientY;
|
|
2414
|
+
gesture("start", event);
|
|
2415
|
+
}
|
|
2416
|
+
function mousemoved(event) {
|
|
2417
|
+
noevent_default(event);
|
|
2418
|
+
if (!mousemoving) {
|
|
2419
|
+
var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
|
|
2420
|
+
mousemoving = dx * dx + dy * dy > clickDistance2;
|
|
2421
|
+
}
|
|
2422
|
+
gestures.mouse("drag", event);
|
|
2423
|
+
}
|
|
2424
|
+
function mouseupped(event) {
|
|
2425
|
+
select_default2(event.view).on("mousemove.drag mouseup.drag", null);
|
|
2426
|
+
yesdrag(event.view, mousemoving);
|
|
2427
|
+
noevent_default(event);
|
|
2428
|
+
gestures.mouse("end", event);
|
|
2429
|
+
}
|
|
2430
|
+
function touchstarted(event, d) {
|
|
2431
|
+
if (!filter2.call(this, event, d)) return;
|
|
2432
|
+
var touches = event.changedTouches, c2 = container.call(this, event, d), n = touches.length, i, gesture;
|
|
2433
|
+
for (i = 0; i < n; ++i) {
|
|
2434
|
+
if (gesture = beforestart(this, c2, event, d, touches[i].identifier, touches[i])) {
|
|
2435
|
+
nopropagation(event);
|
|
2436
|
+
gesture("start", event, touches[i]);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
function touchmoved(event) {
|
|
2441
|
+
var touches = event.changedTouches, n = touches.length, i, gesture;
|
|
2442
|
+
for (i = 0; i < n; ++i) {
|
|
2443
|
+
if (gesture = gestures[touches[i].identifier]) {
|
|
2444
|
+
noevent_default(event);
|
|
2445
|
+
gesture("drag", event, touches[i]);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
function touchended(event) {
|
|
2450
|
+
var touches = event.changedTouches, n = touches.length, i, gesture;
|
|
2451
|
+
if (touchending) clearTimeout(touchending);
|
|
2452
|
+
touchending = setTimeout(function() {
|
|
2453
|
+
touchending = null;
|
|
2454
|
+
}, 500);
|
|
2455
|
+
for (i = 0; i < n; ++i) {
|
|
2456
|
+
if (gesture = gestures[touches[i].identifier]) {
|
|
2457
|
+
nopropagation(event);
|
|
2458
|
+
gesture("end", event, touches[i]);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
function beforestart(that, container2, event, d, identifier, touch) {
|
|
2463
|
+
var dispatch2 = listeners.copy(), p = pointer_default(touch || event, container2), dx, dy, s;
|
|
2464
|
+
if ((s = subject.call(that, new DragEvent("beforestart", {
|
|
2465
|
+
sourceEvent: event,
|
|
2466
|
+
target: drag,
|
|
2467
|
+
identifier,
|
|
2468
|
+
active,
|
|
2469
|
+
x: p[0],
|
|
2470
|
+
y: p[1],
|
|
2471
|
+
dx: 0,
|
|
2472
|
+
dy: 0,
|
|
2473
|
+
dispatch: dispatch2
|
|
2474
|
+
}), d)) == null) return;
|
|
2475
|
+
dx = s.x - p[0] || 0;
|
|
2476
|
+
dy = s.y - p[1] || 0;
|
|
2477
|
+
return function gesture(type, event2, touch2) {
|
|
2478
|
+
var p0 = p, n;
|
|
2479
|
+
switch (type) {
|
|
2480
|
+
case "start":
|
|
2481
|
+
gestures[identifier] = gesture, n = active++;
|
|
2482
|
+
break;
|
|
2483
|
+
case "end":
|
|
2484
|
+
delete gestures[identifier], --active;
|
|
2485
|
+
// falls through
|
|
2486
|
+
case "drag":
|
|
2487
|
+
p = pointer_default(touch2 || event2, container2), n = active;
|
|
2488
|
+
break;
|
|
2489
|
+
}
|
|
2490
|
+
dispatch2.call(
|
|
2491
|
+
type,
|
|
2492
|
+
that,
|
|
2493
|
+
new DragEvent(type, {
|
|
2494
|
+
sourceEvent: event2,
|
|
2495
|
+
subject: s,
|
|
2496
|
+
target: drag,
|
|
2497
|
+
identifier,
|
|
2498
|
+
active: n,
|
|
2499
|
+
x: p[0] + dx,
|
|
2500
|
+
y: p[1] + dy,
|
|
2501
|
+
dx: p[0] - p0[0],
|
|
2502
|
+
dy: p[1] - p0[1],
|
|
2503
|
+
dispatch: dispatch2
|
|
2504
|
+
}),
|
|
2505
|
+
d
|
|
2506
|
+
);
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
drag.filter = function(_) {
|
|
2510
|
+
return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant_default3(!!_), drag) : filter2;
|
|
2511
|
+
};
|
|
2512
|
+
drag.container = function(_) {
|
|
2513
|
+
return arguments.length ? (container = typeof _ === "function" ? _ : constant_default3(_), drag) : container;
|
|
2514
|
+
};
|
|
2515
|
+
drag.subject = function(_) {
|
|
2516
|
+
return arguments.length ? (subject = typeof _ === "function" ? _ : constant_default3(_), drag) : subject;
|
|
2517
|
+
};
|
|
2518
|
+
drag.touchable = function(_) {
|
|
2519
|
+
return arguments.length ? (touchable = typeof _ === "function" ? _ : constant_default3(!!_), drag) : touchable;
|
|
2520
|
+
};
|
|
2521
|
+
drag.on = function() {
|
|
2522
|
+
var value = listeners.on.apply(listeners, arguments);
|
|
2523
|
+
return value === listeners ? drag : value;
|
|
2524
|
+
};
|
|
2525
|
+
drag.clickDistance = function(_) {
|
|
2526
|
+
return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
|
|
2527
|
+
};
|
|
2528
|
+
return drag;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
// node_modules/d3-zoom/src/constant.js
|
|
2532
|
+
var constant_default4 = (x3) => () => x3;
|
|
2533
|
+
|
|
2534
|
+
// node_modules/d3-zoom/src/event.js
|
|
2535
|
+
function ZoomEvent(type, {
|
|
2536
|
+
sourceEvent,
|
|
2537
|
+
target,
|
|
2538
|
+
transform: transform2,
|
|
2539
|
+
dispatch: dispatch2
|
|
2540
|
+
}) {
|
|
2541
|
+
Object.defineProperties(this, {
|
|
2542
|
+
type: { value: type, enumerable: true, configurable: true },
|
|
2543
|
+
sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
|
|
2544
|
+
target: { value: target, enumerable: true, configurable: true },
|
|
2545
|
+
transform: { value: transform2, enumerable: true, configurable: true },
|
|
2546
|
+
_: { value: dispatch2 }
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
// node_modules/d3-zoom/src/transform.js
|
|
2551
|
+
function Transform(k, x3, y3) {
|
|
2552
|
+
this.k = k;
|
|
2553
|
+
this.x = x3;
|
|
2554
|
+
this.y = y3;
|
|
2555
|
+
}
|
|
2556
|
+
Transform.prototype = {
|
|
2557
|
+
constructor: Transform,
|
|
2558
|
+
scale: function(k) {
|
|
2559
|
+
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
2560
|
+
},
|
|
2561
|
+
translate: function(x3, y3) {
|
|
2562
|
+
return x3 === 0 & y3 === 0 ? this : new Transform(this.k, this.x + this.k * x3, this.y + this.k * y3);
|
|
2563
|
+
},
|
|
2564
|
+
apply: function(point) {
|
|
2565
|
+
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
2566
|
+
},
|
|
2567
|
+
applyX: function(x3) {
|
|
2568
|
+
return x3 * this.k + this.x;
|
|
2569
|
+
},
|
|
2570
|
+
applyY: function(y3) {
|
|
2571
|
+
return y3 * this.k + this.y;
|
|
2572
|
+
},
|
|
2573
|
+
invert: function(location) {
|
|
2574
|
+
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
2575
|
+
},
|
|
2576
|
+
invertX: function(x3) {
|
|
2577
|
+
return (x3 - this.x) / this.k;
|
|
2578
|
+
},
|
|
2579
|
+
invertY: function(y3) {
|
|
2580
|
+
return (y3 - this.y) / this.k;
|
|
2581
|
+
},
|
|
2582
|
+
rescaleX: function(x3) {
|
|
2583
|
+
return x3.copy().domain(x3.range().map(this.invertX, this).map(x3.invert, x3));
|
|
2584
|
+
},
|
|
2585
|
+
rescaleY: function(y3) {
|
|
2586
|
+
return y3.copy().domain(y3.range().map(this.invertY, this).map(y3.invert, y3));
|
|
2587
|
+
},
|
|
2588
|
+
toString: function() {
|
|
2589
|
+
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
2590
|
+
}
|
|
2591
|
+
};
|
|
2592
|
+
var identity2 = new Transform(1, 0, 0);
|
|
2593
|
+
transform.prototype = Transform.prototype;
|
|
2594
|
+
function transform(node) {
|
|
2595
|
+
while (!node.__zoom) if (!(node = node.parentNode)) return identity2;
|
|
2596
|
+
return node.__zoom;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
// node_modules/d3-zoom/src/noevent.js
|
|
2600
|
+
function nopropagation2(event) {
|
|
2601
|
+
event.stopImmediatePropagation();
|
|
2602
|
+
}
|
|
2603
|
+
function noevent_default2(event) {
|
|
2604
|
+
event.preventDefault();
|
|
2605
|
+
event.stopImmediatePropagation();
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
// node_modules/d3-zoom/src/zoom.js
|
|
2609
|
+
function defaultFilter2(event) {
|
|
2610
|
+
return (!event.ctrlKey || event.type === "wheel") && !event.button;
|
|
2611
|
+
}
|
|
2612
|
+
function defaultExtent() {
|
|
2613
|
+
var e = this;
|
|
2614
|
+
if (e instanceof SVGElement) {
|
|
2615
|
+
e = e.ownerSVGElement || e;
|
|
2616
|
+
if (e.hasAttribute("viewBox")) {
|
|
2617
|
+
e = e.viewBox.baseVal;
|
|
2618
|
+
return [[e.x, e.y], [e.x + e.width, e.y + e.height]];
|
|
2619
|
+
}
|
|
2620
|
+
return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];
|
|
2621
|
+
}
|
|
2622
|
+
return [[0, 0], [e.clientWidth, e.clientHeight]];
|
|
2623
|
+
}
|
|
2624
|
+
function defaultTransform() {
|
|
2625
|
+
return this.__zoom || identity2;
|
|
2626
|
+
}
|
|
2627
|
+
function defaultWheelDelta(event) {
|
|
2628
|
+
return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
|
|
2629
|
+
}
|
|
2630
|
+
function defaultTouchable2() {
|
|
2631
|
+
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
2632
|
+
}
|
|
2633
|
+
function defaultConstrain(transform2, extent, translateExtent) {
|
|
2634
|
+
var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
|
|
2635
|
+
return transform2.translate(
|
|
2636
|
+
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
|
|
2637
|
+
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
|
|
2638
|
+
);
|
|
2639
|
+
}
|
|
2640
|
+
function zoom_default2() {
|
|
2641
|
+
var filter2 = defaultFilter2, extent = defaultExtent, constrain = defaultConstrain, wheelDelta = defaultWheelDelta, touchable = defaultTouchable2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate = zoom_default, listeners = dispatch_default2("start", "zoom", "end"), touchstarting, touchfirst, touchending, touchDelay = 500, wheelDelay = 150, clickDistance2 = 0, tapDistance = 10;
|
|
2642
|
+
function zoom(selection2) {
|
|
2643
|
+
selection2.property("__zoom", defaultTransform).on("wheel.zoom", wheeled, { passive: false }).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
2644
|
+
}
|
|
2645
|
+
zoom.transform = function(collection, transform2, point, event) {
|
|
2646
|
+
var selection2 = collection.selection ? collection.selection() : collection;
|
|
2647
|
+
selection2.property("__zoom", defaultTransform);
|
|
2648
|
+
if (collection !== selection2) {
|
|
2649
|
+
schedule(collection, transform2, point, event);
|
|
2650
|
+
} else {
|
|
2651
|
+
selection2.interrupt().each(function() {
|
|
2652
|
+
gesture(this, arguments).event(event).start().zoom(null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end();
|
|
2653
|
+
});
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2656
|
+
zoom.scaleBy = function(selection2, k, p, event) {
|
|
2657
|
+
zoom.scaleTo(selection2, function() {
|
|
2658
|
+
var k0 = this.__zoom.k, k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
|
2659
|
+
return k0 * k1;
|
|
2660
|
+
}, p, event);
|
|
2661
|
+
};
|
|
2662
|
+
zoom.scaleTo = function(selection2, k, p, event) {
|
|
2663
|
+
zoom.transform(selection2, function() {
|
|
2664
|
+
var e = extent.apply(this, arguments), t0 = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
|
2665
|
+
return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
|
|
2666
|
+
}, p, event);
|
|
2667
|
+
};
|
|
2668
|
+
zoom.translateBy = function(selection2, x3, y3, event) {
|
|
2669
|
+
zoom.transform(selection2, function() {
|
|
2670
|
+
return constrain(this.__zoom.translate(
|
|
2671
|
+
typeof x3 === "function" ? x3.apply(this, arguments) : x3,
|
|
2672
|
+
typeof y3 === "function" ? y3.apply(this, arguments) : y3
|
|
2673
|
+
), extent.apply(this, arguments), translateExtent);
|
|
2674
|
+
}, null, event);
|
|
2675
|
+
};
|
|
2676
|
+
zoom.translateTo = function(selection2, x3, y3, p, event) {
|
|
2677
|
+
zoom.transform(selection2, function() {
|
|
2678
|
+
var e = extent.apply(this, arguments), t = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
|
|
2679
|
+
return constrain(identity2.translate(p0[0], p0[1]).scale(t.k).translate(
|
|
2680
|
+
typeof x3 === "function" ? -x3.apply(this, arguments) : -x3,
|
|
2681
|
+
typeof y3 === "function" ? -y3.apply(this, arguments) : -y3
|
|
2682
|
+
), e, translateExtent);
|
|
2683
|
+
}, p, event);
|
|
2684
|
+
};
|
|
2685
|
+
function scale(transform2, k) {
|
|
2686
|
+
k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));
|
|
2687
|
+
return k === transform2.k ? transform2 : new Transform(k, transform2.x, transform2.y);
|
|
2688
|
+
}
|
|
2689
|
+
function translate(transform2, p0, p1) {
|
|
2690
|
+
var x3 = p0[0] - p1[0] * transform2.k, y3 = p0[1] - p1[1] * transform2.k;
|
|
2691
|
+
return x3 === transform2.x && y3 === transform2.y ? transform2 : new Transform(transform2.k, x3, y3);
|
|
2692
|
+
}
|
|
2693
|
+
function centroid(extent2) {
|
|
2694
|
+
return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
|
|
2695
|
+
}
|
|
2696
|
+
function schedule(transition2, transform2, point, event) {
|
|
2697
|
+
transition2.on("start.zoom", function() {
|
|
2698
|
+
gesture(this, arguments).event(event).start();
|
|
2699
|
+
}).on("interrupt.zoom end.zoom", function() {
|
|
2700
|
+
gesture(this, arguments).event(event).end();
|
|
2701
|
+
}).tween("zoom", function() {
|
|
2702
|
+
var that = this, args = arguments, g = gesture(that, args).event(event), e = extent.apply(that, args), p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), a2 = that.__zoom, b = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i = interpolate(a2.invert(p).concat(w / a2.k), b.invert(p).concat(w / b.k));
|
|
2703
|
+
return function(t) {
|
|
2704
|
+
if (t === 1) t = b;
|
|
2705
|
+
else {
|
|
2706
|
+
var l = i(t), k = w / l[2];
|
|
2707
|
+
t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
|
2708
|
+
}
|
|
2709
|
+
g.zoom(null, t);
|
|
2710
|
+
};
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
function gesture(that, args, clean) {
|
|
2714
|
+
return !clean && that.__zooming || new Gesture(that, args);
|
|
2715
|
+
}
|
|
2716
|
+
function Gesture(that, args) {
|
|
2717
|
+
this.that = that;
|
|
2718
|
+
this.args = args;
|
|
2719
|
+
this.active = 0;
|
|
2720
|
+
this.sourceEvent = null;
|
|
2721
|
+
this.extent = extent.apply(that, args);
|
|
2722
|
+
this.taps = 0;
|
|
2723
|
+
}
|
|
2724
|
+
Gesture.prototype = {
|
|
2725
|
+
event: function(event) {
|
|
2726
|
+
if (event) this.sourceEvent = event;
|
|
2727
|
+
return this;
|
|
2728
|
+
},
|
|
2729
|
+
start: function() {
|
|
2730
|
+
if (++this.active === 1) {
|
|
2731
|
+
this.that.__zooming = this;
|
|
2732
|
+
this.emit("start");
|
|
2733
|
+
}
|
|
2734
|
+
return this;
|
|
2735
|
+
},
|
|
2736
|
+
zoom: function(key, transform2) {
|
|
2737
|
+
if (this.mouse && key !== "mouse") this.mouse[1] = transform2.invert(this.mouse[0]);
|
|
2738
|
+
if (this.touch0 && key !== "touch") this.touch0[1] = transform2.invert(this.touch0[0]);
|
|
2739
|
+
if (this.touch1 && key !== "touch") this.touch1[1] = transform2.invert(this.touch1[0]);
|
|
2740
|
+
this.that.__zoom = transform2;
|
|
2741
|
+
this.emit("zoom");
|
|
2742
|
+
return this;
|
|
2743
|
+
},
|
|
2744
|
+
end: function() {
|
|
2745
|
+
if (--this.active === 0) {
|
|
2746
|
+
delete this.that.__zooming;
|
|
2747
|
+
this.emit("end");
|
|
2748
|
+
}
|
|
2749
|
+
return this;
|
|
2750
|
+
},
|
|
2751
|
+
emit: function(type) {
|
|
2752
|
+
var d = select_default2(this.that).datum();
|
|
2753
|
+
listeners.call(
|
|
2754
|
+
type,
|
|
2755
|
+
this.that,
|
|
2756
|
+
new ZoomEvent(type, {
|
|
2757
|
+
sourceEvent: this.sourceEvent,
|
|
2758
|
+
target: zoom,
|
|
2759
|
+
type,
|
|
2760
|
+
transform: this.that.__zoom,
|
|
2761
|
+
dispatch: listeners
|
|
2762
|
+
}),
|
|
2763
|
+
d
|
|
2764
|
+
);
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
function wheeled(event, ...args) {
|
|
2768
|
+
if (!filter2.apply(this, arguments)) return;
|
|
2769
|
+
var g = gesture(this, args).event(event), t = this.__zoom, k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p = pointer_default(event);
|
|
2770
|
+
if (g.wheel) {
|
|
2771
|
+
if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
|
|
2772
|
+
g.mouse[1] = t.invert(g.mouse[0] = p);
|
|
2773
|
+
}
|
|
2774
|
+
clearTimeout(g.wheel);
|
|
2775
|
+
} else if (t.k === k) return;
|
|
2776
|
+
else {
|
|
2777
|
+
g.mouse = [p, t.invert(p)];
|
|
2778
|
+
interrupt_default(this);
|
|
2779
|
+
g.start();
|
|
2780
|
+
}
|
|
2781
|
+
noevent_default2(event);
|
|
2782
|
+
g.wheel = setTimeout(wheelidled, wheelDelay);
|
|
2783
|
+
g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
|
|
2784
|
+
function wheelidled() {
|
|
2785
|
+
g.wheel = null;
|
|
2786
|
+
g.end();
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
function mousedowned(event, ...args) {
|
|
2790
|
+
if (touchending || !filter2.apply(this, arguments)) return;
|
|
2791
|
+
var currentTarget = event.currentTarget, g = gesture(this, args, true).event(event), v = select_default2(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p = pointer_default(event, currentTarget), x0 = event.clientX, y0 = event.clientY;
|
|
2792
|
+
nodrag_default(event.view);
|
|
2793
|
+
nopropagation2(event);
|
|
2794
|
+
g.mouse = [p, this.__zoom.invert(p)];
|
|
2795
|
+
interrupt_default(this);
|
|
2796
|
+
g.start();
|
|
2797
|
+
function mousemoved(event2) {
|
|
2798
|
+
noevent_default2(event2);
|
|
2799
|
+
if (!g.moved) {
|
|
2800
|
+
var dx = event2.clientX - x0, dy = event2.clientY - y0;
|
|
2801
|
+
g.moved = dx * dx + dy * dy > clickDistance2;
|
|
2802
|
+
}
|
|
2803
|
+
g.event(event2).zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = pointer_default(event2, currentTarget), g.mouse[1]), g.extent, translateExtent));
|
|
2804
|
+
}
|
|
2805
|
+
function mouseupped(event2) {
|
|
2806
|
+
v.on("mousemove.zoom mouseup.zoom", null);
|
|
2807
|
+
yesdrag(event2.view, g.moved);
|
|
2808
|
+
noevent_default2(event2);
|
|
2809
|
+
g.event(event2).end();
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
function dblclicked(event, ...args) {
|
|
2813
|
+
if (!filter2.apply(this, arguments)) return;
|
|
2814
|
+
var t0 = this.__zoom, p0 = pointer_default(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t0.invert(p0), k1 = t0.k * (event.shiftKey ? 0.5 : 2), t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);
|
|
2815
|
+
noevent_default2(event);
|
|
2816
|
+
if (duration > 0) select_default2(this).transition().duration(duration).call(schedule, t1, p0, event);
|
|
2817
|
+
else select_default2(this).call(zoom.transform, t1, p0, event);
|
|
2818
|
+
}
|
|
2819
|
+
function touchstarted(event, ...args) {
|
|
2820
|
+
if (!filter2.apply(this, arguments)) return;
|
|
2821
|
+
var touches = event.touches, n = touches.length, g = gesture(this, args, event.changedTouches.length === n).event(event), started, i, t, p;
|
|
2822
|
+
nopropagation2(event);
|
|
2823
|
+
for (i = 0; i < n; ++i) {
|
|
2824
|
+
t = touches[i], p = pointer_default(t, this);
|
|
2825
|
+
p = [p, this.__zoom.invert(p), t.identifier];
|
|
2826
|
+
if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;
|
|
2827
|
+
else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;
|
|
2828
|
+
}
|
|
2829
|
+
if (touchstarting) touchstarting = clearTimeout(touchstarting);
|
|
2830
|
+
if (started) {
|
|
2831
|
+
if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() {
|
|
2832
|
+
touchstarting = null;
|
|
2833
|
+
}, touchDelay);
|
|
2834
|
+
interrupt_default(this);
|
|
2835
|
+
g.start();
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
function touchmoved(event, ...args) {
|
|
2839
|
+
if (!this.__zooming) return;
|
|
2840
|
+
var g = gesture(this, args).event(event), touches = event.changedTouches, n = touches.length, i, t, p, l;
|
|
2841
|
+
noevent_default2(event);
|
|
2842
|
+
for (i = 0; i < n; ++i) {
|
|
2843
|
+
t = touches[i], p = pointer_default(t, this);
|
|
2844
|
+
if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;
|
|
2845
|
+
else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;
|
|
2846
|
+
}
|
|
2847
|
+
t = g.that.__zoom;
|
|
2848
|
+
if (g.touch1) {
|
|
2849
|
+
var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
|
2850
|
+
t = scale(t, Math.sqrt(dp / dl));
|
|
2851
|
+
p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
|
|
2852
|
+
l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
|
2853
|
+
} else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
|
|
2854
|
+
else return;
|
|
2855
|
+
g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent));
|
|
2856
|
+
}
|
|
2857
|
+
function touchended(event, ...args) {
|
|
2858
|
+
if (!this.__zooming) return;
|
|
2859
|
+
var g = gesture(this, args).event(event), touches = event.changedTouches, n = touches.length, i, t;
|
|
2860
|
+
nopropagation2(event);
|
|
2861
|
+
if (touchending) clearTimeout(touchending);
|
|
2862
|
+
touchending = setTimeout(function() {
|
|
2863
|
+
touchending = null;
|
|
2864
|
+
}, touchDelay);
|
|
2865
|
+
for (i = 0; i < n; ++i) {
|
|
2866
|
+
t = touches[i];
|
|
2867
|
+
if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;
|
|
2868
|
+
else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;
|
|
2869
|
+
}
|
|
2870
|
+
if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;
|
|
2871
|
+
if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);
|
|
2872
|
+
else {
|
|
2873
|
+
g.end();
|
|
2874
|
+
if (g.taps === 2) {
|
|
2875
|
+
t = pointer_default(t, this);
|
|
2876
|
+
if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {
|
|
2877
|
+
var p = select_default2(this).on("dblclick.zoom");
|
|
2878
|
+
if (p) p.apply(this, arguments);
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
zoom.wheelDelta = function(_) {
|
|
2884
|
+
return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant_default4(+_), zoom) : wheelDelta;
|
|
2885
|
+
};
|
|
2886
|
+
zoom.filter = function(_) {
|
|
2887
|
+
return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant_default4(!!_), zoom) : filter2;
|
|
2888
|
+
};
|
|
2889
|
+
zoom.touchable = function(_) {
|
|
2890
|
+
return arguments.length ? (touchable = typeof _ === "function" ? _ : constant_default4(!!_), zoom) : touchable;
|
|
2891
|
+
};
|
|
2892
|
+
zoom.extent = function(_) {
|
|
2893
|
+
return arguments.length ? (extent = typeof _ === "function" ? _ : constant_default4([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
|
|
2894
|
+
};
|
|
2895
|
+
zoom.scaleExtent = function(_) {
|
|
2896
|
+
return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];
|
|
2897
|
+
};
|
|
2898
|
+
zoom.translateExtent = function(_) {
|
|
2899
|
+
return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
|
|
2900
|
+
};
|
|
2901
|
+
zoom.constrain = function(_) {
|
|
2902
|
+
return arguments.length ? (constrain = _, zoom) : constrain;
|
|
2903
|
+
};
|
|
2904
|
+
zoom.duration = function(_) {
|
|
2905
|
+
return arguments.length ? (duration = +_, zoom) : duration;
|
|
2906
|
+
};
|
|
2907
|
+
zoom.interpolate = function(_) {
|
|
2908
|
+
return arguments.length ? (interpolate = _, zoom) : interpolate;
|
|
2909
|
+
};
|
|
2910
|
+
zoom.on = function() {
|
|
2911
|
+
var value = listeners.on.apply(listeners, arguments);
|
|
2912
|
+
return value === listeners ? zoom : value;
|
|
2913
|
+
};
|
|
2914
|
+
zoom.clickDistance = function(_) {
|
|
2915
|
+
return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
|
|
2916
|
+
};
|
|
2917
|
+
zoom.tapDistance = function(_) {
|
|
2918
|
+
return arguments.length ? (tapDistance = +_, zoom) : tapDistance;
|
|
2919
|
+
};
|
|
2920
|
+
return zoom;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
// node_modules/d3-force/src/center.js
|
|
2924
|
+
function center_default(x3, y3) {
|
|
2925
|
+
var nodes, strength = 1;
|
|
2926
|
+
if (x3 == null) x3 = 0;
|
|
2927
|
+
if (y3 == null) y3 = 0;
|
|
2928
|
+
function force() {
|
|
2929
|
+
var i, n = nodes.length, node, sx = 0, sy = 0;
|
|
2930
|
+
for (i = 0; i < n; ++i) {
|
|
2931
|
+
node = nodes[i], sx += node.x, sy += node.y;
|
|
2932
|
+
}
|
|
2933
|
+
for (sx = (sx / n - x3) * strength, sy = (sy / n - y3) * strength, i = 0; i < n; ++i) {
|
|
2934
|
+
node = nodes[i], node.x -= sx, node.y -= sy;
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
force.initialize = function(_) {
|
|
2938
|
+
nodes = _;
|
|
2939
|
+
};
|
|
2940
|
+
force.x = function(_) {
|
|
2941
|
+
return arguments.length ? (x3 = +_, force) : x3;
|
|
2942
|
+
};
|
|
2943
|
+
force.y = function(_) {
|
|
2944
|
+
return arguments.length ? (y3 = +_, force) : y3;
|
|
2945
|
+
};
|
|
2946
|
+
force.strength = function(_) {
|
|
2947
|
+
return arguments.length ? (strength = +_, force) : strength;
|
|
2948
|
+
};
|
|
2949
|
+
return force;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
// node_modules/d3-quadtree/src/add.js
|
|
2953
|
+
function add_default(d) {
|
|
2954
|
+
const x3 = +this._x.call(null, d), y3 = +this._y.call(null, d);
|
|
2955
|
+
return add(this.cover(x3, y3), x3, y3, d);
|
|
2956
|
+
}
|
|
2957
|
+
function add(tree, x3, y3, d) {
|
|
2958
|
+
if (isNaN(x3) || isNaN(y3)) return tree;
|
|
2959
|
+
var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, y0 = tree._y0, x1 = tree._x1, y1 = tree._y1, xm, ym, xp, yp, right, bottom, i, j;
|
|
2960
|
+
if (!node) return tree._root = leaf, tree;
|
|
2961
|
+
while (node.length) {
|
|
2962
|
+
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
|
2963
|
+
else x1 = xm;
|
|
2964
|
+
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
|
2965
|
+
else y1 = ym;
|
|
2966
|
+
if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
|
|
2967
|
+
}
|
|
2968
|
+
xp = +tree._x.call(null, node.data);
|
|
2969
|
+
yp = +tree._y.call(null, node.data);
|
|
2970
|
+
if (x3 === xp && y3 === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
|
|
2971
|
+
do {
|
|
2972
|
+
parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
|
|
2973
|
+
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
|
2974
|
+
else x1 = xm;
|
|
2975
|
+
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
|
2976
|
+
else y1 = ym;
|
|
2977
|
+
} while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | xp >= xm));
|
|
2978
|
+
return parent[j] = node, parent[i] = leaf, tree;
|
|
2979
|
+
}
|
|
2980
|
+
function addAll(data) {
|
|
2981
|
+
var d, i, n = data.length, x3, y3, xz = new Array(n), yz = new Array(n), x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
|
|
2982
|
+
for (i = 0; i < n; ++i) {
|
|
2983
|
+
if (isNaN(x3 = +this._x.call(null, d = data[i])) || isNaN(y3 = +this._y.call(null, d))) continue;
|
|
2984
|
+
xz[i] = x3;
|
|
2985
|
+
yz[i] = y3;
|
|
2986
|
+
if (x3 < x0) x0 = x3;
|
|
2987
|
+
if (x3 > x1) x1 = x3;
|
|
2988
|
+
if (y3 < y0) y0 = y3;
|
|
2989
|
+
if (y3 > y1) y1 = y3;
|
|
2990
|
+
}
|
|
2991
|
+
if (x0 > x1 || y0 > y1) return this;
|
|
2992
|
+
this.cover(x0, y0).cover(x1, y1);
|
|
2993
|
+
for (i = 0; i < n; ++i) {
|
|
2994
|
+
add(this, xz[i], yz[i], data[i]);
|
|
2995
|
+
}
|
|
2996
|
+
return this;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
// node_modules/d3-quadtree/src/cover.js
|
|
3000
|
+
function cover_default(x3, y3) {
|
|
3001
|
+
if (isNaN(x3 = +x3) || isNaN(y3 = +y3)) return this;
|
|
3002
|
+
var x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1;
|
|
3003
|
+
if (isNaN(x0)) {
|
|
3004
|
+
x1 = (x0 = Math.floor(x3)) + 1;
|
|
3005
|
+
y1 = (y0 = Math.floor(y3)) + 1;
|
|
3006
|
+
} else {
|
|
3007
|
+
var z = x1 - x0 || 1, node = this._root, parent, i;
|
|
3008
|
+
while (x0 > x3 || x3 >= x1 || y0 > y3 || y3 >= y1) {
|
|
3009
|
+
i = (y3 < y0) << 1 | x3 < x0;
|
|
3010
|
+
parent = new Array(4), parent[i] = node, node = parent, z *= 2;
|
|
3011
|
+
switch (i) {
|
|
3012
|
+
case 0:
|
|
3013
|
+
x1 = x0 + z, y1 = y0 + z;
|
|
3014
|
+
break;
|
|
3015
|
+
case 1:
|
|
3016
|
+
x0 = x1 - z, y1 = y0 + z;
|
|
3017
|
+
break;
|
|
3018
|
+
case 2:
|
|
3019
|
+
x1 = x0 + z, y0 = y1 - z;
|
|
3020
|
+
break;
|
|
3021
|
+
case 3:
|
|
3022
|
+
x0 = x1 - z, y0 = y1 - z;
|
|
3023
|
+
break;
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
if (this._root && this._root.length) this._root = node;
|
|
3027
|
+
}
|
|
3028
|
+
this._x0 = x0;
|
|
3029
|
+
this._y0 = y0;
|
|
3030
|
+
this._x1 = x1;
|
|
3031
|
+
this._y1 = y1;
|
|
3032
|
+
return this;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
// node_modules/d3-quadtree/src/data.js
|
|
3036
|
+
function data_default2() {
|
|
3037
|
+
var data = [];
|
|
3038
|
+
this.visit(function(node) {
|
|
3039
|
+
if (!node.length) do
|
|
3040
|
+
data.push(node.data);
|
|
3041
|
+
while (node = node.next);
|
|
3042
|
+
});
|
|
3043
|
+
return data;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
// node_modules/d3-quadtree/src/extent.js
|
|
3047
|
+
function extent_default(_) {
|
|
3048
|
+
return arguments.length ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
// node_modules/d3-quadtree/src/quad.js
|
|
3052
|
+
function quad_default(node, x0, y0, x1, y1) {
|
|
3053
|
+
this.node = node;
|
|
3054
|
+
this.x0 = x0;
|
|
3055
|
+
this.y0 = y0;
|
|
3056
|
+
this.x1 = x1;
|
|
3057
|
+
this.y1 = y1;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
// node_modules/d3-quadtree/src/find.js
|
|
3061
|
+
function find_default(x3, y3, radius) {
|
|
3062
|
+
var data, x0 = this._x0, y0 = this._y0, x1, y1, x22, y22, x32 = this._x1, y32 = this._y1, quads = [], node = this._root, q, i;
|
|
3063
|
+
if (node) quads.push(new quad_default(node, x0, y0, x32, y32));
|
|
3064
|
+
if (radius == null) radius = Infinity;
|
|
3065
|
+
else {
|
|
3066
|
+
x0 = x3 - radius, y0 = y3 - radius;
|
|
3067
|
+
x32 = x3 + radius, y32 = y3 + radius;
|
|
3068
|
+
radius *= radius;
|
|
3069
|
+
}
|
|
3070
|
+
while (q = quads.pop()) {
|
|
3071
|
+
if (!(node = q.node) || (x1 = q.x0) > x32 || (y1 = q.y0) > y32 || (x22 = q.x1) < x0 || (y22 = q.y1) < y0) continue;
|
|
3072
|
+
if (node.length) {
|
|
3073
|
+
var xm = (x1 + x22) / 2, ym = (y1 + y22) / 2;
|
|
3074
|
+
quads.push(
|
|
3075
|
+
new quad_default(node[3], xm, ym, x22, y22),
|
|
3076
|
+
new quad_default(node[2], x1, ym, xm, y22),
|
|
3077
|
+
new quad_default(node[1], xm, y1, x22, ym),
|
|
3078
|
+
new quad_default(node[0], x1, y1, xm, ym)
|
|
3079
|
+
);
|
|
3080
|
+
if (i = (y3 >= ym) << 1 | x3 >= xm) {
|
|
3081
|
+
q = quads[quads.length - 1];
|
|
3082
|
+
quads[quads.length - 1] = quads[quads.length - 1 - i];
|
|
3083
|
+
quads[quads.length - 1 - i] = q;
|
|
3084
|
+
}
|
|
3085
|
+
} else {
|
|
3086
|
+
var dx = x3 - +this._x.call(null, node.data), dy = y3 - +this._y.call(null, node.data), d2 = dx * dx + dy * dy;
|
|
3087
|
+
if (d2 < radius) {
|
|
3088
|
+
var d = Math.sqrt(radius = d2);
|
|
3089
|
+
x0 = x3 - d, y0 = y3 - d;
|
|
3090
|
+
x32 = x3 + d, y32 = y3 + d;
|
|
3091
|
+
data = node.data;
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
return data;
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
// node_modules/d3-quadtree/src/remove.js
|
|
3099
|
+
function remove_default3(d) {
|
|
3100
|
+
if (isNaN(x3 = +this._x.call(null, d)) || isNaN(y3 = +this._y.call(null, d))) return this;
|
|
3101
|
+
var parent, node = this._root, retainer, previous, next, x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1, x3, y3, xm, ym, right, bottom, i, j;
|
|
3102
|
+
if (!node) return this;
|
|
3103
|
+
if (node.length) while (true) {
|
|
3104
|
+
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
|
3105
|
+
else x1 = xm;
|
|
3106
|
+
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
|
3107
|
+
else y1 = ym;
|
|
3108
|
+
if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
|
|
3109
|
+
if (!node.length) break;
|
|
3110
|
+
if (parent[i + 1 & 3] || parent[i + 2 & 3] || parent[i + 3 & 3]) retainer = parent, j = i;
|
|
3111
|
+
}
|
|
3112
|
+
while (node.data !== d) if (!(previous = node, node = node.next)) return this;
|
|
3113
|
+
if (next = node.next) delete node.next;
|
|
3114
|
+
if (previous) return next ? previous.next = next : delete previous.next, this;
|
|
3115
|
+
if (!parent) return this._root = next, this;
|
|
3116
|
+
next ? parent[i] = next : delete parent[i];
|
|
3117
|
+
if ((node = parent[0] || parent[1] || parent[2] || parent[3]) && node === (parent[3] || parent[2] || parent[1] || parent[0]) && !node.length) {
|
|
3118
|
+
if (retainer) retainer[j] = node;
|
|
3119
|
+
else this._root = node;
|
|
3120
|
+
}
|
|
3121
|
+
return this;
|
|
3122
|
+
}
|
|
3123
|
+
function removeAll(data) {
|
|
3124
|
+
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
|
|
3125
|
+
return this;
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
// node_modules/d3-quadtree/src/root.js
|
|
3129
|
+
function root_default() {
|
|
3130
|
+
return this._root;
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
// node_modules/d3-quadtree/src/size.js
|
|
3134
|
+
function size_default2() {
|
|
3135
|
+
var size = 0;
|
|
3136
|
+
this.visit(function(node) {
|
|
3137
|
+
if (!node.length) do
|
|
3138
|
+
++size;
|
|
3139
|
+
while (node = node.next);
|
|
3140
|
+
});
|
|
3141
|
+
return size;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
// node_modules/d3-quadtree/src/visit.js
|
|
3145
|
+
function visit_default(callback) {
|
|
3146
|
+
var quads = [], q, node = this._root, child, x0, y0, x1, y1;
|
|
3147
|
+
if (node) quads.push(new quad_default(node, this._x0, this._y0, this._x1, this._y1));
|
|
3148
|
+
while (q = quads.pop()) {
|
|
3149
|
+
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
|
|
3150
|
+
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
|
|
3151
|
+
if (child = node[3]) quads.push(new quad_default(child, xm, ym, x1, y1));
|
|
3152
|
+
if (child = node[2]) quads.push(new quad_default(child, x0, ym, xm, y1));
|
|
3153
|
+
if (child = node[1]) quads.push(new quad_default(child, xm, y0, x1, ym));
|
|
3154
|
+
if (child = node[0]) quads.push(new quad_default(child, x0, y0, xm, ym));
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
return this;
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
// node_modules/d3-quadtree/src/visitAfter.js
|
|
3161
|
+
function visitAfter_default(callback) {
|
|
3162
|
+
var quads = [], next = [], q;
|
|
3163
|
+
if (this._root) quads.push(new quad_default(this._root, this._x0, this._y0, this._x1, this._y1));
|
|
3164
|
+
while (q = quads.pop()) {
|
|
3165
|
+
var node = q.node;
|
|
3166
|
+
if (node.length) {
|
|
3167
|
+
var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
|
|
3168
|
+
if (child = node[0]) quads.push(new quad_default(child, x0, y0, xm, ym));
|
|
3169
|
+
if (child = node[1]) quads.push(new quad_default(child, xm, y0, x1, ym));
|
|
3170
|
+
if (child = node[2]) quads.push(new quad_default(child, x0, ym, xm, y1));
|
|
3171
|
+
if (child = node[3]) quads.push(new quad_default(child, xm, ym, x1, y1));
|
|
3172
|
+
}
|
|
3173
|
+
next.push(q);
|
|
3174
|
+
}
|
|
3175
|
+
while (q = next.pop()) {
|
|
3176
|
+
callback(q.node, q.x0, q.y0, q.x1, q.y1);
|
|
3177
|
+
}
|
|
3178
|
+
return this;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
// node_modules/d3-quadtree/src/x.js
|
|
3182
|
+
function defaultX(d) {
|
|
3183
|
+
return d[0];
|
|
3184
|
+
}
|
|
3185
|
+
function x_default(_) {
|
|
3186
|
+
return arguments.length ? (this._x = _, this) : this._x;
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
// node_modules/d3-quadtree/src/y.js
|
|
3190
|
+
function defaultY(d) {
|
|
3191
|
+
return d[1];
|
|
3192
|
+
}
|
|
3193
|
+
function y_default(_) {
|
|
3194
|
+
return arguments.length ? (this._y = _, this) : this._y;
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
// node_modules/d3-quadtree/src/quadtree.js
|
|
3198
|
+
function quadtree(nodes, x3, y3) {
|
|
3199
|
+
var tree = new Quadtree(x3 == null ? defaultX : x3, y3 == null ? defaultY : y3, NaN, NaN, NaN, NaN);
|
|
3200
|
+
return nodes == null ? tree : tree.addAll(nodes);
|
|
3201
|
+
}
|
|
3202
|
+
function Quadtree(x3, y3, x0, y0, x1, y1) {
|
|
3203
|
+
this._x = x3;
|
|
3204
|
+
this._y = y3;
|
|
3205
|
+
this._x0 = x0;
|
|
3206
|
+
this._y0 = y0;
|
|
3207
|
+
this._x1 = x1;
|
|
3208
|
+
this._y1 = y1;
|
|
3209
|
+
this._root = void 0;
|
|
3210
|
+
}
|
|
3211
|
+
function leaf_copy(leaf) {
|
|
3212
|
+
var copy = { data: leaf.data }, next = copy;
|
|
3213
|
+
while (leaf = leaf.next) next = next.next = { data: leaf.data };
|
|
3214
|
+
return copy;
|
|
3215
|
+
}
|
|
3216
|
+
var treeProto = quadtree.prototype = Quadtree.prototype;
|
|
3217
|
+
treeProto.copy = function() {
|
|
3218
|
+
var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), node = this._root, nodes, child;
|
|
3219
|
+
if (!node) return copy;
|
|
3220
|
+
if (!node.length) return copy._root = leaf_copy(node), copy;
|
|
3221
|
+
nodes = [{ source: node, target: copy._root = new Array(4) }];
|
|
3222
|
+
while (node = nodes.pop()) {
|
|
3223
|
+
for (var i = 0; i < 4; ++i) {
|
|
3224
|
+
if (child = node.source[i]) {
|
|
3225
|
+
if (child.length) nodes.push({ source: child, target: node.target[i] = new Array(4) });
|
|
3226
|
+
else node.target[i] = leaf_copy(child);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
return copy;
|
|
3231
|
+
};
|
|
3232
|
+
treeProto.add = add_default;
|
|
3233
|
+
treeProto.addAll = addAll;
|
|
3234
|
+
treeProto.cover = cover_default;
|
|
3235
|
+
treeProto.data = data_default2;
|
|
3236
|
+
treeProto.extent = extent_default;
|
|
3237
|
+
treeProto.find = find_default;
|
|
3238
|
+
treeProto.remove = remove_default3;
|
|
3239
|
+
treeProto.removeAll = removeAll;
|
|
3240
|
+
treeProto.root = root_default;
|
|
3241
|
+
treeProto.size = size_default2;
|
|
3242
|
+
treeProto.visit = visit_default;
|
|
3243
|
+
treeProto.visitAfter = visitAfter_default;
|
|
3244
|
+
treeProto.x = x_default;
|
|
3245
|
+
treeProto.y = y_default;
|
|
3246
|
+
|
|
3247
|
+
// node_modules/d3-force/src/constant.js
|
|
3248
|
+
function constant_default5(x3) {
|
|
3249
|
+
return function() {
|
|
3250
|
+
return x3;
|
|
3251
|
+
};
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
// node_modules/d3-force/src/jiggle.js
|
|
3255
|
+
function jiggle_default(random) {
|
|
3256
|
+
return (random() - 0.5) * 1e-6;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
// node_modules/d3-force/src/collide.js
|
|
3260
|
+
function x(d) {
|
|
3261
|
+
return d.x + d.vx;
|
|
3262
|
+
}
|
|
3263
|
+
function y(d) {
|
|
3264
|
+
return d.y + d.vy;
|
|
3265
|
+
}
|
|
3266
|
+
function collide_default(radius) {
|
|
3267
|
+
var nodes, radii, random, strength = 1, iterations = 1;
|
|
3268
|
+
if (typeof radius !== "function") radius = constant_default5(radius == null ? 1 : +radius);
|
|
3269
|
+
function force() {
|
|
3270
|
+
var i, n = nodes.length, tree, node, xi, yi, ri, ri2;
|
|
3271
|
+
for (var k = 0; k < iterations; ++k) {
|
|
3272
|
+
tree = quadtree(nodes, x, y).visitAfter(prepare);
|
|
3273
|
+
for (i = 0; i < n; ++i) {
|
|
3274
|
+
node = nodes[i];
|
|
3275
|
+
ri = radii[node.index], ri2 = ri * ri;
|
|
3276
|
+
xi = node.x + node.vx;
|
|
3277
|
+
yi = node.y + node.vy;
|
|
3278
|
+
tree.visit(apply);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
function apply(quad, x0, y0, x1, y1) {
|
|
3282
|
+
var data = quad.data, rj = quad.r, r = ri + rj;
|
|
3283
|
+
if (data) {
|
|
3284
|
+
if (data.index > node.index) {
|
|
3285
|
+
var x3 = xi - data.x - data.vx, y3 = yi - data.y - data.vy, l = x3 * x3 + y3 * y3;
|
|
3286
|
+
if (l < r * r) {
|
|
3287
|
+
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
|
3288
|
+
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
|
3289
|
+
l = (r - (l = Math.sqrt(l))) / l * strength;
|
|
3290
|
+
node.vx += (x3 *= l) * (r = (rj *= rj) / (ri2 + rj));
|
|
3291
|
+
node.vy += (y3 *= l) * r;
|
|
3292
|
+
data.vx -= x3 * (r = 1 - r);
|
|
3293
|
+
data.vy -= y3 * r;
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3298
|
+
return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
function prepare(quad) {
|
|
3302
|
+
if (quad.data) return quad.r = radii[quad.data.index];
|
|
3303
|
+
for (var i = quad.r = 0; i < 4; ++i) {
|
|
3304
|
+
if (quad[i] && quad[i].r > quad.r) {
|
|
3305
|
+
quad.r = quad[i].r;
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
function initialize() {
|
|
3310
|
+
if (!nodes) return;
|
|
3311
|
+
var i, n = nodes.length, node;
|
|
3312
|
+
radii = new Array(n);
|
|
3313
|
+
for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);
|
|
3314
|
+
}
|
|
3315
|
+
force.initialize = function(_nodes, _random) {
|
|
3316
|
+
nodes = _nodes;
|
|
3317
|
+
random = _random;
|
|
3318
|
+
initialize();
|
|
3319
|
+
};
|
|
3320
|
+
force.iterations = function(_) {
|
|
3321
|
+
return arguments.length ? (iterations = +_, force) : iterations;
|
|
3322
|
+
};
|
|
3323
|
+
force.strength = function(_) {
|
|
3324
|
+
return arguments.length ? (strength = +_, force) : strength;
|
|
3325
|
+
};
|
|
3326
|
+
force.radius = function(_) {
|
|
3327
|
+
return arguments.length ? (radius = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : radius;
|
|
3328
|
+
};
|
|
3329
|
+
return force;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
// node_modules/d3-force/src/link.js
|
|
3333
|
+
function index(d) {
|
|
3334
|
+
return d.index;
|
|
3335
|
+
}
|
|
3336
|
+
function find2(nodeById, nodeId) {
|
|
3337
|
+
var node = nodeById.get(nodeId);
|
|
3338
|
+
if (!node) throw new Error("node not found: " + nodeId);
|
|
3339
|
+
return node;
|
|
3340
|
+
}
|
|
3341
|
+
function link_default(links) {
|
|
3342
|
+
var id2 = index, strength = defaultStrength, strengths, distance = constant_default5(30), distances, nodes, count, bias, random, iterations = 1;
|
|
3343
|
+
if (links == null) links = [];
|
|
3344
|
+
function defaultStrength(link) {
|
|
3345
|
+
return 1 / Math.min(count[link.source.index], count[link.target.index]);
|
|
3346
|
+
}
|
|
3347
|
+
function force(alpha) {
|
|
3348
|
+
for (var k = 0, n = links.length; k < iterations; ++k) {
|
|
3349
|
+
for (var i = 0, link, source, target, x3, y3, l, b; i < n; ++i) {
|
|
3350
|
+
link = links[i], source = link.source, target = link.target;
|
|
3351
|
+
x3 = target.x + target.vx - source.x - source.vx || jiggle_default(random);
|
|
3352
|
+
y3 = target.y + target.vy - source.y - source.vy || jiggle_default(random);
|
|
3353
|
+
l = Math.sqrt(x3 * x3 + y3 * y3);
|
|
3354
|
+
l = (l - distances[i]) / l * alpha * strengths[i];
|
|
3355
|
+
x3 *= l, y3 *= l;
|
|
3356
|
+
target.vx -= x3 * (b = bias[i]);
|
|
3357
|
+
target.vy -= y3 * b;
|
|
3358
|
+
source.vx += x3 * (b = 1 - b);
|
|
3359
|
+
source.vy += y3 * b;
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
function initialize() {
|
|
3364
|
+
if (!nodes) return;
|
|
3365
|
+
var i, n = nodes.length, m2 = links.length, nodeById = new Map(nodes.map((d, i2) => [id2(d, i2, nodes), d])), link;
|
|
3366
|
+
for (i = 0, count = new Array(n); i < m2; ++i) {
|
|
3367
|
+
link = links[i], link.index = i;
|
|
3368
|
+
if (typeof link.source !== "object") link.source = find2(nodeById, link.source);
|
|
3369
|
+
if (typeof link.target !== "object") link.target = find2(nodeById, link.target);
|
|
3370
|
+
count[link.source.index] = (count[link.source.index] || 0) + 1;
|
|
3371
|
+
count[link.target.index] = (count[link.target.index] || 0) + 1;
|
|
3372
|
+
}
|
|
3373
|
+
for (i = 0, bias = new Array(m2); i < m2; ++i) {
|
|
3374
|
+
link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);
|
|
3375
|
+
}
|
|
3376
|
+
strengths = new Array(m2), initializeStrength();
|
|
3377
|
+
distances = new Array(m2), initializeDistance();
|
|
3378
|
+
}
|
|
3379
|
+
function initializeStrength() {
|
|
3380
|
+
if (!nodes) return;
|
|
3381
|
+
for (var i = 0, n = links.length; i < n; ++i) {
|
|
3382
|
+
strengths[i] = +strength(links[i], i, links);
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
function initializeDistance() {
|
|
3386
|
+
if (!nodes) return;
|
|
3387
|
+
for (var i = 0, n = links.length; i < n; ++i) {
|
|
3388
|
+
distances[i] = +distance(links[i], i, links);
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
force.initialize = function(_nodes, _random) {
|
|
3392
|
+
nodes = _nodes;
|
|
3393
|
+
random = _random;
|
|
3394
|
+
initialize();
|
|
3395
|
+
};
|
|
3396
|
+
force.links = function(_) {
|
|
3397
|
+
return arguments.length ? (links = _, initialize(), force) : links;
|
|
3398
|
+
};
|
|
3399
|
+
force.id = function(_) {
|
|
3400
|
+
return arguments.length ? (id2 = _, force) : id2;
|
|
3401
|
+
};
|
|
3402
|
+
force.iterations = function(_) {
|
|
3403
|
+
return arguments.length ? (iterations = +_, force) : iterations;
|
|
3404
|
+
};
|
|
3405
|
+
force.strength = function(_) {
|
|
3406
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initializeStrength(), force) : strength;
|
|
3407
|
+
};
|
|
3408
|
+
force.distance = function(_) {
|
|
3409
|
+
return arguments.length ? (distance = typeof _ === "function" ? _ : constant_default5(+_), initializeDistance(), force) : distance;
|
|
3410
|
+
};
|
|
3411
|
+
return force;
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
// node_modules/d3-force/src/lcg.js
|
|
3415
|
+
var a = 1664525;
|
|
3416
|
+
var c = 1013904223;
|
|
3417
|
+
var m = 4294967296;
|
|
3418
|
+
function lcg_default() {
|
|
3419
|
+
let s = 1;
|
|
3420
|
+
return () => (s = (a * s + c) % m) / m;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
// node_modules/d3-force/src/simulation.js
|
|
3424
|
+
function x2(d) {
|
|
3425
|
+
return d.x;
|
|
3426
|
+
}
|
|
3427
|
+
function y2(d) {
|
|
3428
|
+
return d.y;
|
|
3429
|
+
}
|
|
3430
|
+
var initialRadius = 10;
|
|
3431
|
+
var initialAngle = Math.PI * (3 - Math.sqrt(5));
|
|
3432
|
+
function simulation_default(nodes) {
|
|
3433
|
+
var simulation, alpha = 1, alphaMin = 1e-3, alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), alphaTarget = 0, velocityDecay = 0.6, forces = /* @__PURE__ */ new Map(), stepper = timer(step), event = dispatch_default2("tick", "end"), random = lcg_default();
|
|
3434
|
+
if (nodes == null) nodes = [];
|
|
3435
|
+
function step() {
|
|
3436
|
+
tick();
|
|
3437
|
+
event.call("tick", simulation);
|
|
3438
|
+
if (alpha < alphaMin) {
|
|
3439
|
+
stepper.stop();
|
|
3440
|
+
event.call("end", simulation);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
function tick(iterations) {
|
|
3444
|
+
var i, n = nodes.length, node;
|
|
3445
|
+
if (iterations === void 0) iterations = 1;
|
|
3446
|
+
for (var k = 0; k < iterations; ++k) {
|
|
3447
|
+
alpha += (alphaTarget - alpha) * alphaDecay;
|
|
3448
|
+
forces.forEach(function(force) {
|
|
3449
|
+
force(alpha);
|
|
3450
|
+
});
|
|
3451
|
+
for (i = 0; i < n; ++i) {
|
|
3452
|
+
node = nodes[i];
|
|
3453
|
+
if (node.fx == null) node.x += node.vx *= velocityDecay;
|
|
3454
|
+
else node.x = node.fx, node.vx = 0;
|
|
3455
|
+
if (node.fy == null) node.y += node.vy *= velocityDecay;
|
|
3456
|
+
else node.y = node.fy, node.vy = 0;
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
return simulation;
|
|
3460
|
+
}
|
|
3461
|
+
function initializeNodes() {
|
|
3462
|
+
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
|
3463
|
+
node = nodes[i], node.index = i;
|
|
3464
|
+
if (node.fx != null) node.x = node.fx;
|
|
3465
|
+
if (node.fy != null) node.y = node.fy;
|
|
3466
|
+
if (isNaN(node.x) || isNaN(node.y)) {
|
|
3467
|
+
var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;
|
|
3468
|
+
node.x = radius * Math.cos(angle);
|
|
3469
|
+
node.y = radius * Math.sin(angle);
|
|
3470
|
+
}
|
|
3471
|
+
if (isNaN(node.vx) || isNaN(node.vy)) {
|
|
3472
|
+
node.vx = node.vy = 0;
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
function initializeForce(force) {
|
|
3477
|
+
if (force.initialize) force.initialize(nodes, random);
|
|
3478
|
+
return force;
|
|
3479
|
+
}
|
|
3480
|
+
initializeNodes();
|
|
3481
|
+
return simulation = {
|
|
3482
|
+
tick,
|
|
3483
|
+
restart: function() {
|
|
3484
|
+
return stepper.restart(step), simulation;
|
|
3485
|
+
},
|
|
3486
|
+
stop: function() {
|
|
3487
|
+
return stepper.stop(), simulation;
|
|
3488
|
+
},
|
|
3489
|
+
nodes: function(_) {
|
|
3490
|
+
return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;
|
|
3491
|
+
},
|
|
3492
|
+
alpha: function(_) {
|
|
3493
|
+
return arguments.length ? (alpha = +_, simulation) : alpha;
|
|
3494
|
+
},
|
|
3495
|
+
alphaMin: function(_) {
|
|
3496
|
+
return arguments.length ? (alphaMin = +_, simulation) : alphaMin;
|
|
3497
|
+
},
|
|
3498
|
+
alphaDecay: function(_) {
|
|
3499
|
+
return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;
|
|
3500
|
+
},
|
|
3501
|
+
alphaTarget: function(_) {
|
|
3502
|
+
return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;
|
|
3503
|
+
},
|
|
3504
|
+
velocityDecay: function(_) {
|
|
3505
|
+
return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;
|
|
3506
|
+
},
|
|
3507
|
+
randomSource: function(_) {
|
|
3508
|
+
return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;
|
|
3509
|
+
},
|
|
3510
|
+
force: function(name, _) {
|
|
3511
|
+
return arguments.length > 1 ? (_ == null ? forces.delete(name) : forces.set(name, initializeForce(_)), simulation) : forces.get(name);
|
|
3512
|
+
},
|
|
3513
|
+
find: function(x3, y3, radius) {
|
|
3514
|
+
var i = 0, n = nodes.length, dx, dy, d2, node, closest;
|
|
3515
|
+
if (radius == null) radius = Infinity;
|
|
3516
|
+
else radius *= radius;
|
|
3517
|
+
for (i = 0; i < n; ++i) {
|
|
3518
|
+
node = nodes[i];
|
|
3519
|
+
dx = x3 - node.x;
|
|
3520
|
+
dy = y3 - node.y;
|
|
3521
|
+
d2 = dx * dx + dy * dy;
|
|
3522
|
+
if (d2 < radius) closest = node, radius = d2;
|
|
3523
|
+
}
|
|
3524
|
+
return closest;
|
|
3525
|
+
},
|
|
3526
|
+
on: function(name, _) {
|
|
3527
|
+
return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
|
|
3528
|
+
}
|
|
3529
|
+
};
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
// node_modules/d3-force/src/manyBody.js
|
|
3533
|
+
function manyBody_default() {
|
|
3534
|
+
var nodes, node, random, alpha, strength = constant_default5(-30), strengths, distanceMin2 = 1, distanceMax2 = Infinity, theta2 = 0.81;
|
|
3535
|
+
function force(_) {
|
|
3536
|
+
var i, n = nodes.length, tree = quadtree(nodes, x2, y2).visitAfter(accumulate);
|
|
3537
|
+
for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);
|
|
3538
|
+
}
|
|
3539
|
+
function initialize() {
|
|
3540
|
+
if (!nodes) return;
|
|
3541
|
+
var i, n = nodes.length, node2;
|
|
3542
|
+
strengths = new Array(n);
|
|
3543
|
+
for (i = 0; i < n; ++i) node2 = nodes[i], strengths[node2.index] = +strength(node2, i, nodes);
|
|
3544
|
+
}
|
|
3545
|
+
function accumulate(quad) {
|
|
3546
|
+
var strength2 = 0, q, c2, weight = 0, x3, y3, i;
|
|
3547
|
+
if (quad.length) {
|
|
3548
|
+
for (x3 = y3 = i = 0; i < 4; ++i) {
|
|
3549
|
+
if ((q = quad[i]) && (c2 = Math.abs(q.value))) {
|
|
3550
|
+
strength2 += q.value, weight += c2, x3 += c2 * q.x, y3 += c2 * q.y;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
quad.x = x3 / weight;
|
|
3554
|
+
quad.y = y3 / weight;
|
|
3555
|
+
} else {
|
|
3556
|
+
q = quad;
|
|
3557
|
+
q.x = q.data.x;
|
|
3558
|
+
q.y = q.data.y;
|
|
3559
|
+
do
|
|
3560
|
+
strength2 += strengths[q.data.index];
|
|
3561
|
+
while (q = q.next);
|
|
3562
|
+
}
|
|
3563
|
+
quad.value = strength2;
|
|
3564
|
+
}
|
|
3565
|
+
function apply(quad, x1, _, x22) {
|
|
3566
|
+
if (!quad.value) return true;
|
|
3567
|
+
var x3 = quad.x - node.x, y3 = quad.y - node.y, w = x22 - x1, l = x3 * x3 + y3 * y3;
|
|
3568
|
+
if (w * w / theta2 < l) {
|
|
3569
|
+
if (l < distanceMax2) {
|
|
3570
|
+
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
|
3571
|
+
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
|
3572
|
+
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
|
3573
|
+
node.vx += x3 * quad.value * alpha / l;
|
|
3574
|
+
node.vy += y3 * quad.value * alpha / l;
|
|
3575
|
+
}
|
|
3576
|
+
return true;
|
|
3577
|
+
} else if (quad.length || l >= distanceMax2) return;
|
|
3578
|
+
if (quad.data !== node || quad.next) {
|
|
3579
|
+
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
|
3580
|
+
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
|
3581
|
+
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
|
3582
|
+
}
|
|
3583
|
+
do
|
|
3584
|
+
if (quad.data !== node) {
|
|
3585
|
+
w = strengths[quad.data.index] * alpha / l;
|
|
3586
|
+
node.vx += x3 * w;
|
|
3587
|
+
node.vy += y3 * w;
|
|
3588
|
+
}
|
|
3589
|
+
while (quad = quad.next);
|
|
3590
|
+
}
|
|
3591
|
+
force.initialize = function(_nodes, _random) {
|
|
3592
|
+
nodes = _nodes;
|
|
3593
|
+
random = _random;
|
|
3594
|
+
initialize();
|
|
3595
|
+
};
|
|
3596
|
+
force.strength = function(_) {
|
|
3597
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : strength;
|
|
3598
|
+
};
|
|
3599
|
+
force.distanceMin = function(_) {
|
|
3600
|
+
return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);
|
|
3601
|
+
};
|
|
3602
|
+
force.distanceMax = function(_) {
|
|
3603
|
+
return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);
|
|
3604
|
+
};
|
|
3605
|
+
force.theta = function(_) {
|
|
3606
|
+
return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);
|
|
3607
|
+
};
|
|
3608
|
+
return force;
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
// node_modules/d3-force/src/x.js
|
|
3612
|
+
function x_default2(x3) {
|
|
3613
|
+
var strength = constant_default5(0.1), nodes, strengths, xz;
|
|
3614
|
+
if (typeof x3 !== "function") x3 = constant_default5(x3 == null ? 0 : +x3);
|
|
3615
|
+
function force(alpha) {
|
|
3616
|
+
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
|
3617
|
+
node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
function initialize() {
|
|
3621
|
+
if (!nodes) return;
|
|
3622
|
+
var i, n = nodes.length;
|
|
3623
|
+
strengths = new Array(n);
|
|
3624
|
+
xz = new Array(n);
|
|
3625
|
+
for (i = 0; i < n; ++i) {
|
|
3626
|
+
strengths[i] = isNaN(xz[i] = +x3(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
force.initialize = function(_) {
|
|
3630
|
+
nodes = _;
|
|
3631
|
+
initialize();
|
|
3632
|
+
};
|
|
3633
|
+
force.strength = function(_) {
|
|
3634
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : strength;
|
|
3635
|
+
};
|
|
3636
|
+
force.x = function(_) {
|
|
3637
|
+
return arguments.length ? (x3 = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : x3;
|
|
3638
|
+
};
|
|
3639
|
+
return force;
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
// node_modules/d3-force/src/y.js
|
|
3643
|
+
function y_default2(y3) {
|
|
3644
|
+
var strength = constant_default5(0.1), nodes, strengths, yz;
|
|
3645
|
+
if (typeof y3 !== "function") y3 = constant_default5(y3 == null ? 0 : +y3);
|
|
3646
|
+
function force(alpha) {
|
|
3647
|
+
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
|
3648
|
+
node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
function initialize() {
|
|
3652
|
+
if (!nodes) return;
|
|
3653
|
+
var i, n = nodes.length;
|
|
3654
|
+
strengths = new Array(n);
|
|
3655
|
+
yz = new Array(n);
|
|
3656
|
+
for (i = 0; i < n; ++i) {
|
|
3657
|
+
strengths[i] = isNaN(yz[i] = +y3(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
force.initialize = function(_) {
|
|
3661
|
+
nodes = _;
|
|
3662
|
+
initialize();
|
|
3663
|
+
};
|
|
3664
|
+
force.strength = function(_) {
|
|
3665
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : strength;
|
|
3666
|
+
};
|
|
3667
|
+
force.y = function(_) {
|
|
3668
|
+
return arguments.length ? (y3 = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : y3;
|
|
3669
|
+
};
|
|
3670
|
+
return force;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
// src/core/create-graph-layers.ts
|
|
3674
|
+
function createGraphLayers(svg) {
|
|
3675
|
+
while (svg.firstChild) {
|
|
3676
|
+
svg.removeChild(svg.firstChild);
|
|
3677
|
+
}
|
|
3678
|
+
const createGroup = (className) => {
|
|
3679
|
+
const group = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
3680
|
+
group.setAttribute("class", className);
|
|
3681
|
+
group.setAttribute("data-layer", className);
|
|
3682
|
+
return group;
|
|
3683
|
+
};
|
|
3684
|
+
const interactionLayer = createGroup("interaction-layer");
|
|
3685
|
+
const interactionRect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
3686
|
+
const interactionAttributes = {
|
|
3687
|
+
class: "interaction-surface",
|
|
3688
|
+
width: "100%",
|
|
3689
|
+
height: "100%",
|
|
3690
|
+
fill: "transparent",
|
|
3691
|
+
"pointer-events": "all"
|
|
3692
|
+
};
|
|
3693
|
+
Object.entries(interactionAttributes).forEach(([key, value]) => {
|
|
3694
|
+
interactionRect.setAttribute(key, value);
|
|
3695
|
+
});
|
|
3696
|
+
interactionLayer.appendChild(interactionRect);
|
|
3697
|
+
const root2 = createGroup("knowledge-graph-root");
|
|
3698
|
+
const layers = {
|
|
3699
|
+
interactionLayer,
|
|
3700
|
+
interactionRect,
|
|
3701
|
+
root: root2,
|
|
3702
|
+
links: createGroup("links"),
|
|
3703
|
+
linkLabels: createGroup("link-labels"),
|
|
3704
|
+
nodeRings: createGroup("node-rings"),
|
|
3705
|
+
nodes: createGroup("nodes"),
|
|
3706
|
+
nodeLabels: createGroup("node-labels")
|
|
3707
|
+
};
|
|
3708
|
+
root2.append(
|
|
3709
|
+
layers.links,
|
|
3710
|
+
layers.linkLabels,
|
|
3711
|
+
layers.nodeRings,
|
|
3712
|
+
layers.nodes,
|
|
3713
|
+
layers.nodeLabels
|
|
3714
|
+
);
|
|
3715
|
+
svg.appendChild(interactionLayer);
|
|
3716
|
+
svg.appendChild(root2);
|
|
3717
|
+
return layers;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
// src/core/create-zoom.ts
|
|
3721
|
+
function createZoom({
|
|
3722
|
+
svg,
|
|
3723
|
+
root: root2,
|
|
3724
|
+
scaleExtent = [0.2, 3]
|
|
3725
|
+
}) {
|
|
3726
|
+
const svgSelection = select_default2(svg);
|
|
3727
|
+
const rootSelection = select_default2(root2);
|
|
3728
|
+
const behavior = zoom_default2().scaleExtent(scaleExtent).filter(
|
|
3729
|
+
(event) => {
|
|
3730
|
+
if (event instanceof WheelEvent) {
|
|
3731
|
+
event.preventDefault();
|
|
3732
|
+
return true;
|
|
3733
|
+
}
|
|
3734
|
+
if (event instanceof MouseEvent && event.type === "mousedown" && event.button === 0) {
|
|
3735
|
+
const target = event.target;
|
|
3736
|
+
return !target.closest(
|
|
3737
|
+
".nodes"
|
|
3738
|
+
);
|
|
3739
|
+
}
|
|
3740
|
+
return false;
|
|
3741
|
+
}
|
|
3742
|
+
).on(
|
|
3743
|
+
"zoom",
|
|
3744
|
+
(event) => {
|
|
3745
|
+
rootSelection.attr(
|
|
3746
|
+
"transform",
|
|
3747
|
+
event.transform.toString()
|
|
3748
|
+
);
|
|
3749
|
+
}
|
|
3750
|
+
);
|
|
3751
|
+
svg.style.touchAction = "none";
|
|
3752
|
+
svgSelection.call(behavior);
|
|
3753
|
+
return {
|
|
3754
|
+
behavior,
|
|
3755
|
+
cleanup: () => {
|
|
3756
|
+
svgSelection.on(
|
|
3757
|
+
".zoom",
|
|
3758
|
+
null
|
|
3759
|
+
);
|
|
3760
|
+
}
|
|
3761
|
+
};
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
// src/core/create-graph-simulation.ts
|
|
3765
|
+
function createGraphSimulation(config) {
|
|
3766
|
+
const centerX = config.width / 2;
|
|
3767
|
+
const centerY = config.height / 2;
|
|
3768
|
+
const seedRadius = 80;
|
|
3769
|
+
config.nodes.forEach((node, index2) => {
|
|
3770
|
+
if (node.x == null || node.y == null) {
|
|
3771
|
+
const angle = index2 / Math.max(config.nodes.length, 1) * Math.PI * 2;
|
|
3772
|
+
node.x = centerX + Math.cos(angle) * seedRadius;
|
|
3773
|
+
node.y = centerY + Math.sin(angle) * seedRadius;
|
|
3774
|
+
}
|
|
3775
|
+
});
|
|
3776
|
+
const simulation = simulation_default(config.nodes).alpha(0.9).alphaDecay(0.12).alphaMin(0.03).velocityDecay(0.5).force(
|
|
3777
|
+
"link",
|
|
3778
|
+
link_default(config.links).id((d) => d.id).distance(150).strength(0.4)
|
|
3779
|
+
).force("charge", manyBody_default().strength(-220)).force(
|
|
3780
|
+
"collide",
|
|
3781
|
+
collide_default().radius((node) => (node.style?.radius ?? 12) + 10).strength(0.9)
|
|
3782
|
+
).force("center", center_default(centerX, centerY).strength(0.08));
|
|
3783
|
+
return { simulation };
|
|
3784
|
+
}
|
|
3785
|
+
|
|
3786
|
+
// src/utils/resolve-link-style.ts
|
|
3787
|
+
var DEFAULT_LINK_STYLE = {
|
|
3788
|
+
stroke: "#94a3b8",
|
|
3789
|
+
strokeWidth: 2,
|
|
3790
|
+
opacity: 0.9,
|
|
3791
|
+
dashArray: void 0,
|
|
3792
|
+
arrow: {
|
|
3793
|
+
enabled: true,
|
|
3794
|
+
size: 6,
|
|
3795
|
+
fill: "#94a3b8"
|
|
3796
|
+
},
|
|
3797
|
+
label: {
|
|
3798
|
+
enabled: true,
|
|
3799
|
+
backgroundFill: "color-mix(in srgb, #8E42EE, #FFFFFF 90%)",
|
|
3800
|
+
borderColor: "color-mix(in srgb, #8E42EE, #FFFFFF 10%)",
|
|
3801
|
+
borderWidth: 1.5,
|
|
3802
|
+
borderRadius: 4,
|
|
3803
|
+
textColor: "color-mix(in srgb, #8E42EE, #000000 40%)",
|
|
3804
|
+
fontSize: 12,
|
|
3805
|
+
paddingX: 8,
|
|
3806
|
+
paddingY: 4,
|
|
3807
|
+
height: 24
|
|
3808
|
+
}
|
|
3809
|
+
};
|
|
3810
|
+
function resolveLinkStyle(params) {
|
|
3811
|
+
const baseStyle = mergeLinkStyle(DEFAULT_LINK_STYLE, params.link.style);
|
|
3812
|
+
if (params.isSelected) {
|
|
3813
|
+
return mergeLinkStyle(baseStyle, params.interaction?.selection?.linkStyle);
|
|
3814
|
+
}
|
|
3815
|
+
if (params.isHovered) {
|
|
3816
|
+
return mergeLinkStyle(baseStyle, params.interaction?.hover?.linkStyle);
|
|
3817
|
+
}
|
|
3818
|
+
return baseStyle;
|
|
3819
|
+
}
|
|
3820
|
+
function mergeLinkStyle(base, override) {
|
|
3821
|
+
const stroke = override?.stroke ?? base.stroke;
|
|
3822
|
+
return {
|
|
3823
|
+
stroke,
|
|
3824
|
+
strokeWidth: override?.strokeWidth ?? base.strokeWidth,
|
|
3825
|
+
opacity: override?.opacity ?? base.opacity,
|
|
3826
|
+
dashArray: override?.dashArray ?? base.dashArray,
|
|
3827
|
+
arrow: {
|
|
3828
|
+
enabled: override?.arrow?.enabled ?? base.arrow.enabled,
|
|
3829
|
+
size: override?.arrow?.size ?? base.arrow.size,
|
|
3830
|
+
fill: override?.arrow?.fill ?? override?.stroke ?? (base.arrow.fill || base.stroke)
|
|
3831
|
+
},
|
|
3832
|
+
label: {
|
|
3833
|
+
enabled: override?.label?.enabled ?? base.label.enabled,
|
|
3834
|
+
backgroundFill: override?.label?.backgroundFill ?? base.label.backgroundFill,
|
|
3835
|
+
borderColor: override?.label?.borderColor ?? base.label.borderColor,
|
|
3836
|
+
borderWidth: override?.label?.borderWidth ?? base.label.borderWidth,
|
|
3837
|
+
borderRadius: override?.label?.borderRadius ?? base.label.borderRadius,
|
|
3838
|
+
textColor: override?.label?.textColor ?? base.label.textColor,
|
|
3839
|
+
fontSize: override?.label?.fontSize ?? base.label.fontSize,
|
|
3840
|
+
paddingX: override?.label?.paddingX ?? base.label.paddingX,
|
|
3841
|
+
paddingY: override?.label?.paddingY ?? base.label.paddingY,
|
|
3842
|
+
height: override?.label?.height ?? base.label.height
|
|
3843
|
+
}
|
|
3844
|
+
};
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
// src/utils/get-link-marker-id.ts
|
|
3848
|
+
function getLinkMarkerId(style) {
|
|
3849
|
+
const markerStyle = {
|
|
3850
|
+
stroke: style.stroke ?? "#94a3b8",
|
|
3851
|
+
strokeWidth: style.strokeWidth ?? 2,
|
|
3852
|
+
arrowFill: style.arrow?.fill ?? style.stroke ?? "#94a3b8",
|
|
3853
|
+
arrowSize: style.arrow?.size ?? 6
|
|
3854
|
+
};
|
|
3855
|
+
const serializedStyle = JSON.stringify(markerStyle);
|
|
3856
|
+
const hash = createHash(serializedStyle);
|
|
3857
|
+
return `graph-arrow-${hash}`;
|
|
3858
|
+
}
|
|
3859
|
+
function createHash(value) {
|
|
3860
|
+
let hash = 0;
|
|
3861
|
+
for (let index2 = 0; index2 < value.length; index2 += 1) {
|
|
3862
|
+
const charCode = value.charCodeAt(index2);
|
|
3863
|
+
hash = (hash << 5) - hash + charCode;
|
|
3864
|
+
hash |= 0;
|
|
3865
|
+
}
|
|
3866
|
+
return Math.abs(hash).toString(36);
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
// src/core/create-arrow-marker.ts
|
|
3870
|
+
function createArrowMarker(params) {
|
|
3871
|
+
const markerId = getLinkMarkerId(params.style);
|
|
3872
|
+
const existingMarker = params.svg.querySelector(`#${markerId}`);
|
|
3873
|
+
if (existingMarker) {
|
|
3874
|
+
return markerId;
|
|
3875
|
+
}
|
|
3876
|
+
const arrowSize = params.style.arrow?.size ?? 6;
|
|
3877
|
+
const fill = params.style.arrow?.fill ?? params.style.stroke ?? "#94a3b8";
|
|
3878
|
+
const defs = document.createElementNS("http://www.w3.org/2000/svg", "defs");
|
|
3879
|
+
const marker = document.createElementNS("http://www.w3.org/2000/svg", "marker");
|
|
3880
|
+
marker.setAttribute("id", markerId);
|
|
3881
|
+
marker.setAttribute("viewBox", "0 0 20 20");
|
|
3882
|
+
marker.setAttribute("refX", "0");
|
|
3883
|
+
marker.setAttribute("refY", "10");
|
|
3884
|
+
marker.setAttribute("markerWidth", String(arrowSize * 2));
|
|
3885
|
+
marker.setAttribute("markerHeight", String(arrowSize * 2));
|
|
3886
|
+
marker.setAttribute("orient", "auto");
|
|
3887
|
+
marker.setAttribute("markerUnits", "userSpaceOnUse");
|
|
3888
|
+
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3889
|
+
path.setAttribute("d", "M 0 0 L 20 10 L 0 20 z");
|
|
3890
|
+
path.setAttribute("fill", fill);
|
|
3891
|
+
marker.appendChild(path);
|
|
3892
|
+
defs.appendChild(marker);
|
|
3893
|
+
params.svg.insertBefore(defs, params.svg.firstChild);
|
|
3894
|
+
return markerId;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
// src/renderer/links.ts
|
|
3898
|
+
function getShortenedTargetPoint(link, style) {
|
|
3899
|
+
const source = link.source;
|
|
3900
|
+
const target = link.target;
|
|
3901
|
+
const sourceX = source.x ?? 0;
|
|
3902
|
+
const sourceY = source.y ?? 0;
|
|
3903
|
+
const targetX = target.x ?? 0;
|
|
3904
|
+
const targetY = target.y ?? 0;
|
|
3905
|
+
const dx = targetX - sourceX;
|
|
3906
|
+
const dy = targetY - sourceY;
|
|
3907
|
+
const distance = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
3908
|
+
const targetRadius = target.style?.radius ?? 12;
|
|
3909
|
+
const arrowLength = style.arrow.enabled ? style.arrow.size * 2 : 0;
|
|
3910
|
+
const strokeCompensation = style.strokeWidth / 2;
|
|
3911
|
+
const visualSpacing = 2;
|
|
3912
|
+
const offset = targetRadius + arrowLength + strokeCompensation + visualSpacing;
|
|
3913
|
+
return {
|
|
3914
|
+
x: targetX - dx / distance * offset,
|
|
3915
|
+
y: targetY - dy / distance * offset
|
|
3916
|
+
};
|
|
3917
|
+
}
|
|
3918
|
+
function createRenderableLinks(ctx, links) {
|
|
3919
|
+
return links.map(
|
|
3920
|
+
(link) => {
|
|
3921
|
+
const style = resolveLinkStyle({ link, interaction: ctx.interaction });
|
|
3922
|
+
const markerEnd = style.arrow.enabled ? `url(#${createArrowMarker({ svg: ctx.svg, style })})` : "";
|
|
3923
|
+
return { link, style, markerEnd };
|
|
3924
|
+
}
|
|
3925
|
+
);
|
|
3926
|
+
}
|
|
3927
|
+
function getLinkKey(link) {
|
|
3928
|
+
const sourceId = typeof link.source === "string" ? link.source : link.source.id;
|
|
3929
|
+
const targetId = typeof link.target === "string" ? link.target : link.target.id;
|
|
3930
|
+
return `${sourceId}::${targetId}::${link.label ?? ""}`;
|
|
3931
|
+
}
|
|
3932
|
+
function renderLinks(ctx, links) {
|
|
3933
|
+
const renderableLinks = createRenderableLinks(ctx, links);
|
|
3934
|
+
return ctx.root.select('[data-layer="links"]').selectAll("line").data(renderableLinks, (item) => getLinkKey(item.link)).join("line").attr("stroke", (item) => item.style.stroke).attr("stroke-width", (item) => item.style.strokeWidth).attr("opacity", (item) => item.style.opacity).attr("marker-end", (item) => item.markerEnd);
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
// src/renderer/nodes.ts
|
|
3938
|
+
function renderNodes(ctx, nodes) {
|
|
3939
|
+
return ctx.root.select('[data-layer="nodes"]').selectAll("circle").data(
|
|
3940
|
+
nodes,
|
|
3941
|
+
(d) => d.id
|
|
3942
|
+
).join("circle").attr(
|
|
3943
|
+
"r",
|
|
3944
|
+
(node) => node.style?.radius ?? 8
|
|
3945
|
+
).attr(
|
|
3946
|
+
"fill",
|
|
3947
|
+
(node) => node.style?.fill ?? "#6c5ce7"
|
|
3948
|
+
).attr(
|
|
3949
|
+
"stroke",
|
|
3950
|
+
(node) => node.style?.stroke ?? "#ffffff"
|
|
3951
|
+
).attr(
|
|
3952
|
+
"stroke-width",
|
|
3953
|
+
(node) => node.style?.strokeWidth ?? 1.5
|
|
3954
|
+
).attr(
|
|
3955
|
+
"opacity",
|
|
3956
|
+
(node) => node.style?.opacity ?? 1
|
|
3957
|
+
);
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
// src/renderer/node-labels.ts
|
|
3961
|
+
function renderNodeLabels(ctx, nodes) {
|
|
3962
|
+
const selection2 = ctx.root.select('[data-layer="node-labels"]').selectAll("text").data(
|
|
3963
|
+
nodes,
|
|
3964
|
+
(d) => d.id
|
|
3965
|
+
).join("text").attr(
|
|
3966
|
+
"text-anchor",
|
|
3967
|
+
"middle"
|
|
3968
|
+
).attr(
|
|
3969
|
+
"dominant-baseline",
|
|
3970
|
+
"middle"
|
|
3971
|
+
).attr(
|
|
3972
|
+
"font-size",
|
|
3973
|
+
11
|
|
3974
|
+
).attr(
|
|
3975
|
+
"fill",
|
|
3976
|
+
(node) => node.style?.textColor ?? "#ffffff"
|
|
3977
|
+
).attr(
|
|
3978
|
+
"pointer-events",
|
|
3979
|
+
"none"
|
|
3980
|
+
).text(
|
|
3981
|
+
(node) => node.label ?? node.id
|
|
3982
|
+
);
|
|
3983
|
+
selection2.each(function(node) {
|
|
3984
|
+
const textElement = this;
|
|
3985
|
+
const fullLabel = node.label ?? node.id;
|
|
3986
|
+
const radius = node.style?.radius ?? 8;
|
|
3987
|
+
const maxWidth = radius * 2 - 6;
|
|
3988
|
+
let truncatedLabel = fullLabel;
|
|
3989
|
+
textElement.textContent = truncatedLabel;
|
|
3990
|
+
while (truncatedLabel.length > 1 && textElement.getComputedTextLength() > maxWidth) {
|
|
3991
|
+
truncatedLabel = truncatedLabel.slice(
|
|
3992
|
+
0,
|
|
3993
|
+
-1
|
|
3994
|
+
);
|
|
3995
|
+
textElement.textContent = `${truncatedLabel}\u2026`;
|
|
3996
|
+
}
|
|
3997
|
+
});
|
|
3998
|
+
return selection2;
|
|
3999
|
+
}
|
|
4000
|
+
|
|
4001
|
+
// src/renderer/link-labels.ts
|
|
4002
|
+
function createRenderableLinks2(params, links) {
|
|
4003
|
+
return links.map(
|
|
4004
|
+
(link) => ({ link, style: resolveLinkStyle({ link, interaction: params.interaction }) })
|
|
4005
|
+
).filter(
|
|
4006
|
+
(item) => item.style.label.enabled && Boolean(item.link.label)
|
|
4007
|
+
);
|
|
4008
|
+
}
|
|
4009
|
+
function getLinkKey2(link) {
|
|
4010
|
+
const sourceId = typeof link.source === "string" ? link.source : link.source.id;
|
|
4011
|
+
const targetId = typeof link.target === "string" ? link.target : link.target.id;
|
|
4012
|
+
return `${sourceId}::${targetId}::${link.label ?? ""}`;
|
|
4013
|
+
}
|
|
4014
|
+
function renderLinkLabels(params, links) {
|
|
4015
|
+
const renderableLinks = createRenderableLinks2(params, links);
|
|
4016
|
+
const labelSelection = params.root.select(".link-labels").selectAll(".link-label").data(renderableLinks, (item) => getLinkKey2(item.link)).join("g").attr("class", "link-label").attr("pointer-events", "auto").attr("cursor", "pointer");
|
|
4017
|
+
labelSelection.selectAll("rect").data((item) => [item]).join("rect").attr("rx", (item) => item.style.label.borderRadius).attr("ry", (item) => item.style.label.borderRadius).attr("height", (item) => item.style.label.height).attr("fill", (item) => item.style.label.backgroundFill).attr("stroke", (item) => item.style.label.borderColor).attr("stroke-width", (item) => item.style.label.borderWidth);
|
|
4018
|
+
labelSelection.selectAll("text").data((item) => [item]).join("text").attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-size", (item) => item.style.label.fontSize).attr("fill", (item) => item.style.label.textColor).text((item) => item.link.label ?? "");
|
|
4019
|
+
return labelSelection;
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
// src/interactions/create-drag-behavior.ts
|
|
4023
|
+
function createDragBehavior(simulation) {
|
|
4024
|
+
return drag_default().on("start", (event, d) => {
|
|
4025
|
+
if (!event.active) {
|
|
4026
|
+
simulation.alphaTarget(0.8).restart();
|
|
4027
|
+
}
|
|
4028
|
+
d.fx = d.x;
|
|
4029
|
+
d.fy = d.y;
|
|
4030
|
+
}).on("drag", (event, d) => {
|
|
4031
|
+
d.fx = event.x;
|
|
4032
|
+
d.fy = event.y;
|
|
4033
|
+
simulation.alpha(0.4).restart();
|
|
4034
|
+
}).on("end", (event, d) => {
|
|
4035
|
+
if (!event.active) {
|
|
4036
|
+
simulation.alphaTarget(0);
|
|
4037
|
+
}
|
|
4038
|
+
d.fx = null;
|
|
4039
|
+
d.fy = null;
|
|
4040
|
+
});
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
// src/interactions/create-node-hover.ts
|
|
4044
|
+
function createNodeHover(nodeSelection, hoverStyle) {
|
|
4045
|
+
if (!hoverStyle) {
|
|
4046
|
+
return;
|
|
4047
|
+
}
|
|
4048
|
+
nodeSelection.on(
|
|
4049
|
+
"mouseenter.hover",
|
|
4050
|
+
function(_event, node) {
|
|
4051
|
+
const circle = this;
|
|
4052
|
+
const hoverStroke = hoverStyle.stroke ?? node.style?.stroke ?? "#ffffff";
|
|
4053
|
+
const hoverStrokeWidth = hoverStyle.strokeWidth ?? node.style?.strokeWidth ?? 1.5;
|
|
4054
|
+
const hoverOpacity = hoverStyle.opacity ?? node.style?.opacity ?? 1;
|
|
4055
|
+
circle.setAttribute(
|
|
4056
|
+
"stroke",
|
|
4057
|
+
hoverStroke
|
|
4058
|
+
);
|
|
4059
|
+
circle.setAttribute(
|
|
4060
|
+
"stroke-width",
|
|
4061
|
+
String(
|
|
4062
|
+
hoverStrokeWidth
|
|
4063
|
+
)
|
|
4064
|
+
);
|
|
4065
|
+
circle.setAttribute(
|
|
4066
|
+
"opacity",
|
|
4067
|
+
String(
|
|
4068
|
+
hoverOpacity
|
|
4069
|
+
)
|
|
4070
|
+
);
|
|
4071
|
+
}
|
|
4072
|
+
).on(
|
|
4073
|
+
"mouseleave.hover",
|
|
4074
|
+
function(_event, node) {
|
|
4075
|
+
const circle = this;
|
|
4076
|
+
const defaultStroke = node.style?.stroke ?? "#ffffff";
|
|
4077
|
+
const defaultStrokeWidth = node.style?.strokeWidth ?? 1.5;
|
|
4078
|
+
const defaultOpacity = node.style?.opacity ?? 1;
|
|
4079
|
+
circle.setAttribute(
|
|
4080
|
+
"stroke",
|
|
4081
|
+
defaultStroke
|
|
4082
|
+
);
|
|
4083
|
+
circle.setAttribute(
|
|
4084
|
+
"stroke-width",
|
|
4085
|
+
String(
|
|
4086
|
+
defaultStrokeWidth
|
|
4087
|
+
)
|
|
4088
|
+
);
|
|
4089
|
+
circle.setAttribute(
|
|
4090
|
+
"opacity",
|
|
4091
|
+
String(
|
|
4092
|
+
defaultOpacity
|
|
4093
|
+
)
|
|
4094
|
+
);
|
|
4095
|
+
}
|
|
4096
|
+
);
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
// src/utils/resolve-tooltip-position.ts
|
|
4100
|
+
function resolveTooltipPosition(params) {
|
|
4101
|
+
const preferredPlacement = params.placement ?? "auto";
|
|
4102
|
+
const resolvedPlacement = preferredPlacement === "auto" ? resolveAutoPlacement(params) : preferredPlacement;
|
|
4103
|
+
const position = getPositionByPlacement({ ...params, placement: resolvedPlacement });
|
|
4104
|
+
return position;
|
|
4105
|
+
}
|
|
4106
|
+
function resolveAutoPlacement(params) {
|
|
4107
|
+
const viewportWidth = window.innerWidth;
|
|
4108
|
+
const viewportHeight = window.innerHeight;
|
|
4109
|
+
const tooltipWidth = params.tooltipRect.width;
|
|
4110
|
+
const tooltipHeight = params.tooltipRect.height;
|
|
4111
|
+
const centerX = params.targetRect.left + params.targetRect.width / 2;
|
|
4112
|
+
const centerY = params.targetRect.top + params.targetRect.height / 2;
|
|
4113
|
+
const deltaX = params.cursorX - centerX;
|
|
4114
|
+
const deltaY = params.cursorY - centerY;
|
|
4115
|
+
const prefersVertical = Math.abs(deltaY) > Math.abs(deltaX);
|
|
4116
|
+
if (prefersVertical) {
|
|
4117
|
+
if (deltaY < 0 && params.targetRect.top >= tooltipHeight + params.gap) {
|
|
4118
|
+
return "top";
|
|
4119
|
+
}
|
|
4120
|
+
if (deltaY >= 0 && viewportHeight - params.targetRect.bottom >= tooltipHeight + params.gap) {
|
|
4121
|
+
return "bottom";
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
if (!prefersVertical) {
|
|
4125
|
+
if (deltaX >= 0 && viewportWidth - params.targetRect.right >= tooltipWidth + params.gap) {
|
|
4126
|
+
return "right";
|
|
4127
|
+
}
|
|
4128
|
+
if (deltaX < 0 && params.targetRect.left >= tooltipWidth + params.gap) {
|
|
4129
|
+
return "left";
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
if (params.targetRect.top >= tooltipHeight + params.gap) {
|
|
4133
|
+
return "top";
|
|
4134
|
+
}
|
|
4135
|
+
if (viewportWidth - params.targetRect.right >= tooltipWidth + params.gap) {
|
|
4136
|
+
return "right";
|
|
4137
|
+
}
|
|
4138
|
+
if (params.targetRect.left >= tooltipWidth + params.gap) {
|
|
4139
|
+
return "left";
|
|
4140
|
+
}
|
|
4141
|
+
if (viewportHeight - params.targetRect.bottom >= tooltipHeight + params.gap) {
|
|
4142
|
+
return "bottom";
|
|
4143
|
+
}
|
|
4144
|
+
return "top";
|
|
4145
|
+
}
|
|
4146
|
+
function getPositionByPlacement(params) {
|
|
4147
|
+
const { targetRect, tooltipRect, gap, placement } = params;
|
|
4148
|
+
let left = 0;
|
|
4149
|
+
let top = 0;
|
|
4150
|
+
if (placement === "top") {
|
|
4151
|
+
left = targetRect.left + targetRect.width / 2 - tooltipRect.width / 2;
|
|
4152
|
+
top = targetRect.top - tooltipRect.height - gap;
|
|
4153
|
+
}
|
|
4154
|
+
if (placement === "bottom") {
|
|
4155
|
+
left = targetRect.left + targetRect.width / 2 - tooltipRect.width / 2;
|
|
4156
|
+
top = targetRect.bottom + gap;
|
|
4157
|
+
}
|
|
4158
|
+
if (placement === "left") {
|
|
4159
|
+
left = targetRect.left - tooltipRect.width - gap;
|
|
4160
|
+
top = targetRect.top + targetRect.height / 2 - tooltipRect.height / 2;
|
|
4161
|
+
}
|
|
4162
|
+
if (placement === "right") {
|
|
4163
|
+
left = targetRect.right + gap;
|
|
4164
|
+
top = targetRect.top + targetRect.height / 2 - tooltipRect.height / 2;
|
|
4165
|
+
}
|
|
4166
|
+
return { left, top, placement };
|
|
4167
|
+
}
|
|
4168
|
+
|
|
4169
|
+
// src/core/create-tooltip-overlay.ts
|
|
4170
|
+
function createTooltipOverlay(params) {
|
|
4171
|
+
const tooltip = document.createElement("div");
|
|
4172
|
+
const arrow = document.createElement("div");
|
|
4173
|
+
const contentWrapper = document.createElement("div");
|
|
4174
|
+
const appendTarget = document.body;
|
|
4175
|
+
let activePlacement = null;
|
|
4176
|
+
const theme = params.tooltipConfig?.theme ?? "dark";
|
|
4177
|
+
tooltip.className = `graph-tooltip graph-tooltip--${theme}`;
|
|
4178
|
+
arrow.className = "graph-tooltip__arrow";
|
|
4179
|
+
contentWrapper.className = "graph-tooltip__content";
|
|
4180
|
+
tooltip.appendChild(arrow);
|
|
4181
|
+
tooltip.appendChild(contentWrapper);
|
|
4182
|
+
appendTarget.appendChild(tooltip);
|
|
4183
|
+
function show(content, target, event) {
|
|
4184
|
+
contentWrapper.innerHTML = content;
|
|
4185
|
+
tooltip.classList.add("graph-tooltip--visible");
|
|
4186
|
+
const targetRect = target.getBoundingClientRect();
|
|
4187
|
+
const tooltipRect = tooltip.getBoundingClientRect();
|
|
4188
|
+
const gap = 12;
|
|
4189
|
+
const resolvedPosition = resolveTooltipPosition({
|
|
4190
|
+
targetRect,
|
|
4191
|
+
tooltipRect,
|
|
4192
|
+
gap,
|
|
4193
|
+
cursorX: event.clientX,
|
|
4194
|
+
cursorY: event.clientY,
|
|
4195
|
+
placement: params.tooltipConfig?.placement ?? "auto"
|
|
4196
|
+
});
|
|
4197
|
+
activePlacement = resolvedPosition.placement;
|
|
4198
|
+
tooltip.style.left = `${resolvedPosition.left}px`;
|
|
4199
|
+
tooltip.style.top = `${resolvedPosition.top}px`;
|
|
4200
|
+
updateArrowPlacement(resolvedPosition.placement);
|
|
4201
|
+
}
|
|
4202
|
+
function move(target) {
|
|
4203
|
+
if (!activePlacement) {
|
|
4204
|
+
return;
|
|
4205
|
+
}
|
|
4206
|
+
const targetRect = target.getBoundingClientRect();
|
|
4207
|
+
const tooltipRect = tooltip.getBoundingClientRect();
|
|
4208
|
+
const gap = 12;
|
|
4209
|
+
const resolvedPosition = resolveTooltipPosition({
|
|
4210
|
+
targetRect,
|
|
4211
|
+
tooltipRect,
|
|
4212
|
+
gap,
|
|
4213
|
+
cursorX: targetRect.left + targetRect.width / 2,
|
|
4214
|
+
cursorY: targetRect.top + targetRect.height / 2,
|
|
4215
|
+
placement: activePlacement
|
|
4216
|
+
});
|
|
4217
|
+
tooltip.style.left = `${resolvedPosition.left}px`;
|
|
4218
|
+
tooltip.style.top = `${resolvedPosition.top}px`;
|
|
4219
|
+
}
|
|
4220
|
+
function updateArrowPlacement(placement) {
|
|
4221
|
+
arrow.className = `graph-tooltip__arrow graph-tooltip__arrow--${placement}`;
|
|
4222
|
+
}
|
|
4223
|
+
function hide() {
|
|
4224
|
+
activePlacement = null;
|
|
4225
|
+
tooltip.classList.remove("graph-tooltip--visible");
|
|
4226
|
+
}
|
|
4227
|
+
function destroy() {
|
|
4228
|
+
tooltip.remove();
|
|
4229
|
+
}
|
|
4230
|
+
return { show, move, hide, destroy };
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
// src/interactions/bind-node-tooltip.ts
|
|
4234
|
+
function bindNodeTooltip(params) {
|
|
4235
|
+
if (!params.tooltipConfig?.enabled) {
|
|
4236
|
+
return {
|
|
4237
|
+
destroy: () => {
|
|
4238
|
+
},
|
|
4239
|
+
reposition: () => {
|
|
4240
|
+
}
|
|
4241
|
+
};
|
|
4242
|
+
}
|
|
4243
|
+
const tooltip = createTooltipOverlay({ container: params.container, tooltipConfig: params.tooltipConfig });
|
|
4244
|
+
let activeTarget = null;
|
|
4245
|
+
params.selection.on(
|
|
4246
|
+
"mouseenter.tooltip",
|
|
4247
|
+
function(event, node) {
|
|
4248
|
+
const target = this;
|
|
4249
|
+
activeTarget = target;
|
|
4250
|
+
const customContent = params.tooltipConfig?.renderContent?.(node);
|
|
4251
|
+
const content = customContent ?? getDefaultContent(node);
|
|
4252
|
+
tooltip.show(content, target, event);
|
|
4253
|
+
}
|
|
4254
|
+
).on(
|
|
4255
|
+
"mousemove.tooltip",
|
|
4256
|
+
function() {
|
|
4257
|
+
const target = this;
|
|
4258
|
+
activeTarget = target;
|
|
4259
|
+
tooltip.move(target);
|
|
4260
|
+
}
|
|
4261
|
+
).on(
|
|
4262
|
+
"mouseleave.tooltip",
|
|
4263
|
+
function() {
|
|
4264
|
+
activeTarget = null;
|
|
4265
|
+
tooltip.hide();
|
|
4266
|
+
}
|
|
4267
|
+
);
|
|
4268
|
+
function reposition() {
|
|
4269
|
+
if (!activeTarget) {
|
|
4270
|
+
return;
|
|
4271
|
+
}
|
|
4272
|
+
tooltip.move(activeTarget);
|
|
4273
|
+
}
|
|
4274
|
+
function destroy() {
|
|
4275
|
+
activeTarget = null;
|
|
4276
|
+
params.selection.on(".tooltip", null);
|
|
4277
|
+
tooltip.destroy();
|
|
4278
|
+
}
|
|
4279
|
+
return { destroy, reposition };
|
|
4280
|
+
}
|
|
4281
|
+
function getDefaultContent(node) {
|
|
4282
|
+
return `
|
|
4283
|
+
<div class="graph-tooltip__type">
|
|
4284
|
+
${node.type ?? "Node"}
|
|
4285
|
+
</div>
|
|
4286
|
+
|
|
4287
|
+
<div class="graph-tooltip__label">
|
|
4288
|
+
${node.label ?? node.id}
|
|
4289
|
+
</div>
|
|
4290
|
+
`;
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
// src/utils/observe-resize.ts
|
|
4294
|
+
function observeResize(element, onResize) {
|
|
4295
|
+
const observer = new ResizeObserver(
|
|
4296
|
+
(entries) => {
|
|
4297
|
+
const entry = entries[0];
|
|
4298
|
+
if (!entry) {
|
|
4299
|
+
return;
|
|
4300
|
+
}
|
|
4301
|
+
onResize(
|
|
4302
|
+
entry.contentRect.width,
|
|
4303
|
+
entry.contentRect.height
|
|
4304
|
+
);
|
|
4305
|
+
}
|
|
4306
|
+
);
|
|
4307
|
+
observer.observe(element);
|
|
4308
|
+
return () => {
|
|
4309
|
+
observer.disconnect();
|
|
4310
|
+
};
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4313
|
+
// src/utils/get-link-target-point.ts
|
|
4314
|
+
function getLinkTargetPoint(link) {
|
|
4315
|
+
const source = link.source;
|
|
4316
|
+
const target = link.target;
|
|
4317
|
+
const sourceX = source.x ?? 0;
|
|
4318
|
+
const sourceY = source.y ?? 0;
|
|
4319
|
+
const targetX = target.x ?? 0;
|
|
4320
|
+
const targetY = target.y ?? 0;
|
|
4321
|
+
const dx = targetX - sourceX;
|
|
4322
|
+
const dy = targetY - sourceY;
|
|
4323
|
+
const distance = Math.sqrt(
|
|
4324
|
+
dx * dx + dy * dy
|
|
4325
|
+
) || 1;
|
|
4326
|
+
const targetRadius = target.style?.radius ?? 12;
|
|
4327
|
+
const targetStrokeWidth = target.style?.strokeWidth ?? 2;
|
|
4328
|
+
const gap = 4;
|
|
4329
|
+
const offset = targetRadius + targetStrokeWidth + // markerLength +
|
|
4330
|
+
gap;
|
|
4331
|
+
return {
|
|
4332
|
+
x: targetX - dx / distance * offset,
|
|
4333
|
+
y: targetY - dy / distance * offset
|
|
4334
|
+
};
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
// src/create-graph.ts
|
|
4338
|
+
function createGraph(config) {
|
|
4339
|
+
let cleanupResize = null;
|
|
4340
|
+
let cleanupZoom = null;
|
|
4341
|
+
let tooltipBinding = null;
|
|
4342
|
+
let dimensions = { width: 0, height: 0 };
|
|
4343
|
+
let rootGroup = null;
|
|
4344
|
+
let zoomBehavior = null;
|
|
4345
|
+
let simulation = null;
|
|
4346
|
+
function render() {
|
|
4347
|
+
destroy();
|
|
4348
|
+
const layers = createGraphLayers(config.container);
|
|
4349
|
+
rootGroup = layers.root;
|
|
4350
|
+
cleanupResize = observeResize(
|
|
4351
|
+
config.container,
|
|
4352
|
+
(width, height) => {
|
|
4353
|
+
dimensions = { width, height };
|
|
4354
|
+
layers.interactionRect.setAttribute("width", String(width));
|
|
4355
|
+
layers.interactionRect.setAttribute("height", String(height));
|
|
4356
|
+
simulation?.force("x", x_default2(width / 2).strength(0.03));
|
|
4357
|
+
simulation?.force("y", y_default2(height / 2).strength(0.03));
|
|
4358
|
+
simulation?.alpha(0.25).restart();
|
|
4359
|
+
}
|
|
4360
|
+
);
|
|
4361
|
+
const zoomResult = createZoom({
|
|
4362
|
+
/**
|
|
4363
|
+
* D3 zoom must be attached to SVG
|
|
4364
|
+
* because it requires:
|
|
4365
|
+
*
|
|
4366
|
+
* width.baseVal
|
|
4367
|
+
* height.baseVal
|
|
4368
|
+
*/
|
|
4369
|
+
svg: config.container,
|
|
4370
|
+
/**
|
|
4371
|
+
* Used for pointer semantics /
|
|
4372
|
+
* pan filtering only
|
|
4373
|
+
*/
|
|
4374
|
+
interactionLayer: layers.interactionLayer,
|
|
4375
|
+
/**
|
|
4376
|
+
* Actual graph transform target
|
|
4377
|
+
*/
|
|
4378
|
+
root: layers.root
|
|
4379
|
+
});
|
|
4380
|
+
zoomBehavior = zoomResult.behavior;
|
|
4381
|
+
cleanupZoom = zoomResult.cleanup;
|
|
4382
|
+
const root2 = select_default2(layers.root);
|
|
4383
|
+
const renderContext = { svg: config.container, root: root2, interaction: config.interaction };
|
|
4384
|
+
const linkSelection = renderLinks(renderContext, config.links);
|
|
4385
|
+
const linkLabelSelection = renderLinkLabels(renderContext, config.links);
|
|
4386
|
+
const nodeSelection = renderNodes(renderContext, config.nodes);
|
|
4387
|
+
const labelSelection = renderNodeLabels(renderContext, config.nodes);
|
|
4388
|
+
const simulationConfig = {
|
|
4389
|
+
nodes: config.nodes,
|
|
4390
|
+
links: config.links,
|
|
4391
|
+
width: config.container.clientWidth,
|
|
4392
|
+
height: config.container.clientHeight
|
|
4393
|
+
};
|
|
4394
|
+
const simulationResult = createGraphSimulation(simulationConfig);
|
|
4395
|
+
simulation = simulationResult.simulation;
|
|
4396
|
+
simulation.on(
|
|
4397
|
+
"tick",
|
|
4398
|
+
() => {
|
|
4399
|
+
linkSelection.attr("x1", (item) => item.link.source.x ?? 0).attr("y1", (item) => item.link.source.y ?? 0).attr("x2", (item) => getShortenedTargetPoint(item.link, item.style).x).attr("y2", (item) => getShortenedTargetPoint(item.link, item.style).y);
|
|
4400
|
+
linkLabelSelection.attr("transform", (item) => {
|
|
4401
|
+
const link = item.link;
|
|
4402
|
+
const source = link.source;
|
|
4403
|
+
const targetPoint = getLinkTargetPoint(link);
|
|
4404
|
+
const x3 = ((source.x ?? 0) + targetPoint.x) / 2;
|
|
4405
|
+
const y3 = ((source.y ?? 0) + targetPoint.y) / 2;
|
|
4406
|
+
return `translate(${x3}, ${y3})`;
|
|
4407
|
+
}).each(function() {
|
|
4408
|
+
const group = this;
|
|
4409
|
+
const text = group.querySelector("text");
|
|
4410
|
+
const rect = group.querySelector("rect");
|
|
4411
|
+
if (!text || !rect) {
|
|
4412
|
+
return;
|
|
4413
|
+
}
|
|
4414
|
+
const bBox = text.getBBox();
|
|
4415
|
+
const padding = 6;
|
|
4416
|
+
rect.setAttribute("x", String(bBox.x - padding));
|
|
4417
|
+
rect.setAttribute("y", String(bBox.y - padding));
|
|
4418
|
+
rect.setAttribute("width", String(bBox.width + padding * 2));
|
|
4419
|
+
rect.setAttribute("height", String(bBox.height + padding * 2));
|
|
4420
|
+
});
|
|
4421
|
+
nodeSelection.attr("cx", (d) => d.x ?? 0).attr("cy", (d) => d.y ?? 0);
|
|
4422
|
+
labelSelection.attr("x", (d) => d.x ?? 0).attr("y", (d) => d.y ?? 0);
|
|
4423
|
+
tooltipBinding?.reposition();
|
|
4424
|
+
}
|
|
4425
|
+
);
|
|
4426
|
+
if (config.interaction?.hover?.enabled) {
|
|
4427
|
+
if (config.interaction?.hover?.tooltip?.enabled) {
|
|
4428
|
+
tooltipBinding = bindNodeTooltip({
|
|
4429
|
+
container: config.container.parentElement,
|
|
4430
|
+
selection: nodeSelection,
|
|
4431
|
+
tooltipConfig: config.interaction.hover.tooltip
|
|
4432
|
+
});
|
|
4433
|
+
}
|
|
4434
|
+
createNodeHover(nodeSelection, config.interaction.hover.nodeStyle);
|
|
4435
|
+
}
|
|
4436
|
+
if (config.interaction?.drag?.enabled !== false) {
|
|
4437
|
+
nodeSelection.call(createDragBehavior(simulation));
|
|
4438
|
+
}
|
|
4439
|
+
if (config.interaction?.selection?.enabled) {
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
function resetView() {
|
|
4443
|
+
if (!zoomBehavior) {
|
|
4444
|
+
return;
|
|
4445
|
+
}
|
|
4446
|
+
select_default2(config.container).transition().call(
|
|
4447
|
+
zoomBehavior.transform,
|
|
4448
|
+
identity2
|
|
4449
|
+
);
|
|
4450
|
+
}
|
|
4451
|
+
function fitView() {
|
|
4452
|
+
if (!zoomBehavior || !rootGroup || dimensions.width === 0 || dimensions.height === 0) {
|
|
4453
|
+
return;
|
|
4454
|
+
}
|
|
4455
|
+
const bounds = rootGroup.getBBox();
|
|
4456
|
+
if (bounds.width === 0 || bounds.height === 0) {
|
|
4457
|
+
return;
|
|
4458
|
+
}
|
|
4459
|
+
const width = dimensions.width;
|
|
4460
|
+
const height = dimensions.height;
|
|
4461
|
+
const scale = Math.min(
|
|
4462
|
+
width / bounds.width,
|
|
4463
|
+
height / bounds.height
|
|
4464
|
+
) * 0.9;
|
|
4465
|
+
const translateX = (width - bounds.width * scale) / 2 - bounds.x * scale;
|
|
4466
|
+
const translateY = (height - bounds.height * scale) / 2 - bounds.y * scale;
|
|
4467
|
+
const transform2 = identity2.translate(
|
|
4468
|
+
translateX,
|
|
4469
|
+
translateY
|
|
4470
|
+
).scale(scale);
|
|
4471
|
+
select_default2(config.container).transition().call(
|
|
4472
|
+
zoomBehavior.transform,
|
|
4473
|
+
transform2
|
|
4474
|
+
);
|
|
4475
|
+
}
|
|
4476
|
+
function zoomIn() {
|
|
4477
|
+
if (!zoomBehavior) {
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
4480
|
+
select_default2(config.container).transition().call(
|
|
4481
|
+
zoomBehavior.scaleBy,
|
|
4482
|
+
1.2
|
|
4483
|
+
);
|
|
4484
|
+
}
|
|
4485
|
+
function zoomOut() {
|
|
4486
|
+
if (!zoomBehavior) {
|
|
4487
|
+
return;
|
|
4488
|
+
}
|
|
4489
|
+
select_default2(config.container).transition().call(
|
|
4490
|
+
zoomBehavior.scaleBy,
|
|
4491
|
+
0.8
|
|
4492
|
+
);
|
|
4493
|
+
}
|
|
4494
|
+
function destroy() {
|
|
4495
|
+
if (cleanupResize) {
|
|
4496
|
+
cleanupResize();
|
|
4497
|
+
cleanupResize = null;
|
|
4498
|
+
}
|
|
4499
|
+
if (cleanupZoom) {
|
|
4500
|
+
cleanupZoom();
|
|
4501
|
+
cleanupZoom = null;
|
|
4502
|
+
}
|
|
4503
|
+
if (tooltipBinding) {
|
|
4504
|
+
tooltipBinding.destroy();
|
|
4505
|
+
tooltipBinding = null;
|
|
4506
|
+
}
|
|
4507
|
+
if (simulation) {
|
|
4508
|
+
simulation.stop();
|
|
4509
|
+
simulation = null;
|
|
4510
|
+
}
|
|
4511
|
+
rootGroup = null;
|
|
4512
|
+
zoomBehavior = null;
|
|
4513
|
+
while (config.container.firstChild) {
|
|
4514
|
+
config.container.removeChild(config.container.firstChild);
|
|
4515
|
+
}
|
|
4516
|
+
}
|
|
4517
|
+
return { render, zoomIn, zoomOut, resetView, fitView, destroy };
|
|
4518
|
+
}
|
|
4519
|
+
export {
|
|
4520
|
+
createGraph
|
|
4521
|
+
};
|