From e3a4d1f2b9ef69c6b11d56e982e5b8b77fb7c114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Tue, 14 Aug 2018 15:40:49 -0700 Subject: [PATCH] ConnectionRow now shows the connection score (#658) Previously, the ConnectionRow showed the score of the node that was the source of the connection. I believe the UI will be more consistent and useful if it instead shows the connection score, i.e. how important that connection was to the node in scope. This combos well with PR #657. Test plan: The change is very simple, and covered by unit tests. I also verified the behavior by examining the cred explorer. --- src/app/credExplorer/pagerankTable/Connection.js | 4 ++-- src/app/credExplorer/pagerankTable/Connection.test.js | 4 ++-- src/core/attribution/pagerankNodeDecomposition.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/credExplorer/pagerankTable/Connection.js b/src/app/credExplorer/pagerankTable/Connection.js index e40ab90..16dc75a 100644 --- a/src/app/credExplorer/pagerankTable/Connection.js +++ b/src/app/credExplorer/pagerankTable/Connection.js @@ -56,7 +56,7 @@ export class ConnectionRow extends React.PureComponent { sharedProps, target, depth, - scoredConnection: {connection, source, sourceScore, connectionScore}, + scoredConnection: {connection, source, connectionScore}, } = this.props; const {pnd, adapters} = sharedProps; const {score: targetScore} = NullUtil.get(pnd.get(target)); @@ -72,7 +72,7 @@ export class ConnectionRow extends React.PureComponent { description={connectionView} connectionProportion={connectionProportion} showPadding={false} - score={sourceScore} + score={connectionScore} > { const {row} = await setup(); expect(row.props().showPadding).toBe(false); }); - it("with the sourceScore", async () => { + it("with the connection score", async () => { const {row, scoredConnection} = await setup(); - expect(row.props().score).toBe(scoredConnection.sourceScore); + expect(row.props().score).toBe(scoredConnection.connectionScore); }); it("with the connectionProportion", async () => { const {row, target, scoredConnection, sharedProps} = await setup(); diff --git a/src/core/attribution/pagerankNodeDecomposition.js b/src/core/attribution/pagerankNodeDecomposition.js index b6db370..e333377 100644 --- a/src/core/attribution/pagerankNodeDecomposition.js +++ b/src/core/attribution/pagerankNodeDecomposition.js @@ -15,6 +15,7 @@ import * as NullUtil from "../../util/null"; export type ScoredConnection = {| +connection: Connection, +source: NodeAddressT, + // TODO(@decentralion): Consider removing this unused field +sourceScore: number, +connectionScore: number, |};