diff --git a/src/app/credExplorer/App.js b/src/app/credExplorer/App.js index 78454f9..d02f5d8 100644 --- a/src/app/credExplorer/App.js +++ b/src/app/credExplorer/App.js @@ -38,11 +38,9 @@ type Props = {|+localStore: LocalStore|}; type State = { selectedRepo: ?Repo, data: {| - graphWithMetadata: ?{| + graphWithAdapters: ?{| +graph: Graph, +adapters: $ReadOnlyArray, - +nodeCount: number, - +edgeCount: number, |}, +pnd: ?PagerankNodeDecomposition, |}, @@ -56,7 +54,7 @@ export class App extends React.Component { super(props); this.state = { selectedRepo: null, - data: {graphWithMetadata: null, pnd: null}, + data: {graphWithAdapters: null, pnd: null}, edgeEvaluator: null, }; } @@ -64,7 +62,7 @@ export class App extends React.Component { render() { const {localStore} = this.props; const {edgeEvaluator, selectedRepo} = this.state; - const {graphWithMetadata, pnd} = this.state.data; + const {graphWithAdapters, pnd} = this.state.data; return (
@@ -83,21 +81,21 @@ export class App extends React.Component { Load data - {graphWithMetadata ? ( -

- Graph loaded: {graphWithMetadata.nodeCount} nodes,{" "} - {graphWithMetadata.edgeCount} edges. -

- ) : ( -

Graph not loaded.

- )} + {graphWithAdapters ?

Graph loaded.

:

Graph not loaded.

} this.setState({edgeEvaluator: ee})} /> x.adapters)} + adapters={NullUtil.map(graphWithAdapters, (x) => x.adapters)} pnd={pnd} maxEntriesPerList={MAX_ENTRIES_PER_LIST} /> @@ -138,11 +129,9 @@ export class App extends React.Component { Promise.all(statics.map((a) => a.load(selectedRepo))).then((adapters) => { const graph = Graph.merge(adapters.map((x) => x.graph())); const data = { - graphWithMetadata: { + graphWithAdapters: { graph, adapters, - nodeCount: Array.from(graph.nodes()).length, - edgeCount: Array.from(graph.edges()).length, }, pnd: null, };