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

[Feature request]: Force-Directed Node Positioning Method #345

Open
3 tasks done
aiAdrian opened this issue Nov 11, 2024 · 1 comment · Fixed by #373
Open
3 tasks done

[Feature request]: Force-Directed Node Positioning Method #345

aiAdrian opened this issue Nov 11, 2024 · 1 comment · Fixed by #373

Comments

@aiAdrian
Copy link
Collaborator

Preflight Checklist

Request type

Request for a new component

Functionality

The feature implements an algorithm for positioning the nodes of a network graph, where the edges represent train run sections. This uses a "force-directed" layout method, in which the edges act like springs that keep the nodes close together, while the nodes themselves repel each other, mimicking an anti-gravity force.

The simulation runs until the positions of the nodes reach an equilibrium state. There are some predefined values: the minimum distance between the nodes is set to x pixels (Euclidean distance), and a "temperature" of 0.1 ensures that the nodes do not move too far apart.

During the simulation, the parameter k helps determine the distance between the nodes. At the end of the simulation, the network is rescaled and centered, with the scale and center parameters defining the size and position after rescaling.

Some nodes can be fixed in place, so they do not move during the simulation. In this case, rescaling at the end of the simulation is also disabled. If the scale parameter is set to None, rescaling is also disabled.

In summary, this feature creates an aesthetically pleasing and clear representation of a network by using physical principles for node placement and offering various customization options.

Link to design proposal file

No response

@aiAdrian aiAdrian self-assigned this Nov 11, 2024
@aiAdrian aiAdrian linked a pull request Dec 10, 2024 that will close this issue
5 tasks
@aiAdrian aiAdrian reopened this Dec 11, 2024
@aiAdrian
Copy link
Collaborator Author

First functionality implemented, but feature not yet

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

Successfully merging a pull request may close this issue.

1 participant