Skip to content

Commit

Permalink
Update util.js
Browse files Browse the repository at this point in the history
Because there is only one argument for the method.

I know from lodash 3 to loadash 4 you need to change some `min` to `minBy`, but not all of them should be changed.
  • Loading branch information
tylerlong committed Feb 11, 2018
1 parent 3d538f0 commit 456cb97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util.js
Expand Up @@ -147,7 +147,7 @@ function buildLayerMatrix(g) {
* rank(v) >= 0 and at least one node w has rank(w) = 0.
*/
function normalizeRanks(g) {
var min = _.minBy(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (_.has(node, "rank")) {
Expand All @@ -158,7 +158,7 @@ function normalizeRanks(g) {

function removeEmptyRanks(g) {
// Ranks may not start at 0, so we need to offset them
var offset = _.minBy(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));

var layers = [];
_.forEach(g.nodes(), function(v) {
Expand Down

0 comments on commit 456cb97

Please sign in to comment.