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 🙏

© 2025 – Pkg Stats / Ryan Hefner

three-streamlines

v1.0.3

Published

Visualise three dimensional vector fields in threejs using stream lines.

Readme

THREE Streamlines

npm version

Visualise three dimensional vector fields in browser using stream lines.

Image of 3D Streamlines

Uses ThreeJS/WebGL for 3D rendering.

Check out the examples:

Quick start

import Streamlines from 'three-streamlines';

or

<script src="//unpkg.com/three-streamlines"></script>

then


const streamlines = new Streamlines(data, bounds, options);
scene.add(streamlines.object());

API reference

data

| Parameter | Description | | ------------ | ----------------------------------------------------------------- | | u | 3D array of x component of velocity, dims (y,x,z) | | v | 3D array of y component of velocity, dims (y,x,z) | | w | 3D array of z component of velocity, dims (y,x,z) | | x (optional) | 1D array of x coordinates (not required if spacing in grid fixed) | | y (optional) | 1D array of y coordinates (not required if spacing in grid fixed) | | z (optional) | 1D array of z coordinates (not required if spacing in grid fixed) |

{
    "u": [
            [
                [...],
                ...,
                [...]
            ]
            ,...,
            [
                [...],
                ...,
                [...]
            ]
        ],
    "v": [
            [
                [...],
                ...,
                [...]
            ]
            ,...,
            [
                [...],
                ...,
                [...]
            ]
        ],
    "w": [
            [
                [...],
                ...,
                [...]
            ]
            ,...,
            [
                [...],
                ...,
                [...]
            ]
        ],
    "x": [...],
    "y": [...],
    "z": [...],
}

bounds

| Parameter | Description | | --------- | ------------------------------------------------------------------ | | xMin | Min x coordinate (required if array of x coordinates not included) | | xMax | Max x coordinate (required if array of x coordinates not included) | | yMin | Min y coordinate (required if array of y coordinates not included) | | yMax | Max y coordinate (required if array of y coordinates not included) | | zMin | Min z coordinate (required if array of z coordinates not included) | | zMax | Max z coordinate (required if array of z coordinates not included) |

{
    "xMin": 0,
    "xMax": 1,
    "yMin": 0,
    "yMax": 1,
    "zMin": 0,
    "zMax": 1,
}

options

| Option | Description | Default | | ----------------- | --------------------------------------------------------- | -------- | | noParticles | Number of streams to be plotted | 10000 | | maxAge | Maximum age (number of animation timesteps) of any stream | 200 | | fadeOutPercentage | Percentage of stream to fade out | 0.1 | | individualColors | Number of individual colors in color ramp | 100 | | velocityFactor | Unitless velocity factor to speed up/ slow down streams | 0.1 | | min | Minimum value for color range | Data min | | max | Maximum value for color range | Data max | | nodata | Custom no data value | null | | colorSource | Use velocity magnitude or use data.m as color | false | | colors | Color range | {} |

{
    "noParticles": 10000,
    "maxAge": 200,
    "fadeOutPercentage": 0.1,
    "individualColors": 100,
    "velocityFactor": 0.1,
    "min": 0,
    "max": 0.1,
    "nodata": null,
    "colorSource": false,
    "colors": [
      { color: "#000000", point: 0.0 },
      { color: "#550088", point: 0.14285714285714285 },
      { color: "#0000ff", point: 0.2857142857142857 },
      { color: "#00ffff", point: 0.42857142857142855 },
      { color: "#00ff00", point: 0.5714285714285714 },
      { color: "#ffff00", point: 0.7142857142857143 },
      { color: "#ff8c00", point: 0.8571428571428571 },
      { color: "#ff0000", point: 1.0 },
    ];
}