Gathering detailed insights and metrics for @antv/layout-gpu
Gathering detailed insights and metrics for @antv/layout-gpu
Gathering detailed insights and metrics for @antv/layout-gpu
Gathering detailed insights and metrics for @antv/layout-gpu
npm install @antv/layout-gpu
Typescript
Module System
Node Version
NPM Version
TypeScript (77.37%)
Rust (18.41%)
HTML (2.4%)
JavaScript (1.81%)
Shell (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
234 Stars
195 Commits
59 Forks
11 Watchers
13 Branches
66 Contributors
Updated on Jul 12, 2025
Latest Version
1.1.7
Package Id
@antv/layout-gpu@1.1.7
Unpacked Size
1.09 MB
Size
273.05 kB
File Count
24
NPM Version
10.8.2
Node Version
20.13.1
Published on
Sep 06, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Accelerate some parallelizable algorithms such as Fruchterman with WebGPU which has a better performance under large amount of data.
1# npm 2$ npm install @antv/layout-gpu --save 3 4# yarn 5$ yarn add @antv/layout-gpu
Choose a layout algorithm from @antv/layout-gpu
then.
1import { Graph } from "@antv/graphlib"; 2import { FruchtermanLayout } from "@antv/layout-gpu"; 3 4const graph = new Graph({ nodes: [], edges: [] }); 5 6const fruchtermanLayout = new FruchtermanLayout(); 7 8(async () => { 9 // Return positions of nodes & edges. 10 const positions = await fruchtermanLayout.execute(graph); 11 // Or to directly assign the positions to the nodes: 12 await circularLayout.assign(graph); 13})();
Import scripts in UMD version of @antv/graphlib
, @antv/layout
and @antv/layout-gpu
.
1<script 2 src="https://unpkg.com/@antv/graphlib" 3 type="application/javascript" 4></script> 5<script 6 src="https://unpkg.com/@antv/layout" 7 type="application/javascript" 8></script> 9<script 10 src="https://unpkg.com/@antv/layout-gpu" 11 type="application/javascript" 12></script>
Use layouts under LayoutGPU
namespace.
1const { Graph } = window.GraphLib; 2const { FruchtermanLayout } = window.LayoutGPU;
We provide the following parallelizable layouts:
1import { Graph } from "@antv/graphlib"; 2import { FruchtermanLayout } from "@antv/layout-gpu"; 3 4const graph = new Graph({ nodes: [], edges: [] }); 5 6const fruchtermanLayout = new FruchtermanLayout({ 7 center: [200, 200], 8}); 9const positions = await fruchtermanLayout.execute(graph);
Fruchterman is a kind of force-directed layout. The implementation is according to the paper Graph Drawing by Force-directed Placement.
LayoutOptions:
center
[number, number] The center of the graph. e.g. [0, 0]
width
number The width of the graph. The default value is 300
.height
number The height of the graph. The default value is 300
.maxIteration
number The default value is 1000
.gravity
number The gravity, which will affect the compactness of the layout. The default value is 10
.speed
number The moving speed of each iteraction. Large value of the speed might lead to violent swing. The default value is 5
.The scripts and documentation in this project are released under the MIT License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
3 existing vulnerabilities detected
Details
Reason
Found 15/30 approved changesets -- score normalized to 5
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More