Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing X or Y coordinates #24

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Fixing X or Y coordinates #24

merged 1 commit into from
Apr 18, 2018

Conversation

simbamford
Copy link
Contributor

Change to graphioGremlin.js extract_infov3 so that if vertex properties "graphexpx" or "graphexpy" are found in Gremlin DB (they should have numerical values) then these are used to constrain the x or y coordinates of the nodes in the visualisation. Any dimension which is not constrained, as well as any nodes which are not constrained in either dimension, are subject to the force simulation. Thus, adding only "graphexpy" properties can be used to display hierarchies, whether local or global, that may exist in your data. I recommend multiplying each desired hierarchical level by 50-100 in the first case in order to work well with the default graphexp visualisation settings. Adding some jitter in the y values on a single hierarchical level makes it easier for nodes to pass each other laterally during the force simulation, leading to cleaner layouts. Beware of adding excessive values in either dimension, which will push nodes out of the default area for visualisation.

… "graphexpx" or "graphexpy" are found in Gremlin DB (they should have numerical values) then these are used to constrain the x or y coordinates of the nodes in the visualisation. Any dimension which is not constrained, as well as any nodes which are not constrained in either dimension, are subject to the force simulation. Thus, adding only "graphexpy" properties can be used to display hierarchies, whether local or global, that may exist in your data. I recommend multiplying each desired hierarchical level by 50-100 in the first case in order to work well with the default graphexp visualisation settings.
@bricaud
Copy link
Owner

bricaud commented Apr 18, 2018

Great! Thank you very much. I did not expect it would be so easy!
Just before I merge it, could you tell me the range of reasonable values for graphexpx and graphexpy? in order that it stays within the screen limits. I will add some info about it in the readme.

@simbamford
Copy link
Contributor Author

My pleasure. Up to about 500 in each dimension works well - I haven't looked at negatives.

@bricaud bricaud merged commit 43ed2c2 into bricaud:master Apr 18, 2018
@bricaud
Copy link
Owner

bricaud commented Apr 18, 2018

I have modified your contribution by adding a variable node_position_x and node_position_y that can be set in the conf file graphConf.js. Then users can define their own variable for the position and do not have to modify the graph to create the entries graphexpx and graphexpy. Could you test if it still works, I do not have a graph with coordinates at hand. Thanks

@simbamford
Copy link
Contributor Author

Confirmed - that still works 👍

@bricaud
Copy link
Owner

bricaud commented Apr 18, 2018

Excellent! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants