@graphty/layout 1.6.1 → 1.6.2
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.
- package/dist/layout.js.map +1 -1
- package/dist/src/algorithms/optimization/index.d.ts +1 -3
- package/dist/src/algorithms/optimization/index.d.ts.map +1 -1
- package/dist/src/algorithms/optimization/index.js +1 -3
- package/dist/src/algorithms/optimization/index.js.map +1 -1
- package/dist/src/algorithms/optimization/kamada-kawai-solver.d.ts +0 -9
- package/dist/src/algorithms/optimization/kamada-kawai-solver.d.ts.map +1 -1
- package/dist/src/algorithms/optimization/kamada-kawai-solver.js +1 -1
- package/dist/src/algorithms/optimization/kamada-kawai-solver.js.map +1 -1
- package/dist/src/algorithms/planarity/embedding.d.ts +0 -8
- package/dist/src/algorithms/planarity/embedding.d.ts.map +1 -1
- package/dist/src/algorithms/planarity/embedding.js +1 -1
- package/dist/src/algorithms/planarity/embedding.js.map +1 -1
- package/dist/src/algorithms/planarity/index.d.ts +1 -3
- package/dist/src/algorithms/planarity/index.d.ts.map +1 -1
- package/dist/src/algorithms/planarity/index.js +1 -3
- package/dist/src/algorithms/planarity/index.js.map +1 -1
- package/dist/src/algorithms/planarity/special-graphs.d.ts +0 -7
- package/dist/src/algorithms/planarity/special-graphs.d.ts.map +1 -1
- package/dist/src/algorithms/planarity/special-graphs.js +1 -1
- package/dist/src/algorithms/planarity/special-graphs.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/src/algorithms/optimization/index.ts +1 -3
- package/src/algorithms/optimization/kamada-kawai-solver.ts +1 -1
- package/src/algorithms/planarity/embedding.ts +1 -1
- package/src/algorithms/planarity/index.ts +1 -3
- package/src/algorithms/planarity/special-graphs.ts +1 -1
- package/dist/src/algorithms/index.d.ts +0 -6
- package/dist/src/algorithms/index.d.ts.map +0 -1
- package/dist/src/algorithms/index.js +0 -6
- package/dist/src/algorithms/index.js.map +0 -1
- package/src/algorithms/index.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphty/layout",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "graph layout algorithms based on networkx",
|
|
5
5
|
"author": "Adam Powers <apowers@ato.ms>",
|
|
6
6
|
"main": "dist/layout.js",
|
|
@@ -77,6 +77,8 @@
|
|
|
77
77
|
"coverage": "vitest run --coverage",
|
|
78
78
|
"coverage:preview": "npx serve coverage -p 9052",
|
|
79
79
|
"lint": "eslint && tsc --noEmit",
|
|
80
|
+
"lint:fix": "eslint --fix",
|
|
81
|
+
"lint:knip": "cd .. && pnpm run lint:knip -- --workspace layout",
|
|
80
82
|
"typecheck": "tsc --noEmit",
|
|
81
83
|
"build": "tsc",
|
|
82
84
|
"build:bundle": "node scripts/build-bundle.js",
|
|
@@ -2,7 +2,5 @@
|
|
|
2
2
|
* Re-export all optimization algorithms
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export { _computeShortestPathDistances,
|
|
6
|
-
export { _lbfgsDirection } from "./lbfgs";
|
|
7
|
-
export { _backtrackingLineSearch } from "./line-search";
|
|
5
|
+
export { _computeShortestPathDistances, _kamadaKawaiSolve } from "./kamada-kawai-solver";
|
|
8
6
|
export type { DistanceMap } from "./types";
|
|
@@ -148,7 +148,7 @@ export function _kamadaKawaiSolve(distMatrix: number[][], positions: number[][],
|
|
|
148
148
|
* @param dim - Dimension of layout
|
|
149
149
|
* @returns Array with [cost, gradient]
|
|
150
150
|
*/
|
|
151
|
-
|
|
151
|
+
function _kamadaKawaiCostfn(
|
|
152
152
|
posVec: number[],
|
|
153
153
|
invDist: number[][],
|
|
154
154
|
meanWeight: number,
|
|
@@ -94,7 +94,7 @@ export function createTriangulationEmbedding(nodes: Node[], edges: Edge[], seed:
|
|
|
94
94
|
* @param adjMap - Adjacency map
|
|
95
95
|
* @returns Cycle as array of nodes, or null if none found
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
function findCycle(nodes: Node[], _edges: Edge[], adjMap: Record<Node, Set<Node>>): Node[] | null {
|
|
98
98
|
if (nodes.length === 0) {return null;}
|
|
99
99
|
if (nodes.length <= 2) {return nodes;} // Not a real cycle but handle it
|
|
100
100
|
|
|
@@ -3,6 +3,4 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { checkPlanarity } from "./check";
|
|
6
|
-
export { combinatorialEmbeddingToPos
|
|
7
|
-
export { lrPlanarityTest } from "./lr-test";
|
|
8
|
-
export { isK5, isK33, tryFindBipartitePartition } from "./special-graphs";
|
|
6
|
+
export { combinatorialEmbeddingToPos } from "./embedding";
|
|
@@ -67,7 +67,7 @@ export function isK33(nodes: Node[], edges: Edge[]): boolean {
|
|
|
67
67
|
* @param edges - List of edges
|
|
68
68
|
* @returns Array of two partitions, or null if not bipartite
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
function tryFindBipartitePartition(nodes: Node[], edges: Edge[]): [Node[], Node[]] | null {
|
|
71
71
|
const colorMap: Record<Node, number> = {};
|
|
72
72
|
const adjList: Record<Node, Node[]> = {};
|
|
73
73
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/algorithms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|