Skip to content

Allow d3.forceManyBody().distanceMax() and .distanceMin() to accept functions? (feature request) #186

@jaketeyjake

Description

@jaketeyjake

d3.forceManyBody().strength() can accept a function as its parameter, allowing differentiation of strength based on some other node property. Why not implement the same for .distanceMax() and .distanceMin()?

One use case is setting up a ring fence of fixed nodes in an irregular polygon to contain a bunch of nodes that are free to move in the simulation. You'd want the ring fence nodes to have strong repulsive strength but only at a local distance, while the free nodes could interact with each other over longer distances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions