https://github.com/romellogoodman/flow-field.js Skip to content Sign up * Why GitHub? + Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories - * Team * Enterprise * Explore + Explore GitHub - + Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - + Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing + Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} romellogoodman / flow-field.js Public * * Notifications * Star 200 * Fork 2 * A library for generating flow fields. MIT License 200 stars 2 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show Loading {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default Loading View all tags 1 branch 0 tags Code Loading Latest commit @romellogoodman romellogoodman 0.0.4 ... b4c6ff2 Nov 29, 2021 0.0.4 b4c6ff2 Git stats * 20 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github .eslintignore .gitattributes .gitignore .npmignore LICENSE README.md index.js package-lock.json package.json View code [ ] flow-field Table of contents Usage Install Use API generateParticles moveParticle generateField Contributing README.md flow-field npm version A library for generating flow fields. Demo: Codesandbox Demo Resources for learning more about flow fields and noise: * Flow Fields by Tyler Hobbs * Noise by Varun Vachhar Table of contents * Usage * API Reference * Contributing Usage Install npm npm i @romellogoodman/flow-field unpkg Use import {generateField} from '@romellogoodman/flow-field'; const field = generateField({count: 100, height: 1000, width: 1000}); API generateParticles Creates the particles for a flow field. * @param {Number} count Number of particles in the field. * @param {Number} height Height of space. * @param {Number} margin Percent of height/width to create a padding. * @param {String} seed Random (random-js) seed. * @param {Number} width Width of space. * @return {Array} List of particle objects containing the starting x and y coordinates. moveParticle Computes the new position for a particle and adds it to the particle.line array. * @param {Number} amplitude Controls the range of values we get from the noise function. * @param {Number} damping Slows down the particle (think friction). * @param {Number} frequency Controls how quickly/slowly the noise function is "evolving over time". * @param {Number} lengthOfStep Amount to move the coordinate. * @param {Object} particle Particle object containing the. * @return {Void} Operates on the particle and returns nothing. generateField Creates a flow field with particles and lines. * @param {Number} amplitude Controls the range of values we get from the noise function. Default to 5. * @param {Number} count Number of particles in the field. Default to 1000. * @param {Number} damping Percentage that slows down the particle (think friction). Default to 0.1. * @param {Number} height Height of space. * @param {Number} margin Percent of height/width to create a padding. Default to 0.1. * @param {Object} particles List of particles to use instead of generating them. * @param {String} scale Used to compute frequency, number of steps and step length. Default to 1. * @param {String} seed Random (random-js) seed. * @param {Number} width Width of space. * @return {Array} List of particle objects containing the line coordinates. Contributing All contributors and all contributions both big and small are welcome in this project. About A library for generating flow fields. Resources Readme License MIT License Releases No releases published Sponsor this project * patreon patreon.com/romellogoodman Packages 0 No packages published Languages * JavaScript 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.