-
Notifications
You must be signed in to change notification settings - Fork 260
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
constraint documentation is quite thin #56
Comments
A separation constraint is either an equality or inequality relation between a pair of x or y node (center) positions requiring them to be separated precisely (equality) or at least (inequality) by "gap". An alignment specifies fixed separations between any number of node centers. An "offset" of zero will make all the nodes in the alignment be precisely aligned by their centers. Non-zero offsets can be specified to make nodes align by displacements from their centers. For example, to force a bunch of nodes of different widths to be aligned by their left-hand-sides, specify an offset for each node proportional to half its width. Make sense? I should improve this example to better document this! |
Thanks for the reply, and your explanation of offsets is useful and yes, it makes perfect sense. However the main point of this issue was to highlight the fact that there is no single place which a) lists all constraint types and b) explains how to use them all. I think that really needs to be on the wiki; examples are good, but they are not really sufficient by themselves. So I would suggest leaving this issue open until there is such a wiki page - but it's up to you of course. Thanks again! |
Also, it's not clear how to make a separation constraint based on equality. The only documentation I can find is near the bottom of the homepage which only covers inequality, and as I just posted in #60, I have no idea how the downward edges example works. |
regarding creating equality constraints, you create a constraint nodes[0].x + 30 = nodes[1].x like so:
I agree, all this needs to be documented in the wiki. I'm absolutely swamped at the moment though, your questions and comments are much appreciated. Any chance you could make some notes about this stuff as you learn it in the wiki? Do you have access to create wiki pages? I'm happy to give you such access if you need it :-). |
Looks like I already have wiki access. I'm totally swamped too unfortunately however I'll certainly bear this in mind and although I'm having to take a break from my |
Note: the wiki page will need to cover these points. |
I've created https://github.com/tgdwyer/WebCola/wiki/Constraints as a stub page for proper constraints documentation. |
I have now expanded the wiki page so it's reasonably comprehensive. |
you're a star! Thanks :-). |
As a follow-up question: Can I also pass the node objects instead of their list indices when specifying constraints? E.g.
instead of
If so, this should probably be documented as well. |
Some of the examples use various types of constraints but other than trawling through them there doesn't seem to be any way to find out all the different types available. So far I found:
gap
alignment
but are there others?
Also for
alignment
constraints it's not clear what theoffset
value means. Is it just the distance in pixels from the left (or top, depending on the axis of orientation)?Thanks!
The text was updated successfully, but these errors were encountered: