Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aframe-forcegraph-component

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-forcegraph-component - npm Package Compare versions

Comparing version 2.13.0 to 2.14.0

28

index.js

@@ -87,2 +87,17 @@ /* global AFRAME */

// Bind component methods
d3Force: function() {
if (!this.forceGraph) {
// Got here before component init -> initialize forceGraph
this.forceGraph = new ThreeForceGraph();
}
const forceGraph = this.forceGraph;
const returnVal = forceGraph.d3Force.apply(forceGraph, arguments);
return returnVal === forceGraph
? this // return self, not the inner forcegraph component
: returnVal;
},
init: function () {

@@ -131,5 +146,6 @@ var state = this.state = {}; // Internal state

// setup FG object
this.el.object3D.add(state.forceGraph = new ThreeForceGraph());
if (!this.forceGraph) this.forceGraph = new ThreeForceGraph(); // initialize forceGraph if it doesn't exist yet
this.el.object3D.add(this.forceGraph);
state.forceGraph
this.forceGraph
.onLoading(function() {

@@ -201,6 +217,6 @@ state.infoEl.setAttribute('value', 'Loading...'); // Add loading msg

.filter(function(p) { return p in diff; })
.forEach(function(p) { comp.state.forceGraph[p](elData[p] !== '' ? elData[p] : null); }); // Convert blank values into nulls
.forEach(function(p) { comp.forceGraph[p](elData[p] !== '' ? elData[p] : null); }); // Convert blank values into nulls
if ('nodes' in diff || 'links' in diff) {
comp.state.forceGraph.graphData({
comp.forceGraph.graphData({
nodes: elData.nodes,

@@ -221,3 +237,3 @@ links: elData.links

var intersects = centerRaycaster.intersectObjects(this.state.forceGraph.children)
var intersects = centerRaycaster.intersectObjects(this.forceGraph.children)
.filter(function(o) { // Check only node/link objects

@@ -254,4 +270,4 @@ return ['node', 'link'].indexOf(o.object.__graphObjType) !== -1;

// Run force-graph ticker
this.state.forceGraph.tickFrame();
this.forceGraph.tickFrame();
}
});
{
"name": "aframe-forcegraph-component",
"version": "2.13.0",
"version": "2.14.0",
"description": "A 3D Force-Directed Graph component for A-Frame.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -71,2 +71,8 @@ ## aframe-forcegraph-component

There are also internal methods that can be invoked via the [components object](https://aframe.io/docs/0.8.0/core/component.html#accessing-a-component%E2%80%99s-members-and-methods):
| Method | Arguments | Description |
| --- | --- | --- |
| d3Force | id: <i>string</i>, [force: <i>function</i>] | Getter/setter for the internal forces that control the d3 simulation engine. Follows the same interface as `d3-force-3d`'s [simulation.force](https://github.com/vasturiano/d3-force-3d#simulation_force). Three forces are included by default: `'link'` (based on [forceLink](https://github.com/vasturiano/d3-force-3d#forceLink)), `'charge'` (based on [forceManyBody](https://github.com/vasturiano/d3-force-3d#forceManyBody)) and `'center'` (based on [forceCenter](https://github.com/vasturiano/d3-force-3d#forceCenter)). Each of these forces can be reconfigured, or new forces can be added to the system. This method is only applicable if using the d3 simulation engine. |
### Installation

@@ -73,0 +79,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc