@voxlz/graph-gen 0.0.0-stage → 4.5.3

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/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@voxlz/graph-gen",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "4.5.3",
4
+ "description": "Constraint-based graph layout -> PNG renderer",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "graph-gen": "dist/index.js",
8
+ "graphgen": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/index.js",
12
+ "style.jsonc"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/voxlz/graph-gen.git"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "type": "commonjs",
26
+ "scripts": {
27
+ "start": "tsx src/index.ts",
28
+ "build": "tsx src/bundle.ts",
29
+ "prepack": "npm run build",
30
+ "generate": "tsx src/generate.ts",
31
+ "render-all": "tsx src/render-all.ts",
32
+ "render-frames": "tsx src/render-frames.ts",
33
+ "watch": "tsx src/watch.ts . renders",
34
+ "verify": "tsx src/verify.ts",
35
+ "benchmark": "tsx src/benchmark.ts",
36
+ "render-strategies": "tsx tests/strategies/render-series.ts",
37
+ "test": "jest",
38
+ "lint": "eslint . --max-warnings 0",
39
+ "format": "prettier --write .",
40
+ "format:check": "prettier --check .",
41
+ "typecheck": "tsc --noEmit",
42
+ "prepare": "husky"
43
+ },
44
+ "dependencies": {
45
+ "canvas": "^3.2.3"
46
+ },
47
+ "devDependencies": {
48
+ "@types/jest": "^30.0.0",
49
+ "@types/node": "^26.1.1",
50
+ "@types/webcola": "^3.1.27",
51
+ "esbuild": "^0.28.2",
52
+ "eslint": "^10.7.0",
53
+ "husky": "^9.1.7",
54
+ "jest": "^30.4.2",
55
+ "prettier": "^3.9.6",
56
+ "tsx": "^4.23.1",
57
+ "ts-jest": "^29.4.12",
58
+ "typescript": "^6.0.3",
59
+ "typescript-eslint": "^8.65.0",
60
+ "webcola": "^3.4.0"
61
+ }
62
+ }
package/style.jsonc ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "graph": {
3
+ "title": "",
4
+ "outputPath": "../graphs/{file}", // output path template; {file} expands to the input basename as .png
5
+ "minGap": 100,
6
+ "nodeGap": 100,
7
+ "lineColor": "#000000", // default edge / arrow color
8
+ "boundaryPad": 20, // gap between a boundary's nodes and its border
9
+ "labelMaxWidth": 220, // wrap edge label lines wider than this (px) at spaces; 0 = never
10
+ "labelBand": 20, // extra top room inside a boundary for its label
11
+ "labelNodes": "auto", // curved layout: lay out edge labels as nodes "auto" (only labels that can't touch their edge otherwise), true or false
12
+ "nestPad": 36, // extra padding per nesting level (parent label clears nested border)
13
+ "iterations": [0, 100, 1000], // WebCola solver passes [unconstrained, userConstraint, allConstraint]
14
+ "layout": "curved", // "curved" (default), "orthogonal", "constraint", "cola", or "force"
15
+ "layoutIterations": 1000, // hard limit for the constraint solver
16
+ "minimize": 100, // post-layout generations that compact valid layouts toward the center
17
+ "debugFrameEvery": 0, // set to 5 to write a PNG every five solver iterations
18
+ "forceDebugFrameEvery": 0, // defaults to debugFrameEvery; samples force iterations separately
19
+ "forceNodeGapMultiplier": 1.5, // extra clearance used only while calculating force layout
20
+ "forceForeignBoundaryRepulsion": 10, // strongly ejects boundaries contained by unrelated boundaries; deeper containment pushes much harder
21
+ "forceEdgePressure": 3.5, // always pulls unconnected boundary-edge nodes inward; collisions reposition other nodes
22
+ "forceParentAttraction": 0.006, // gently pulls direct nodes and nested boundaries toward their parent center
23
+ "forceDamping": 0.7, // retains a fraction of each node's previous force-layout velocity
24
+ "forceConvergenceThreshold": 0.01, // maximum force and movement for force-layout convergence
25
+ "forceStableIterations": 5, // consecutive converged force-layout iterations required to stop early
26
+ "forceCollisionRampIterations": 250, // early iterations allow temporary node overlap to escape ordering traps
27
+ "lines": "direct", // "direct" or "curved" or "angled". lets only support direct for now.
28
+ },
29
+ "shapes": {
30
+ "box": {
31
+ "type": "rectangle",
32
+ "color": "transparent",
33
+ "lineStyle": "solid",
34
+ "minWidth": 120,
35
+ "minHeight": 60,
36
+ "borderRadius": 10,
37
+ },
38
+ "circle": {
39
+ "type": "rectangle",
40
+ "color": "transparent",
41
+ "lineStyle": "solid",
42
+ "minWidth": 90,
43
+ "minHeight": 90,
44
+ "borderRadius": 10000,
45
+ },
46
+ "database": {
47
+ "type": "cylinder",
48
+ "color": "transparent",
49
+ "lineStyle": "solid",
50
+ "minWidth": 100,
51
+ "minHeight": 100,
52
+ "borderRadius": 8,
53
+ },
54
+ "actor": {
55
+ "type": "actor",
56
+ "color": "#00CCFF",
57
+ "borderColor": "#CC0000",
58
+ "lineStyle": "solid",
59
+ "minWidth": 90,
60
+ "minHeight": 90,
61
+ "borderRadius": 10000,
62
+ },
63
+ "boundary": {
64
+ "type": "rectangle",
65
+ "color": "transparent",
66
+ "lineStyle": "dashed",
67
+ "minWidth": 200,
68
+ "minHeight": 200,
69
+ "borderRadius": 10,
70
+ },
71
+ },
72
+ }