Consider adding a mass property to nodes

Open
#96 18 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start by reading the repository’s force simulation and centering force entry points to understand how forces affect node motion; the issue does not name files or tests. The proposed behavior is to give nodes a mass that changes their response to applied forces, including the centering force, while preserving their repulsion. Done means that behavior is specified and implemented, with tests covering both force response and centering.

Written by the indexing model from the issue text.

Description

idea

Allowing nodes to have a mass property would be quite useful (so then the acceleration a produced by a force F acting on a node of mass m would be given by a = F/m, and this would also be used in calculating the centering force). For example, there might be a some nodes in your network (that may be quite important nodes for something) that you don't want to move around too much and stay quite central (but you don't want to fix completely), and giving them a large mass would achieve this. This can't be achieved by giving them a small charge since then they would no longer repel other nodes as strongly.

Dominant language
JavaScript
Stars
2k
Forks
395
Avg merge
5h 46m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from d3/d3-force

All issues in d3/d3-force

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.