diff --git a/src/app/credExplorer/pagerankTable/aggregate.js b/src/app/credExplorer/pagerankTable/aggregate.js new file mode 100644 index 0000000..aa82f87 --- /dev/null +++ b/src/app/credExplorer/pagerankTable/aggregate.js @@ -0,0 +1,39 @@ +// @flow + +import type {NodeType, EdgeType} from "../../pluginAdapter"; +import type {ScoredConnection} from "../../../core/attribution/pagerankNodeDecomposition"; + +// Sorted by descending `summary.score` +export type ConnectionAggregations = $ReadOnlyArray; + +export type AggregationSummary = {| + +size: number, + +score: number, +|}; + +export type NodeAggregation = {| + +nodeType: NodeType, + +summary: AggregationSummary, + +connections: $ReadOnlyArray, +|}; + +export type ConnectionType = + | {|+type: "IN_EDGE", +edgeType: EdgeType|} + | {|+type: "OUT_EDGE", +edgeType: EdgeType|} + | {|+type: "SYNTHETIC_LOOP"|}; + +export type ConnectionAggregation = {| + +connectionType: ConnectionType, + +summary: AggregationSummary, + // Sorted by descending `summary.score` + +nodeAggregations: $ReadOnlyArray, +|}; + +export function aggregateByConnectionType( + xs: $ReadOnlyArray, + nodeTypes: $ReadOnlyArray, + edgeTypes: $ReadOnlyArray +): ConnectionAggregations { + const _unused_stuff = [xs, edgeTypes, nodeTypes]; + throw new Error("Not yet implemented"); +} diff --git a/src/app/credExplorer/pagerankTable/aggregate.test.js b/src/app/credExplorer/pagerankTable/aggregate.test.js new file mode 100644 index 0000000..ecbca2b --- /dev/null +++ b/src/app/credExplorer/pagerankTable/aggregate.test.js @@ -0,0 +1,7 @@ +// @flow + +describe("app/credExplorer/aggregation", () => { + it("is not yet implemented", () => { + return; + }); +});