You've already forked wakapi-readme-stats
Bar graph added.
This commit is contained in:
41
node_modules/d3-force/src/y.js
generated
vendored
Normal file
41
node_modules/d3-force/src/y.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import constant from "./constant.js";
|
||||
|
||||
export default function(y) {
|
||||
var strength = constant(0.1),
|
||||
nodes,
|
||||
strengths,
|
||||
yz;
|
||||
|
||||
if (typeof y !== "function") y = constant(y == null ? 0 : +y);
|
||||
|
||||
function force(alpha) {
|
||||
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
||||
node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;
|
||||
}
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length;
|
||||
strengths = new Array(n);
|
||||
yz = new Array(n);
|
||||
for (i = 0; i < n; ++i) {
|
||||
strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
|
||||
}
|
||||
}
|
||||
|
||||
force.initialize = function(_) {
|
||||
nodes = _;
|
||||
initialize();
|
||||
};
|
||||
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength;
|
||||
};
|
||||
|
||||
force.y = function(_) {
|
||||
return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), initialize(), force) : y;
|
||||
};
|
||||
|
||||
return force;
|
||||
}
|
||||
Reference in New Issue
Block a user