Coder Social home page Coder Social logo

d3-force-registry's Issues

Add d3.forceManyBodyReuse

Great resource! Is it possible to add d3-force-reuse to your registry? Here is an example row you could add to the table:

Plugin Description Code Examples
d3.forceManyBodyReuse Faster inverse-linear (distance) attraction/repulsion force applied to all nodes. Typically used as node repulsion in force-directed graphs for a distributed spread. Runs faster than d3.forceManyBody by reusing approximations. d3-force-reuse

videos and presentations

Would you also consider this as a good spot to collect other resources, such as videos and presentations? If so, will gladly help collect links.

Iterative-Relaxation in d3.forceLink

Wasn't too sure where to post this, but this repo seems to curate d3-force plugins for use in (perhaps) unusual use-cases, like physical simulations - so figured I'd alert users to energy-conservation in d3-force.

In particular, the Pendulum example asks:

Ok, I'm confused. Why isn't energy conserved and does the pendulum eventually stop?

Similarly, the Newton's Cradle example also 'thermalizes' albeit both explicitly setting:

d3.forceSimulation()
	.alphaDecay(0)
	.velocityDecay(0)

The issue is that d3.forceLink actually performs iterative relaxation. The offending lines in the source code are:

        x = target.x + target.vx - source.x - source.vx || jiggle(random);
        y = target.y + target.vy - source.y - source.vy || jiggle(random);

Note the link distance is specified by 'peeking ahead' to the anticipated position of the node ⟨x + vx,y + vy⟩.

This notebook further explains the issue using examples, and suggests two alternatives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.