npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fluidjs2d

v1.0.2

Published

A JS Library facilitating the visualization of 2D Fluid Flow

Downloads

39

Readme

What is FluidJS2D?

FluidJS2D is a library aiding in the visualization of two dimensional web fluid simulations

How does it work?

FluidJS2D uses html canvas elements to draw the visual components, while uses JavaScript classes and functions to run the necessary back end calculations. This library does NOT calculate vector field equations, and needs the user to code in their own equations. This library simply helps in visualizing the vectors and "experiments" done in the vector field.

How can I use it?

This library is split into two directories: Visual tools (in the visual directory) and Calculation tools (in the calc directory)

Visual Tools

These files all focus on the visual components needed to bridge the gap between JS calculations and canvas element manipulations. The file interface.js is responsible for doing this connection between visual html and calculation JavaScript, whereas the file styles.css holds the css properties and attributes, all modifiable, useful for setting visual elements to appropriate values.

styles.css also holds classes useful for the demonstration built into the library. These classes are not fundemental parts of the library.

Calculation Tools

These files focus instead on the calculation components of the library. particles.js contains the Particle class used to simulate particles placed into the fluid simulation. vectors.js contains the pVector class (position vector) used to create and draw vectors visualizing the behavior of the fluid simulation at specific points.

Putting Them All Together

Included in this library is a demonstration of how to use the library, located in the demo directory under public. The index.html file demonstrates how to set up an html environment suitable to interact with the library, while the entry.js file shows a potential way to use the library to create a simulation, while showing how to properly use all of the library's components.

To simply run the demonstration, use git to clone this repository into a suitable folder. Then, use git bash (or any other command line console that can take git commands) to navigate into the cloned folder and type the line npm start. Finally, navigate to a browser and type

http://localhost:3000

in the search field. Click on the html folder, and the vector simulation should lay before you.

How can I help?

Submit issues if you find any, and use suggestions.md to add suggestions (submit a PR when done).