@graphrs/centrality 0.0.0-canary.de24fef → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/betweenness.d.ts +1 -1
  2. package/dist/betweenness.js +2 -1
  3. package/dist/chunk-BSP5VSXT.js +16 -0
  4. package/dist/chunk-BSP5VSXT.js.map +1 -0
  5. package/dist/chunk-D2422DUD.js +16 -0
  6. package/dist/chunk-D2422DUD.js.map +1 -0
  7. package/dist/chunk-KKDSRV3J.js +17 -0
  8. package/dist/chunk-KKDSRV3J.js.map +1 -0
  9. package/dist/chunk-ONTJIFJ2.js +16 -0
  10. package/dist/chunk-ONTJIFJ2.js.map +1 -0
  11. package/dist/chunk-P557NULQ.js +16 -0
  12. package/dist/chunk-P557NULQ.js.map +1 -0
  13. package/dist/chunk-TVXJ5O77.js +16 -0
  14. package/dist/chunk-TVXJ5O77.js.map +1 -0
  15. package/dist/chunk-U7OR4PJD.js +16 -0
  16. package/dist/chunk-U7OR4PJD.js.map +1 -0
  17. package/dist/chunk-W4DPRB37.js +16 -0
  18. package/dist/chunk-W4DPRB37.js.map +1 -0
  19. package/dist/closeness.d.ts +1 -1
  20. package/dist/closeness.js +2 -1
  21. package/dist/eigenvector.d.ts +1 -1
  22. package/dist/eigenvector.js +2 -1
  23. package/dist/harmonic.d.ts +1 -1
  24. package/dist/harmonic.js +2 -1
  25. package/dist/hits.d.ts +1 -1
  26. package/dist/hits.js +2 -1
  27. package/dist/index.js +8 -7
  28. package/dist/katz.d.ts +1 -1
  29. package/dist/katz.js +2 -1
  30. package/dist/pagerank.d.ts +1 -1
  31. package/dist/pagerank.js +2 -1
  32. package/package.json +16 -56
  33. package/LICENSE +0 -21
  34. package/dist/chunk-6I4SLBPA.js +0 -12
  35. package/dist/chunk-6I4SLBPA.js.map +0 -1
  36. package/dist/chunk-7ZI2WWXG.js +0 -12
  37. package/dist/chunk-7ZI2WWXG.js.map +0 -1
  38. package/dist/chunk-BBOEMUW2.js +0 -12
  39. package/dist/chunk-BBOEMUW2.js.map +0 -1
  40. package/dist/chunk-KPJDECYL.js +0 -12
  41. package/dist/chunk-KPJDECYL.js.map +0 -1
  42. package/dist/chunk-XBQCAXBX.js +0 -12
  43. package/dist/chunk-XBQCAXBX.js.map +0 -1
  44. package/dist/chunk-XLWEIWT6.js +0 -12
  45. package/dist/chunk-XLWEIWT6.js.map +0 -1
  46. package/dist/chunk-YOMT2Z2X.js +0 -12
  47. package/dist/chunk-YOMT2Z2X.js.map +0 -1
@@ -4,6 +4,6 @@ interface BetweennessOptions {
4
4
  directed?: boolean;
5
5
  normalized?: boolean;
6
6
  }
7
- declare function betweenness(graph: Graph, options?: BetweennessOptions): Promise<CentralityResult>;
7
+ declare function betweenness(graph: Graph, _options?: BetweennessOptions): Promise<CentralityResult>;
8
8
 
9
9
  export { type BetweennessOptions, betweenness };
