From 8a4b9592b19c6d0e4f38abf168023c1ed66019b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dandelion=20Man=C3=A9?=
Date: Thu, 10 May 2018 16:31:43 -0700
Subject: [PATCH] Sort within recursive neighbor enumeration
Test plan: Open the cred explorer, and use the + sign to expand the
neighbors. Observe that those neighbors are now sorted by cred.
Paired with @wchargin
---
src/app/credExplorer/pagerankTable.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/app/credExplorer/pagerankTable.js b/src/app/credExplorer/pagerankTable.js
index 37e4b18..d0428d5 100644
--- a/src/app/credExplorer/pagerankTable.js
+++ b/src/app/credExplorer/pagerankTable.js
@@ -199,6 +199,12 @@ class RecursiveTable extends React.Component {
});
return neighborMap
.getAll()
+ .sort((a, b) => {
+ const x = pagerankResult.get(a.address).probability;
+ const y = pagerankResult.get(b.address).probability;
+ return x - y;
+ })
+ .reverse()
.map(({address}) => (