Particles are spawned at a random positions inside the canvas with random velocities. If a particle is close enough to another particle a line will be drawn between them. Line opacity is controlled by distance.
All your code in one place
Over 40 million developers use GitHub together to host and review code, project manage, and build software together across more than 100 million projects.
Sign up for free See pricing for teams and enterprises
p5.js Visualization - Connecting points by distance with a line
JavaScript
HTML

Cannot retrieve the latest commit at this time.
Type | Name | Latest commit message | Commit time |
---|---|---|---|
Failed to load latest commit information. | |||
![]() |
LICENSE.md | ||
![]() |
README.md | ||
![]() |
index.html | ||
![]() |
preview.gif | ||
![]() |
sketch.js |