@@ -1,3 +1,4 @@
1
- export { betweenness } from './chunk-KPJDECYL.js';
1
+ export { betweenness } from './chunk-P557NULQ.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=betweenness.js.map
3
4
  //# sourceMappingURL=betweenness.js.map
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/harmonic.ts
4
+ async function harmonic(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.harmonicCentrality());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { harmonic };
15
+ //# sourceMappingURL=chunk-BSP5VSXT.js.map
16
+ //# sourceMappingURL=chunk-BSP5VSXT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/harmonic.ts"],"names":[],"mappings":";;;AAOA,eAAsB,QAAA,CACpB,OACA,QAAA,EAC2B;AAC3B,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,oBAAoB,CAAA;AAC9C,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-BSP5VSXT.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface HarmonicOptions {\n normalized?: boolean;\n}\n\nexport async function harmonic(\n graph: Graph,\n _options?: HarmonicOptions,\n): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.harmonicCentrality()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/katz.ts
4
+ async function katz(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.katzCentrality());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { katz };
15
+ //# sourceMappingURL=chunk-D2422DUD.js.map
16
+ //# sourceMappingURL=chunk-D2422DUD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/katz.ts"],"names":[],"mappings":";;;AAQA,eAAsB,IAAA,CAAK,OAAc,QAAA,EAAmD;AAC1F,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,gBAAgB,CAAA;AAC1C,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-D2422DUD.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface KatzOptions {\n alpha?: number;\n beta?: number;\n}\n\nexport async function katz(graph: Graph, _options?: KatzOptions): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.katzCentrality()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { getWasm } from '@graphrs/core';
2
+
3
+ // src/utils.ts
4
+ async function toWasmGraph(graph) {
5
+ const { WasmGraph } = await getWasm();
6
+ const edges = graph._getEdgePairs();
7
+ const flat = new Uint32Array(edges.length * 2);
8
+ for (let i = 0; i < edges.length; i++) {
9
+ flat[i * 2] = edges[i][0];
10
+ flat[i * 2 + 1] = edges[i][1];
11
+ }
12
+ return WasmGraph.fromEdges(flat, graph.directed);
13
+ }
14
+
15
+ export { toWasmGraph };
16
+ //# sourceMappingURL=chunk-KKDSRV3J.js.map
17
+ //# sourceMappingURL=chunk-KKDSRV3J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils.ts"],"names":[],"mappings":";;;AAGA,eAAsB,YAAY,KAAA,EAA0C;AAC1E,EAAA,MAAM,EAAE,SAAA,EAAU,GAAI,MAAM,OAAA,EAAQ;AACpC,EAAA,MAAM,KAAA,GAAQ,MAAM,aAAA,EAAc;AAClC,EAAA,MAAM,IAAA,GAAO,IAAI,WAAA,CAAY,KAAA,CAAM,SAAS,CAAC,CAAA;AAC7C,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,KAAA,CAAM,QAAQ,CAAA,EAAA,EAAK;AACrC,IAAA,IAAA,CAAK,IAAI,CAAC,CAAA,GAAI,KAAA,CAAM,CAAC,EAAG,CAAC,CAAA;AACzB,IAAA,IAAA,CAAK,IAAI,CAAA,GAAI,CAAC,IAAI,KAAA,CAAM,CAAC,EAAG,CAAC,CAAA;AAAA,EAC/B;AACA,EAAA,OAAO,SAAA,CAAU,SAAA,CAAU,IAAA,EAAM,KAAA,CAAM,QAAQ,CAAA;AACjD","file":"chunk-KKDSRV3J.js","sourcesContent":["import type { Graph, WasmGraphInstance } from '@graphrs/core';\nimport { getWasm } from '@graphrs/core';\n\nexport async function toWasmGraph(graph: Graph): Promise<WasmGraphInstance> {\n const { WasmGraph } = await getWasm();\n const edges = graph._getEdgePairs();\n const flat = new Uint32Array(edges.length * 2);\n for (let i = 0; i < edges.length; i++) {\n flat[i * 2] = edges[i]![0];\n flat[i * 2 + 1] = edges[i]![1];\n }\n return WasmGraph.fromEdges(flat, graph.directed);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/pagerank.ts
4
+ async function pagerank(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.pagerank());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { pagerank };
15
+ //# sourceMappingURL=chunk-ONTJIFJ2.js.map
16
+ //# sourceMappingURL=chunk-ONTJIFJ2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pagerank.ts"],"names":[],"mappings":";;;AASA,eAAsB,QAAA,CACpB,OACA,QAAA,EAC2B;AAC3B,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,UAAU,CAAA;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-ONTJIFJ2.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface PagerankOptions {\n damping?: number;\n iterations?: number;\n tolerance?: number;\n}\n\nexport async function pagerank(\n graph: Graph,\n _options?: PagerankOptions,\n): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.pagerank()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/betweenness.ts
4
+ async function betweenness(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.betweenness());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { betweenness };
15
+ //# sourceMappingURL=chunk-P557NULQ.js.map
16
+ //# sourceMappingURL=chunk-P557NULQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/betweenness.ts"],"names":[],"mappings":";;;AAQA,eAAsB,WAAA,CACpB,OACA,QAAA,EAC2B;AAC3B,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,aAAa,CAAA;AACvC,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-P557NULQ.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface BetweennessOptions {\n directed?: boolean;\n normalized?: boolean;\n}\n\nexport async function betweenness(\n graph: Graph,\n _options?: BetweennessOptions,\n): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.betweenness()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/eigenvector.ts
4
+ async function eigenvector(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.eigenvectorCentrality());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { eigenvector };
15
+ //# sourceMappingURL=chunk-TVXJ5O77.js.map
16
+ //# sourceMappingURL=chunk-TVXJ5O77.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eigenvector.ts"],"names":[],"mappings":";;;AAOA,eAAsB,WAAA,CACpB,OACA,QAAA,EAC2B;AAC3B,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,uBAAuB,CAAA;AACjD,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-TVXJ5O77.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface EigenvectorOptions {\n scale?: boolean;\n}\n\nexport async function eigenvector(\n graph: Graph,\n _options?: EigenvectorOptions,\n): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.eigenvectorCentrality()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/hits.ts
4
+ async function hits(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.hubAndAuthorityScores());
8
+ return { hubs: raw.hub, authorities: raw.authority };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { hits };
15
+ //# sourceMappingURL=chunk-U7OR4PJD.js.map
16
+ //# sourceMappingURL=chunk-U7OR4PJD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hits.ts"],"names":[],"mappings":";;;AAaA,eAAsB,IAAA,CAAK,OAAc,QAAA,EAA6C;AACpF,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,uBAAuB,CAAA;AAIjD,IAAA,OAAO,EAAE,IAAA,EAAM,GAAA,CAAI,GAAA,EAAK,WAAA,EAAa,IAAI,SAAA,EAAU;AAAA,EACrD,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-U7OR4PJD.js","sourcesContent":["import type { Graph } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface HitsResult {\n hubs: number[];\n authorities: number[];\n}\n\nexport interface HitsOptions {\n iterations?: number;\n tolerance?: number;\n}\n\nexport async function hits(graph: Graph, _options?: HitsOptions): Promise<HitsResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.hubAndAuthorityScores()) as {\n hub: number[];\n authority: number[];\n };\n return { hubs: raw.hub, authorities: raw.authority };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { toWasmGraph } from './chunk-KKDSRV3J.js';
2
+
3
+ // src/closeness.ts
4
+ async function closeness(graph, _options) {
5
+ const wg = await toWasmGraph(graph);
6
+ try {
7
+ const raw = JSON.parse(wg.closeness());
8
+ return { scores: raw.scores };
9
+ } finally {
10
+ wg.free();
11
+ }
12
+ }
13
+
14
+ export { closeness };
15
+ //# sourceMappingURL=chunk-W4DPRB37.js.map
16
+ //# sourceMappingURL=chunk-W4DPRB37.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/closeness.ts"],"names":[],"mappings":";;;AAOA,eAAsB,SAAA,CACpB,OACA,QAAA,EAC2B;AAC3B,EAAA,MAAM,EAAA,GAAK,MAAM,WAAA,CAAY,KAAK,CAAA;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,WAAW,CAAA;AACrC,IAAA,OAAO,EAAE,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAAA,EAC9B,CAAA,SAAE;AACA,IAAA,EAAA,CAAG,IAAA,EAAK;AAAA,EACV;AACF","file":"chunk-W4DPRB37.js","sourcesContent":["import type { Graph, CentralityResult } from '@graphrs/core';\nimport { toWasmGraph } from './utils.js';\n\nexport interface ClosenessOptions {\n normalized?: boolean;\n}\n\nexport async function closeness(\n graph: Graph,\n _options?: ClosenessOptions,\n): Promise<CentralityResult> {\n const wg = await toWasmGraph(graph);\n try {\n const raw = JSON.parse(wg.closeness()) as { scores: number[] };\n return { scores: raw.scores };\n } finally {\n wg.free();\n }\n}\n"]}
@@ -3,6 +3,6 @@ import { Graph, CentralityResult } from '@graphrs/core';
3
3
  interface ClosenessOptions {
4
4
  normalized?: boolean;
5
5
  }
