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

Node/layer distances too big in most vis::Graphs layouts #1733

Closed
jurgenvinju opened this issue Dec 6, 2022 · 1 comment
Closed

Node/layer distances too big in most vis::Graphs layouts #1733

jurgenvinju opened this issue Dec 6, 2022 · 1 comment
Assignees

Comments

@jurgenvinju
Copy link
Member

Describe the bug

image

To Reproduce

import IO;
copy(|zip+testdata:///m3/snakes-and-ladders-project-source.zip!/|, |tmp:///snakes-and-ladders|, recursive=true)
import lang::java::m3::Core;
import lang::java::m3::AST;
myModel = createM3FromDirectory(|tmp:///snakes-and-ladders/src|);
import vis::Graphs;

Breadthfirst has a lot of whitespace between the layers:

graph({<x,"implements",y> | <x,y> <- myModel.implements} + {<x,"extends",y> | <x,y> <- myModel.extends}, layoutName=CytoLayoutName::breadthfirst())

Circle has enormous radius compared to the nodes:

graph({<x,"implements",y> | <x,y> <- myModel.implements} + {<x,"extends",y> | <x,y> <- myModel.extends}, layoutName=CytoLayoutName::circle())

Expected behavior

  • better use of whitespace in a screen, more space for nodes and labels and less for nothing

Screenshots

image

@jurgenvinju
Copy link
Member Author

  • Changed the \layoutName parameter to \layout to provide an entire layout with all of its options.
  • \defaultLayoutName is the scheme to get a default layout, like: defaultCircleLayout() and defaultCoseLayout()
  • pass in extra options according to each layout's option:

For example, spacingFactor is an option to both circleLayout and breadthfirstLayout:

graph({<x,"implements",y> | <x,y> <- myModel.implements} + {<x,"extends",y> | <x,y> <- myModel.extends}, \layout=defaultCircleLayout(spacingFactor=.5))
graph({<x,"implements",y> | <x,y> <- myModel.implements} + {<x,"extends",y> | <x,y> <- myModel.extends}, \layout=defaultBreadthfirstLayout(spacingFactor=.8))

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

No branches or pull requests

1 participant