-
Notifications
You must be signed in to change notification settings - Fork 239
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
Allow setting individual thickness and length of lines, maybe directly or using a "prority number" #317
Comments
@56independent thanks for reaching out. It's certainly possible to add line thickness and calibrate the link attraction force between nodes. Let's look at line thickness first. This is a purely cosmetic item (does not influence the force engine), and you can manipulate it per link, using the As for the distance, or any other attributes of the link attraction force, you can calibrate it using all settings found in d3-force forceLink. The link force works a little bit like a spring in which each link has a target length (at rest), and any push/pulls from that position will be counter-acted with a linear attraction force. In this case if you're interested in changing the target distance of the links, you can do something like: myGraph.d3Force('link').distance(link => /* your code */) The same way you can modify other attributes of the force, like strength for instance. |
Are you sure the link length is individually settable? I'd like each link to have it's own target distance. However, i would like to see a "priority" value as well, which abstracts away the need for both to be modified; if the actual length post-being-made-a-spring is shorter then the amount set, it then makes the line thicker, and vice versa. See my potential algorithm:
This then allows us to see how the nodes have been forced to change and where the most extreme relationships are. |
Yes, both the This logic is quite app specific, so it makes sense for it to exist in the app, not in this module. But you should have all the configuration available from this module to be able to build it. |
Is your feature request related to a problem? Please describe.
I made an issue on Trilium asking for the graph to be able to contract or pull individual links, keeping porportion similar. However, the developer discussed the fact that this library limits this from happening.
However, this limitation may be due to the fact that:
Describe the solution you'd like
Firstly, i'd like to seek clarification of whether, in the eyes of the developer, these simplifications are required. If not, then i would like the ability to set the thickness and length of lines in two ways:
length:
andthickness:
(measured in arbitary units) to show how they're displayed, where in "impossible situations" (where the lengths are not able to interface), the biggest number is made a little bigger and the smallest a little smaller, the node with the most connections having priorityI don't have much experience with this project (yet), but i think that in the below snippet of code:
we could add line thicknesses like so?
This adds a new
.looks
function, opening the door to new "looks" and allowing more styling options to be added in the future.The text was updated successfully, but these errors were encountered: