
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
leaflet-streamlines
Advanced tools
Visualise two dimensional vector fields in leaflet using stream lines.
Visualise two dimensional vector fields in leaflet using stream lines.

Grid of simulated water velocity values on Lake Geneva from the Meteolakes project, plotted as streamlines.
Check out the examples:
This project is inspired by earth and borrows code from the IH.Leaflet.CanvasLayer.Field project.
import L from "leaflet";
import 'leaflet-streamlines';
or
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""
/>
<script
src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""
></script>
<script type="text/javascript" src="https://unpkg.com/leaflet-streamlines"></script>
then
var map = L.map("map");
L.streamlines(data, options).addTo(map);
Data must be an object {u: [[]], v:[[]]} where u and v are 2D arrays of equivalent shape. u: y veloctiy (northward) v: x veloctiy (eastward)
| Option | Description | Default | Type |
|---|---|---|---|
| xMax (Required) | Maximum x coordinate | Number | |
| xMin (Required) | Minimum x coordinate | Number | |
| yMax (Required) | Maximum y coordinate | Number | |
| yMin (Required) | Minimum y coordinate | Number | |
| paths | Number of streamlines to plot | 800 | Number |
| color | Color of streamlines, either a html color ("white", #FF5733) or a function that returns a color based on a single input of velocity magnitude. | white | Custom |
| width | Width of the streamline | 0.5 | Number |
| fade | Control the streamline fade | 0.97 | Number |
| duration | Milliseconds between timesteps | 10 | Number |
| maxAge | Max number of timesteps for streamline | 50 | Number |
| velocityScale | Factor to toggle speed of streamlines | 0.01 | Number |
| opacity | Opacity of streamlines | 1 | Number |
FAQs
Visualise two dimensional vector fields in leaflet using stream lines.
We found that leaflet-streamlines demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.