anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.76k stars 425 forks source link

Nodes have reversed positions to edges. #192

Open olejka91 opened 7 years ago

olejka91 commented 7 years ago

I found out Vivagraph few weeks ago. It`s really interesting. But I met a problem when I render .png images with webgl, nodes and edges are reversed.

When I select node and move it works wrong on Y axis. screenshot from 2017-04-07 17-52-58

olejka91 commented 7 years ago

line: 5413 = > changed

pos.y = ui.position.y; to=> pos.y = -ui.position.y;

mauriciogior commented 7 years ago

@olejka91 which file? Could you be more specific? I have the same problem.

Thanks.

olejka91 commented 7 years ago

Hi, actually I didnt solve this on the level I want to, because if you add textlabels using webglDOMLabels method then images will move correct but textnodes in opposite way. I didnt try figure out how to solve it because after I found out that webglDOMLabels adds not webgl components but DOM elements I decided to refuse from this lib, because I have really large graphs (about 10 thousands nodes, nodelabels and edgelabels )

You have to open vivagraph.js lib file, find out row #5413 and change it to pos.y = - ui.position.y;

Try D3V4 using canvas it`s actually fast enough.

cloudtracer commented 6 years ago

:) surprised this hasn't been fixed. I have the same issue, sure enough reversing the y axis works.

Change needs to be made in webglGraphics.js in the renderNodes function. I'll report back with the text label fix too when I run into that as well.