@graphty/layout 1.2.4 → 1.2.6
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/README.md +57 -1
- package/dist/layout.js +1762 -0
- package/dist/layout.js.map +1 -0
- package/package.json +7 -4
- package/src/layouts/force-directed/forceatlas2.ts +23 -4
- package/src/utils/rescale.ts +90 -15
- package/dist/src/algorithms/index.d.ts +0 -5
- package/dist/src/algorithms/index.js +0 -6
- package/dist/src/algorithms/index.js.map +0 -1
- package/dist/src/algorithms/optimization/index.d.ts +0 -7
- package/dist/src/algorithms/optimization/index.js +0 -7
- package/dist/src/algorithms/optimization/index.js.map +0 -1
- package/dist/src/algorithms/optimization/kamada-kawai-solver.d.ts +0 -32
- package/dist/src/algorithms/optimization/kamada-kawai-solver.js +0 -176
- package/dist/src/algorithms/optimization/kamada-kawai-solver.js.map +0 -1
- package/dist/src/algorithms/optimization/lbfgs.d.ts +0 -13
- package/dist/src/algorithms/optimization/lbfgs.js +0 -56
- package/dist/src/algorithms/optimization/lbfgs.js.map +0 -1
- package/dist/src/algorithms/optimization/line-search.d.ts +0 -15
- package/dist/src/algorithms/optimization/line-search.js +0 -37
- package/dist/src/algorithms/optimization/line-search.js.map +0 -1
- package/dist/src/algorithms/optimization/types.d.ts +0 -5
- package/dist/src/algorithms/optimization/types.js +0 -5
- package/dist/src/algorithms/optimization/types.js.map +0 -1
- package/dist/src/algorithms/planarity/check.d.ts +0 -17
- package/dist/src/algorithms/planarity/check.js +0 -30
- package/dist/src/algorithms/planarity/check.js.map +0 -1
- package/dist/src/algorithms/planarity/embedding.d.ts +0 -29
- package/dist/src/algorithms/planarity/embedding.js +0 -179
- package/dist/src/algorithms/planarity/embedding.js.map +0 -1
- package/dist/src/algorithms/planarity/index.d.ts +0 -7
- package/dist/src/algorithms/planarity/index.js +0 -8
- package/dist/src/algorithms/planarity/index.js.map +0 -1
- package/dist/src/algorithms/planarity/lr-test.d.ts +0 -15
- package/dist/src/algorithms/planarity/lr-test.js +0 -54
- package/dist/src/algorithms/planarity/lr-test.js.map +0 -1
- package/dist/src/algorithms/planarity/special-graphs.d.ts +0 -28
- package/dist/src/algorithms/planarity/special-graphs.js +0 -108
- package/dist/src/algorithms/planarity/special-graphs.js.map +0 -1
- package/dist/src/generators/basic.d.ts +0 -28
- package/dist/src/generators/basic.js +0 -79
- package/dist/src/generators/basic.js.map +0 -1
- package/dist/src/generators/bipartite.d.ts +0 -16
- package/dist/src/generators/bipartite.js +0 -40
- package/dist/src/generators/bipartite.js.map +0 -1
- package/dist/src/generators/grid.d.ts +0 -11
- package/dist/src/generators/grid.js +0 -37
- package/dist/src/generators/grid.js.map +0 -1
- package/dist/src/generators/index.d.ts +0 -8
- package/dist/src/generators/index.js +0 -9
- package/dist/src/generators/index.js.map +0 -1
- package/dist/src/generators/random.d.ts +0 -12
- package/dist/src/generators/random.js +0 -34
- package/dist/src/generators/random.js.map +0 -1
- package/dist/src/generators/scale-free.d.ts +0 -12
- package/dist/src/generators/scale-free.js +0 -62
- package/dist/src/generators/scale-free.js.map +0 -1
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/layouts/basic/index.d.ts +0 -4
- package/dist/src/layouts/basic/index.js +0 -5
- package/dist/src/layouts/basic/index.js.map +0 -1
- package/dist/src/layouts/basic/random.d.ts +0 -14
- package/dist/src/layouts/basic/random.js +0 -27
- package/dist/src/layouts/basic/random.js.map +0 -1
- package/dist/src/layouts/force-directed/arf.d.ts +0 -13
- package/dist/src/layouts/force-directed/arf.js +0 -103
- package/dist/src/layouts/force-directed/arf.js.map +0 -1
- package/dist/src/layouts/force-directed/forceatlas2.d.ts +0 -22
- package/dist/src/layouts/force-directed/forceatlas2.js +0 -322
- package/dist/src/layouts/force-directed/forceatlas2.js.map +0 -1
- package/dist/src/layouts/force-directed/fruchterman-reingold.d.ts +0 -19
- package/dist/src/layouts/force-directed/fruchterman-reingold.js +0 -131
- package/dist/src/layouts/force-directed/fruchterman-reingold.js.map +0 -1
- package/dist/src/layouts/force-directed/index.d.ts +0 -8
- package/dist/src/layouts/force-directed/index.js +0 -9
- package/dist/src/layouts/force-directed/index.js.map +0 -1
- package/dist/src/layouts/force-directed/kamada-kawai.d.ts +0 -15
- package/dist/src/layouts/force-directed/kamada-kawai.js +0 -87
- package/dist/src/layouts/force-directed/kamada-kawai.js.map +0 -1
- package/dist/src/layouts/force-directed/spring.d.ts +0 -19
- package/dist/src/layouts/force-directed/spring.js +0 -23
- package/dist/src/layouts/force-directed/spring.js.map +0 -1
- package/dist/src/layouts/geometric/circular.d.ts +0 -14
- package/dist/src/layouts/geometric/circular.js +0 -67
- package/dist/src/layouts/geometric/circular.js.map +0 -1
- package/dist/src/layouts/geometric/index.d.ts +0 -6
- package/dist/src/layouts/geometric/index.js +0 -7
- package/dist/src/layouts/geometric/index.js.map +0 -1
- package/dist/src/layouts/geometric/shell.d.ts +0 -15
- package/dist/src/layouts/geometric/shell.js +0 -67
- package/dist/src/layouts/geometric/shell.js.map +0 -1
- package/dist/src/layouts/geometric/spiral.d.ts +0 -16
- package/dist/src/layouts/geometric/spiral.js +0 -73
- package/dist/src/layouts/geometric/spiral.js.map +0 -1
- package/dist/src/layouts/hierarchical/bfs.d.ts +0 -12
- package/dist/src/layouts/hierarchical/bfs.js +0 -62
- package/dist/src/layouts/hierarchical/bfs.js.map +0 -1
- package/dist/src/layouts/hierarchical/bipartite.d.ts +0 -16
- package/dist/src/layouts/hierarchical/bipartite.js +0 -72
- package/dist/src/layouts/hierarchical/bipartite.js.map +0 -1
- package/dist/src/layouts/hierarchical/index.d.ts +0 -6
- package/dist/src/layouts/hierarchical/index.js +0 -7
- package/dist/src/layouts/hierarchical/index.js.map +0 -1
- package/dist/src/layouts/hierarchical/multipartite.d.ts +0 -12
- package/dist/src/layouts/hierarchical/multipartite.js +0 -73
- package/dist/src/layouts/hierarchical/multipartite.js.map +0 -1
- package/dist/src/layouts/index.d.ts +0 -8
- package/dist/src/layouts/index.js +0 -9
- package/dist/src/layouts/index.js.map +0 -1
- package/dist/src/layouts/specialized/index.d.ts +0 -5
- package/dist/src/layouts/specialized/index.js +0 -6
- package/dist/src/layouts/specialized/index.js.map +0 -1
- package/dist/src/layouts/specialized/planar.d.ts +0 -14
- package/dist/src/layouts/specialized/planar.js +0 -47
- package/dist/src/layouts/specialized/planar.js.map +0 -1
- package/dist/src/layouts/specialized/spectral.d.ts +0 -14
- package/dist/src/layouts/specialized/spectral.js +0 -106
- package/dist/src/layouts/specialized/spectral.js.map +0 -1
- package/dist/src/types/embedding.d.ts +0 -9
- package/dist/src/types/embedding.js +0 -5
- package/dist/src/types/embedding.js.map +0 -1
- package/dist/src/types/graph.d.ts +0 -10
- package/dist/src/types/graph.js +0 -5
- package/dist/src/types/graph.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -6
- package/dist/src/types/index.js +0 -7
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/layout.d.ts +0 -6
- package/dist/src/types/layout.js +0 -5
- package/dist/src/types/layout.js.map +0 -1
- package/dist/src/utils/graph.d.ts +0 -34
- package/dist/src/utils/graph.js +0 -69
- package/dist/src/utils/graph.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -8
- package/dist/src/utils/index.js +0 -9
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/numpy.d.ts +0 -17
- package/dist/src/utils/numpy.js +0 -101
- package/dist/src/utils/numpy.js.map +0 -1
- package/dist/src/utils/params.d.ts +0 -17
- package/dist/src/utils/params.js +0 -22
- package/dist/src/utils/params.js.map +0 -1
- package/dist/src/utils/random.d.ts +0 -14
- package/dist/src/utils/random.js +0 -42
- package/dist/src/utils/random.js.map +0 -1
- package/dist/src/utils/rescale.d.ts +0 -21
- package/dist/src/utils/rescale.js +0 -119
- package/dist/src/utils/rescale.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -30
- package/dist/vitest.config.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
[](https://coveralls.io/github/graphty-org/layout?branch=main)
|
|
5
5
|
[](https://badge.fury.io/js/%40graphty%2Flayout)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://graphty-org.github.io/layout/)
|
|
7
8
|
|
|
8
|
-
**[View Interactive Examples →](https://graphty-org.github.io/layout/
|
|
9
|
+
**[View Interactive Examples →](https://graphty-org.github.io/layout/index.html)**
|
|
9
10
|
|
|
10
11
|
Layout is a TypeScript library for positioning nodes in graphs. It's a TypeScript port of the [layout algorithms](https://networkx.org/documentation/stable/reference/drawing.html) from the Python [NetworkX](https://networkx.org/documentation/stable/) library.
|
|
11
12
|
|
|
@@ -1042,6 +1043,61 @@ The module includes complete implementations of:
|
|
|
1042
1043
|
}
|
|
1043
1044
|
```
|
|
1044
1045
|
|
|
1046
|
+
## Development
|
|
1047
|
+
|
|
1048
|
+
### Building the Project
|
|
1049
|
+
|
|
1050
|
+
The project uses a unified build system:
|
|
1051
|
+
|
|
1052
|
+
```bash
|
|
1053
|
+
# Build TypeScript to JavaScript
|
|
1054
|
+
npm run build
|
|
1055
|
+
|
|
1056
|
+
# Build the bundled ES module (dist/layout.js)
|
|
1057
|
+
npm run build:bundle
|
|
1058
|
+
|
|
1059
|
+
# Build everything
|
|
1060
|
+
npm run build:all
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
### Running Examples Locally
|
|
1064
|
+
|
|
1065
|
+
```bash
|
|
1066
|
+
# Start development server with examples
|
|
1067
|
+
npm run examples
|
|
1068
|
+
# or
|
|
1069
|
+
npm run serve
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
This will:
|
|
1073
|
+
1. Build the bundled `dist/layout.js`
|
|
1074
|
+
2. Start a Vite dev server at http://localhost:3000
|
|
1075
|
+
3. Automatically redirect imports to use the bundled version
|
|
1076
|
+
|
|
1077
|
+
### Building for GitHub Pages
|
|
1078
|
+
|
|
1079
|
+
To build a static site for GitHub Pages deployment:
|
|
1080
|
+
|
|
1081
|
+
```bash
|
|
1082
|
+
# Build static site in gh-pages/ directory
|
|
1083
|
+
npm run build:gh-pages
|
|
1084
|
+
```
|
|
1085
|
+
|
|
1086
|
+
This creates a `gh-pages/` directory with:
|
|
1087
|
+
- All example HTML files
|
|
1088
|
+
- The bundled `layout.js`
|
|
1089
|
+
- All necessary assets
|
|
1090
|
+
|
|
1091
|
+
To deploy to GitHub Pages, see `gh-pages/DEPLOY.md` after building.
|
|
1092
|
+
|
|
1093
|
+
### Development Workflow
|
|
1094
|
+
|
|
1095
|
+
1. **Make changes** to TypeScript source files in `src/`
|
|
1096
|
+
2. **Test locally** with `npm run examples`
|
|
1097
|
+
3. **Run tests** with `npm test`
|
|
1098
|
+
4. **Build for production** with `npm run build:all`
|
|
1099
|
+
5. **Deploy examples** with `npm run build:gh-pages`
|
|
1100
|
+
|
|
1045
1101
|
## Contributing
|
|
1046
1102
|
|
|
1047
1103
|
This project is a TypeScript port of the NetworkX Python library. For contributions and issues, visit the [GitHub repository](https://github.com/graphty-org/layout).
|