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 🙏

© 2026 – Pkg Stats / Ryan Hefner

signalk-derived-data

v1.45.0

Published

Plugin that derives signalk data from other signalk data

Downloads

1,544

Readme

signalk-derived-data

CI npm version License

Signal K server plugin that emits deltas for values derived from other Signal K values — wind angles computed from AWA + heading, CPA/TCPA from AIS tracks, moon illumination from time + position, tank volumes from calibrated levels, and so on.

Installation

Through the Signal K server admin UI — App Store → search for signalk-derived-data → install. Or from the command line in your ~/.signalk dir:

npm install signalk-derived-data

Requires signalk-server with Node >=22.

What it calculates

Every calculator here is optional and enabled individually in the plugin's config screen. Each has a derivedFrom list of Signal K paths and emits on one or more output paths.

Environment

  • Air density from humidity, temperature, and pressure
  • Air dew point from humidity and temperature
  • Wind chill from wind speed and outside temperature
  • Heat index from outside temperature and humidity
  • Moon illumination, phase, rise, and set from time + position
  • Sun mode (dawn / sunrise / day / sunset / dusk / night) from time + position
  • Sun timessunrise, sunriseEnd, goldenHourEnd, solarNoon, goldenHour, sunsetStart, sunset, dusk, nauticalDusk, night, nadir, nightEnd, nauticalDawn, dawn

Navigation

  • Distance to go from courseGreatCircle.nextPoint.position
  • Set and drift from heading, course over ground, speed through water, speed over ground, and magnetic variation. Writes environment.current.drift, setTrue, setMagnetic, plus environment.current.driftImpact — the last of these is a plugin-specific extension, not part of the Signal K spec.
  • True course over ground from magnetic COG + magnetic variation
  • Magnetic course over ground from true COG + magnetic variation
  • ETA to the active waypoint

Depth

  • Depth below keel from depth.belowSurface + design.draft.maximum
  • Depth below keel from depth.belowTransducer + depth.transducerToKeel
  • Depth below surface from depth.belowKeel + design.draft.maximum

Wind

  • True wind angle / direction / speed from speed-through-water, apparent wind angle, and apparent wind speed
  • True wind direction from AWA and true heading
  • Ground wind angle / speed from SOG, AWA, and AWS
  • Magnetic wind direction (two variants: from AWA + magnetic heading, or from true wind direction + magnetic variation)
  • Wind shift (experimental)

Performance

  • VMG to course from the next-point true bearing, true heading, and SOG
  • VMG to wind from true wind direction and SOG
  • Propeller slip (requires per-engine pitch + gear ratio in defaults.json)
  • Fuel economy from SOG and fuel rate

Boat state

  • Battery power from battery voltage × current
  • Tank volume from current level, using calibration pairs (>= 2 pairs for parallel sides, >= 3 for a wedge, >= 4 for more complex shapes)

AIS

  • CPA / TCPA (closest-point-of-approach / time-to-CPA) for nearby vessels, with configurable notification zones

Writing a new calculator

Drop a file into src/calcs/. Each calculator is a default-exported factory function that receives the server app + plugin instance and returns a Calculation descriptor:

import type { Calculation, CalculationFactory } from '../types'

const factory: CalculationFactory = function (_app): Calculation {
  return {
    group: 'course data',
    optionKey: 'vmg_Wind',
    title: 'Velocity Made Good to wind',
    derivedFrom: [
      'environment.wind.angleTrueWater',
      'navigation.speedOverGround'
    ],
    debounceDelay: 200,
    calculator: function (trueWindAngle: number, speedOverGround: number) {
      const vmg_wind = Math.cos(trueWindAngle) * speedOverGround
      return [{ path: 'performance.velocityMadeGood', value: vmg_wind }]
    }
  }
}

module.exports = factory

derivedFrom lists the Signal K paths the calculator subscribes to; the plugin feeds their latest values into calculator in the same order. Return a { path, value } list (or [] / undefined to skip emission this tick).

Each emitted delta is stamped with the minimum timestamp observed across the source paths, so staleness on any input propagates to the derived value and filestream replay preserves original timing. Calcs that author their own { context, updates } deltas (cpa_tcpa) are responsible for their own timestamps.

Contributing

Issues and pull requests welcome at SignalK/signalk-derived-data. npm test runs the full mocha suite; npm run typecheck + npm run build guard the TypeScript surface; npm run mutation runs Stryker against the calcs.

License

Apache-2.0. See LICENSE.