6
- declare function closeness(graph: Graph, options?: ClosenessOptions): Promise<CentralityResult>;
6
+ declare function closeness(graph: Graph, _options?: ClosenessOptions): Promise<CentralityResult>;
7
7
 
8
8
  export { type ClosenessOptions, closeness };
package/dist/closeness.js CHANGED
@@ -1,3 +1,4 @@
1
- export { closeness } from './chunk-BBOEMUW2.js';
1
+ export { closeness } from './chunk-W4DPRB37.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=closeness.js.map
3
4
  //# sourceMappingURL=closeness.js.map
@@ -3,6 +3,6 @@ import { Graph, CentralityResult } from '@graphrs/core';
3
3
  interface EigenvectorOptions {
4
4
  scale?: boolean;
5
5
  }
6
- declare function eigenvector(graph: Graph, options?: EigenvectorOptions): Promise<CentralityResult>;
6
+ declare function eigenvector(graph: Graph, _options?: EigenvectorOptions): Promise<CentralityResult>;
7
7
 
8
8
  export { type EigenvectorOptions, eigenvector };
@@ -1,3 +1,4 @@
1
- export { eigenvector } from './chunk-YOMT2Z2X.js';
1
+ export { eigenvector } from './chunk-TVXJ5O77.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=eigenvector.js.map
3
4
  //# sourceMappingURL=eigenvector.js.map
