vasturiano / 3d-force-graph-vr

3D force-directed graph component in VR
https://vasturiano.github.io/3d-force-graph-vr/example/large-graph/
MIT License
214 stars 51 forks source link

Publish as AFrame component #1

Closed morandd closed 6 years ago

morandd commented 7 years ago

Would be awesome to have this as an AFrame Component.

I can work on this if you like -- just message me about this so we don't duplicate work.

vasturiano commented 7 years ago

@morandd go for it! Just let me know if you need any help with it, I'm happy to spend some spare cycles giving a hand.

morandd commented 7 years ago

Hi Vasco,

Well, I tried, but failed.

The basic reason is that I'm hopeless with the whole npm and webpack/browserify build environment. Thus I could not compile your combination of aframe, d3, and ngraph. I went down one dead end trying to use the d3 default force simulation module, however as I discovered late, this does not allow 3d layouts. I should proceed by finally learning the npm build world with webpack etc, and then using require() to include ngraph.

But I spent 1 day on this and cannot afford to spend more :( I will just use MATLAB's built in force3 layout, read out the x/y/z, and build up my AFrame scene that way.

I attach my work in case you are able to progress it. It's just the new AFrame component wrapper. If you can replace the bit where the layout is actually calculated, around line 122:135, that should just about do it.

Dan

On Tue, Apr 25, 2017 at 10:04 AM, Vasco Asturiano notifications@github.com wrote:

@morandd https://github.com/morandd go for it! Just let me know if you need any help with it, I'm happy to spend some spare cycles giving a hand.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vasturiano/3d-force-graph-vr/issues/1#issuecomment-296952104, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ0TTxAgKohmPbDMIB1TUGDcMyH1ekyHks5rzaj7gaJpZM4NHExC .

--

Daniel Moran, Ph. D.

Director

KGM & Associates Pty Ltd.

moran@kgm-associates.com

morandd commented 7 years ago

Update: Discovered your https://github.com/vasturiano/d3-force-3d replacement for d3-force. I updated the web worker to use that, but get node.z values start at 0 then become NaN in the first tick of the simulation.

On Tue, Apr 25, 2017 at 6:46 PM, Dan Moran moran@kgm-associates.com wrote:

Hi Vasco,

Well, I tried, but failed.

The basic reason is that I'm hopeless with the whole npm and webpack/browserify build environment. Thus I could not compile your combination of aframe, d3, and ngraph. I went down one dead end trying to use the d3 default force simulation module, however as I discovered late, this does not allow 3d layouts. I should proceed by finally learning the npm build world with webpack etc, and then using require() to include ngraph.

But I spent 1 day on this and cannot afford to spend more :( I will just use MATLAB's built in force3 layout, read out the x/y/z, and build up my AFrame scene that way.

I attach my work in case you are able to progress it. It's just the new AFrame component wrapper. If you can replace the bit where the layout is actually calculated, around line 122:135, that should just about do it.

Dan

On Tue, Apr 25, 2017 at 10:04 AM, Vasco Asturiano < notifications@github.com> wrote:

@morandd https://github.com/morandd go for it! Just let me know if you need any help with it, I'm happy to spend some spare cycles giving a hand.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vasturiano/3d-force-graph-vr/issues/1#issuecomment-296952104, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ0TTxAgKohmPbDMIB1TUGDcMyH1ekyHks5rzaj7gaJpZM4NHExC .

--

Daniel Moran, Ph. D.

Director

KGM & Associates Pty Ltd.

moran@kgm-associates.com

--

Daniel Moran, Ph. D.

Director

KGM & Associates Pty Ltd.

moran@kgm-associates.com

vasturiano commented 7 years ago

@morandd I can have a look. Where do I find your code?

morandd commented 7 years ago

https://github.com/morandd/3d-force-graph-vr

index.html is my test/demo page aframe-forcegraph3d-component.js is the new Aframe component. the webworker is, well, the web worker code miserables.json and mrio2.json are test data.

I tried using .fx, .fz, but even these are not respected by the 3d-force-3d. .x and .y do not remain at the values of .fx and .fy as they should.

Sorry to present only bugs, you are doing great stuff, this is a great contribution.

thanks, dan

On Tue, Apr 25, 2017 at 8:40 PM, Vasco Asturiano notifications@github.com wrote:

@morandd https://github.com/morandd I can have a look. Where do I find your code?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vasturiano/3d-force-graph-vr/issues/1#issuecomment-297126234, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ0TT5HYHKFX2hYefJXS3bIHr27sm8rOks5rzj4pgaJpZM4NHExC .

--

Daniel Moran, Ph. D.

Director

KGM & Associates Pty Ltd.

moran@kgm-associates.com

vasturiano commented 7 years ago

@morandd, I put together a working version of this at: https://github.com/vasturiano/aframe-forcegraph-component

Feedback welcome! Let me know if it works for you.

micahstubbs commented 6 years ago

@vasturiano you could probably close this one since the component is published 😄