Socket
Socket
Sign inDemoInstall

three-streamlines

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    three-streamlines

Visualise three dimensional vector fields in threejs using stream lines.


Version published
Maintainers
1
Install size
28.2 MB
Created

Readme

Source

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

ParameterDescription
u3D array of x component of velocity, dims (y,x,z)
v3D array of y component of velocity, dims (y,x,z)
w3D 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

ParameterDescription
xMinMin x coordinate (required if array of x coordinates not included)
xMaxMax x coordinate (required if array of x coordinates not included)
yMinMin y coordinate (required if array of y coordinates not included)
yMaxMax y coordinate (required if array of y coordinates not included)
zMinMin z coordinate (required if array of z coordinates not included)
zMaxMax z coordinate (required if array of z coordinates not included)
{
    "xMin": 0,
    "xMax": 1,
    "yMin": 0,
    "yMax": 1,
    "zMin": 0,
    "zMax": 1,
}

options

OptionDescriptionDefault
noParticlesNumber of streams to be plotted10000
maxAgeMaximum age (number of animation timesteps) of any stream200
fadeOutPercentagePercentage of stream to fade out0.1
individualColorsNumber of individual colors in color ramp100
velocityFactorUnitless velocity factor to speed up/ slow down streams0.1
minMinimum value for color rangeData min
maxMaximum value for color rangeData max
nodataCustom no data valuenull
colorSourceUse velocity magnitude or use data.m as colorfalse
colorsColor 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 },
    ];
}

Keywords

FAQs

Last updated on 04 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc