Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
aframe-forcegraph-component
Advanced tools
A 3D Force-Directed Graph component for A-Frame.
An A-Frame entity component to represent a graph data structure in a VR environment using a force-directed iterative layout. Uses d3-force-3d for the layout physics engine.
See also the standalone VR component version.
Property | Description | Default Value |
---|---|---|
json-url | URL of JSON file to load graph data directly from. Will override content of the nodes and links component properties so either use one or the other. JSON should contain an object with two list properties: nodes and links. | |
nodes | List of node objects. Example: [{"id": 1, "name": "first"}, {"id": 2, "name": "second"}] | [] |
links | List of link objects. Example: [{"source": 1, "target": 2}] | [] |
num-dimensions | Number of dimensions to run the force simulation on (1, 2 or 3). | 3 |
node-rel-size | Node sphere volume per val unit. | 4 |
node-resolution | Geometric resolution of each node, expressed in how many slice segments to divide the circumference. Higher values yield smoother spheres. | 8 |
line-opacity | Opacity of links. | 0.2 |
auto-color-by | Node object accessor function (fn(node) ) or attribute (e.g. 'type' ) to automatically group colors by. Only affects nodes without a color attribute. | |
id-field | Node object attribute name referring to unique node id (used in link objects source/target). | id |
val-field | Node object accessor function, attribute or a numeric constant for the node numeric value (affects sphere volume). | val |
name-field | Node object accessor function or attribute for name (shown in label). | name |
color-field | Node object accessor function or attribute for node color (affects sphere color). | color |
link-source-field | Link object attribute name referring to id of source node. | source |
link-target-field | Link object attribute name referring to id of target node. | target |
link-color-field | Link object accessor function or attribute for line color. | color |
force-engine | Which force-simulation engine to use (d3 or ngraph). | d3 |
warmup-ticks | How many times to tick the force simulation engine at ignition before starting to render. | 0 |
cooldown-ticks | How many times to tick the force simulation engine after rendering begins before stopping and freezing the engine. | Infinity |
cooldown-time | How much time (ms) to tick the force simulation engine after rendering begins before stopping and freezing the engine. | 15000 |
Install and use by directly including the browser files:
<head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-forcegraph-component/dist/aframe-forcegraph-component.min.js"></script>
</head>
<body>
<a-scene>
<a-entity forcegraph="json-url: myGraphData.json"></a-entity>
</a-scene>
</body>
Install via npm:
npm install aframe-forcegraph-component
Then require and use.
require('aframe');
require('aframe-forcegraph-component');
FAQs
A 3D Force-Directed Graph component for A-Frame.
The npm package aframe-forcegraph-component receives a total of 6,984 weekly downloads. As such, aframe-forcegraph-component popularity was classified as popular.
We found that aframe-forcegraph-component demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.