Comments (8)
@S73AM, the node-three-object
property should reference a function that returns a ThreeJS Object3d
. For example:
node-three-object: node => new THREE.Mesh(new THREE.BoxGeometry(5, 5, 5), new THREE.MeshBasicMaterial({ color: 'red' }))
from aframe-forcegraph-component.
Thanks @vasturiano for help. One more thing in which I am struggling. Can you tell me how do I add Eventlisteners to the nodes using ID? So, that if i click on any node I can perform the specific action.
from aframe-forcegraph-component.
@S73AM how do you 'click' on an aframe component? This component does not currently handle click events as that's generally controller specific.
However, it could expose a onCenterHover
method that triggers whenever there is a node/link intercepted at the center of the viewport. The same manner that labels are shown currently. Would this help your case?
from aframe-forcegraph-component.
@vaturiano Well in my case I want to click on the nodes and open up a Page or URL after click. Is it possible?
from aframe-forcegraph-component.
@vasturiano Well in my case I want to click on the nodes and open up a Page or URL after click. Is it possible?
from aframe-forcegraph-component.
@vasturiano if you exposed onCenterHover, would that be able to return the node id of the focused node? If so, that would help my use case at least. Thanks btw!
from aframe-forcegraph-component.
@waldercong ok I've added two new callback props to the component (v2.7.0
): on-node-center-hover
and on-link-center-hover
. Each of them passes the currently hovered node/link object as a function parameter (or null on hover out).
You should be able to use it like this:
on-node-center-hover: node => console.log(node);
You can keep track of the hovered nodes and use it to handle click or other controller events on the scene itself.
Let me know if this works for you.
from aframe-forcegraph-component.
Thank you!! @vasturiano
from aframe-forcegraph-component.
Related Issues (20)
- Readme.md browser example: t is not defined HOT 1
- graph crashes / vanishes when setting new/custom component attribute HOT 2
- Remove try catch HOT 1
- where are events defined? HOT 2
- Is graphdata from the 3d and 2d forcegraph libraries supported HOT 3
- handling clicks (not just hover) HOT 4
- typescript typings
- node / link color HOT 2
- Graph disappears when clicked in visual inspector HOT 1
- Oculus Go Support HOT 1
- Aframe Node with Image or other Entity instead of Sphere HOT 8
- TypeError: accessorFn is not a function using the npm module HOT 4
- Being able to customize more interactions like in 3d-force-graph HOT 1
- superhands support for nodes and edges HOT 1
- Camera background in AR HOT 6
- Excluding Link(s) from Intersection HOT 2
- dag-mode attribute doesn't work HOT 2
- unkpg.com hosting seems to be blown HOT 1
- add gitignore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aframe-forcegraph-component.