@@ -3,6 +3,6 @@ import { Graph, CentralityResult } from '@graphrs/core';
3
3
  interface HarmonicOptions {
4
4
  normalized?: boolean;
5
5
  }
6
- declare function harmonic(graph: Graph, options?: HarmonicOptions): Promise<CentralityResult>;
6
+ declare function harmonic(graph: Graph, _options?: HarmonicOptions): Promise<CentralityResult>;
7
7
 
8
8
  export { type HarmonicOptions, harmonic };
package/dist/harmonic.js CHANGED
@@ -1,3 +1,4 @@
1
- export { harmonic } from './chunk-XBQCAXBX.js';
1
+ export { harmonic } from './chunk-BSP5VSXT.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=harmonic.js.map
3
4
  //# sourceMappingURL=harmonic.js.map
package/dist/hits.d.ts CHANGED
@@ -8,6 +8,6 @@ interface HitsOptions {
8
8
  iterations?: number;
9
9
  tolerance?: number;
10
10
  }
11
- declare function hits(graph: Graph, options?: HitsOptions): Promise<HitsResult>;
11
+ declare function hits(graph: Graph, _options?: HitsOptions): Promise<HitsResult>;
12
12
 
13
13
  export { type HitsOptions, type HitsResult, hits };
package/dist/hits.js CHANGED
@@ -1,3 +1,4 @@
1
- export { hits } from './chunk-XLWEIWT6.js';
1
+ export { hits } from './chunk-U7OR4PJD.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=hits.js.map
3
4
  //# sourceMappingURL=hits.js.map
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
- export { betweenness } from './chunk-KPJDECYL.js';
2
- export { closeness } from './chunk-BBOEMUW2.js';
3
- export { eigenvector } from './chunk-YOMT2Z2X.js';
4
- export { harmonic } from './chunk-XBQCAXBX.js';
5
- export { hits } from './chunk-XLWEIWT6.js';
6
- export { katz } from './chunk-6I4SLBPA.js';
7
- export { pagerank } from './chunk-7ZI2WWXG.js';
1
+ export { betweenness } from './chunk-P557NULQ.js';
2
+ export { closeness } from './chunk-W4DPRB37.js';
3
+ export { eigenvector } from './chunk-TVXJ5O77.js';
4
+ export { harmonic } from './chunk-BSP5VSXT.js';
5
+ export { hits } from './chunk-U7OR4PJD.js';
6
+ export { katz } from './chunk-D2422DUD.js';
7
+ export { pagerank } from './chunk-ONTJIFJ2.js';
8
+ import './chunk-KKDSRV3J.js';
8
9
  //# sourceMappingURL=index.js.map
