Skip to content

Commit

Permalink
Merge pull request #23 from RhoInc/v0.4.1-dev
Browse files Browse the repository at this point in the history
V0.4.1 dev
  • Loading branch information
jwildfire authored Feb 19, 2020
2 parents ca3a9f2 + c969b03 commit 0489ca4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion nestedDataExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@
})
.entries(data)
.sort(function(a, b) {
return config.sort_alpha ? b.key - a.key : b.values.n - a.values.n;
var alpha = a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
var numeric = b.values.n - a.values.n;
return config.sort_alpha ? alpha : numeric;
});

return myNest;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nested-data-explorer",
"description": "Makes tables for nested tables",
"version": "0.4.0",
"description": "Makes tables for nested data",
"version": "0.4.1",
"author": "Rho, Inc.",
"license": "MIT",
"homepage": "",
Expand Down
4 changes: 3 additions & 1 deletion src/callbacks/onDraw/makeNestLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export default function makeNestLevel(key, data, iterate) {
})
.entries(data)
.sort(function(a, b) {
return config.sort_alpha ? b.key - a.key : b.values.n - a.values.n;
let alpha = a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
let numeric = b.values.n - a.values.n;
return config.sort_alpha ? alpha : numeric;
});

return myNest;
Expand Down

0 comments on commit 0489ca4

Please sign in to comment.