9
10
  //# sourceMappingURL=index.js.map
package/dist/katz.d.ts CHANGED
@@ -4,6 +4,6 @@ interface KatzOptions {
4
4
  alpha?: number;
5
5
  beta?: number;
6
6
  }
7
- declare function katz(graph: Graph, options?: KatzOptions): Promise<CentralityResult>;
7
+ declare function katz(graph: Graph, _options?: KatzOptions): Promise<CentralityResult>;
8
8
 
9
9
  export { type KatzOptions, katz };
package/dist/katz.js CHANGED
@@ -1,3 +1,4 @@
1
- export { katz } from './chunk-6I4SLBPA.js';
1
+ export { katz } from './chunk-D2422DUD.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=katz.js.map
3
4
  //# sourceMappingURL=katz.js.map
@@ -5,6 +5,6 @@ interface PagerankOptions {
5
5
  iterations?: number;
6
6
  tolerance?: number;
7
7
  }
8
- declare function pagerank(graph: Graph, options?: PagerankOptions): Promise<CentralityResult>;
8
+ declare function pagerank(graph: Graph, _options?: PagerankOptions): Promise<CentralityResult>;
9
9
 
10
10
  export { type PagerankOptions, pagerank };
package/dist/pagerank.js CHANGED
@@ -1,3 +1,4 @@
1
- export { pagerank } from './chunk-7ZI2WWXG.js';
1
+ export { pagerank } from './chunk-ONTJIFJ2.js';
2
+ import './chunk-KKDSRV3J.js';
2
3
  //# sourceMappingURL=pagerank.js.map
3
4
  //# sourceMappingURL=pagerank.js.map
package/package.json CHANGED
@@ -1,69 +1,28 @@
1
1
  {
2
2
  "name": "@graphrs/centrality",
3
- "version": "0.0.0-canary.de24fef",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Centrality measures (PageRank, betweenness, closeness, eigenvector, HITS, Katz, harmonic) for @graphrs",
7
- "keywords": [
8
- "graph",
9
- "centrality",
10
- "pagerank",
11
- "betweenness",
12
- "network-analysis"
13
- ],
7
+ "keywords": ["graph", "centrality", "pagerank", "betweenness", "network-analysis"],
14
8
  "author": "Totoro-jam <moqiuchen66@gmail.com>",
15
9
  "homepage": "https://github.com/Totoro-jam/graphrs#readme",
16
- "bugs": {
17
- "url": "https://github.com/Totoro-jam/graphrs/issues"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/Totoro-jam/graphrs",
22
- "directory": "packages/centrality"
23
- },
10
+ "bugs": { "url": "https://github.com/Totoro-jam/graphrs/issues" },
11
+ "repository": { "type": "git", "url": "https://github.com/Totoro-jam/graphrs", "directory": "packages/centrality" },
24
12
  "sideEffects": false,
25
13
  "exports": {
26
- ".": {
27
- "types": "./dist/index.d.ts",
28
- "import": "./dist/index.js"
29
- },
30
- "./pagerank": {
31
- "types": "./dist/pagerank.d.ts",
32
- "import": "./dist/pagerank.js"
33
- },
34
- "./betweenness": {
35
- "types": "./dist/betweenness.d.ts",
36
- "import": "./dist/betweenness.js"
37
- },
38
- "./closeness": {
39
- "types": "./dist/closeness.d.ts",
40
- "import": "./dist/closeness.js"
41
- },
42
- "./eigenvector": {
43
- "types": "./dist/eigenvector.d.ts",
44
- "import": "./dist/eigenvector.js"
45
- },
46
- "./hits": {
47
- "types": "./dist/hits.d.ts",
48
- "import": "./dist/hits.js"
49
- },
50
- "./katz": {
51
- "types": "./dist/katz.d.ts",
52
- "import": "./dist/katz.js"
53
- },
54
- "./harmonic": {
55
- "types": "./dist/harmonic.d.ts",
56
- "import": "./dist/harmonic.js"
57
- }
14
+ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
15
+ "./pagerank": { "types": "./dist/pagerank.d.ts", "import": "./dist/pagerank.js" },
16
+ "./betweenness": { "types": "./dist/betweenness.d.ts", "import": "./dist/betweenness.js" },
17
+ "./closeness": { "types": "./dist/closeness.d.ts", "import": "./dist/closeness.js" },
18
+ "./eigenvector": { "types": "./dist/eigenvector.d.ts", "import": "./dist/eigenvector.js" },
19
+ "./hits": { "types": "./dist/hits.d.ts", "import": "./dist/hits.js" },
20
+ "./katz": { "types": "./dist/katz.d.ts", "import": "./dist/katz.js" },
21
+ "./harmonic": { "types": "./dist/harmonic.d.ts", "import": "./dist/harmonic.js" }
58
22
  },
59
23
  "main": "./dist/index.js",
60
24
  "types": "./dist/index.d.ts",
61
- "files": [
62
- "dist"
63
- ],
64
- "peerDependencies": {
65
- "@graphrs/core": "^0.0.0-canary.de24fef"
66
- },
25
+ "files": ["dist"],
67
26
  "scripts": {
68
27
  "build": "tsup",
69
28
  "test": "vitest run --passWithNoTests",
@@ -71,5 +30,6 @@
71
30
  "lint": "tsc --noEmit",
72
31
  "typecheck": "tsc --noEmit",
73
32
  "clean": "rm -rf dist"
74
- }
75
- }
33
+ },
34
+ "peerDependencies": { "@graphrs/core": "workspace:^" }
35
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-present Totoro-jam
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/katz.ts
4
- async function katz(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { katz };
11
- //# sourceMappingURL=chunk-6I4SLBPA.js.map
12
- //# sourceMappingURL=chunk-6I4SLBPA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/katz.ts"],"names":[],"mappings":";;;AAOA,eAAsB,IAAA,CAAK,OAAc,OAAA,EAAkD;AACzF,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-6I4SLBPA.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface KatzOptions {\n alpha?: number;\n beta?: number;\n}\n\nexport async function katz(graph: Graph, options?: KatzOptions): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/pagerank.ts
4
- async function pagerank(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { pagerank };
11
- //# sourceMappingURL=chunk-7ZI2WWXG.js.map
12
- //# sourceMappingURL=chunk-7ZI2WWXG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/pagerank.ts"],"names":[],"mappings":";;;AAQA,eAAsB,QAAA,CAAS,OAAc,OAAA,EAAsD;AACjG,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-7ZI2WWXG.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface PagerankOptions {\n damping?: number;\n iterations?: number;\n tolerance?: number;\n}\n\nexport async function pagerank(graph: Graph, options?: PagerankOptions): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/closeness.ts
4
- async function closeness(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { closeness };
11
- //# sourceMappingURL=chunk-BBOEMUW2.js.map
12
- //# sourceMappingURL=chunk-BBOEMUW2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/closeness.ts"],"names":[],"mappings":";;;AAMA,eAAsB,SAAA,CACpB,OACA,OAAA,EAC2B;AAC3B,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-BBOEMUW2.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface ClosenessOptions {\n normalized?: boolean;\n}\n\nexport async function closeness(\n graph: Graph,\n options?: ClosenessOptions,\n): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/betweenness.ts
4
- async function betweenness(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { betweenness };
11
- //# sourceMappingURL=chunk-KPJDECYL.js.map
12
- //# sourceMappingURL=chunk-KPJDECYL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/betweenness.ts"],"names":[],"mappings":";;;AAOA,eAAsB,WAAA,CACpB,OACA,OAAA,EAC2B;AAC3B,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-KPJDECYL.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface BetweennessOptions {\n directed?: boolean;\n normalized?: boolean;\n}\n\nexport async function betweenness(\n graph: Graph,\n options?: BetweennessOptions,\n): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/harmonic.ts
4
- async function harmonic(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { harmonic };
11
- //# sourceMappingURL=chunk-XBQCAXBX.js.map
12
- //# sourceMappingURL=chunk-XBQCAXBX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/harmonic.ts"],"names":[],"mappings":";;;AAMA,eAAsB,QAAA,CAAS,OAAc,OAAA,EAAsD;AACjG,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-XBQCAXBX.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface HarmonicOptions {\n normalized?: boolean;\n}\n\nexport async function harmonic(graph: Graph, options?: HarmonicOptions): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/hits.ts
4
- async function hits(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { hits };
11
- //# sourceMappingURL=chunk-XLWEIWT6.js.map
12
- //# sourceMappingURL=chunk-XLWEIWT6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hits.ts"],"names":[],"mappings":";;;AAYA,eAAsB,IAAA,CAAK,OAAc,OAAA,EAA4C;AACnF,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-XLWEIWT6.js","sourcesContent":["import { getWasm, type Graph } from '@graphrs/core';\n\nexport interface HitsResult {\n hubs: number[];\n authorities: number[];\n}\n\nexport interface HitsOptions {\n iterations?: number;\n tolerance?: number;\n}\n\nexport async function hits(graph: Graph, options?: HitsOptions): Promise<HitsResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { getWasm } from '@graphrs/core';
2
-
3
- // src/eigenvector.ts
4
- async function eigenvector(graph, options) {
5
- await getWasm();
6
- void graph._getEdgePairs();
7
- throw new Error("Not yet implemented \u2014 WASM bindings pending");
8
- }
9
-
10
- export { eigenvector };
11
- //# sourceMappingURL=chunk-YOMT2Z2X.js.map
12
- //# sourceMappingURL=chunk-YOMT2Z2X.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eigenvector.ts"],"names":[],"mappings":";;;AAMA,eAAsB,WAAA,CACpB,OACA,OAAA,EAC2B;AAC3B,EAAc,MAAM,OAAA;AAGpB,EAAA,KAAK,MAAM,aAAA,EAAc;AACzB,EAAA,MAAM,IAAI,MAAM,kDAA6C,CAAA;AAC/D","file":"chunk-YOMT2Z2X.js","sourcesContent":["import { getWasm, type Graph, type CentralityResult } from '@graphrs/core';\n\nexport interface EigenvectorOptions {\n scale?: boolean;\n}\n\nexport async function eigenvector(\n graph: Graph,\n options?: EigenvectorOptions,\n): Promise<CentralityResult> {\n const _wasm = await getWasm();\n void _wasm;\n void options;\n void graph._getEdgePairs();\n throw new Error('Not yet implemented — WASM bindings pending');\n}\n"]}