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

@jbroll/nmea-widgets

v0.1.0

Published

Modern React/Preact components for visualizing NMEA GPS data in real-time using Web Serial API

Downloads

328

Readme

NMEA Widgets

A modern React/Preact component library for visualizing NMEA GPS data in real-time using the Web Serial API. Built with TypeScript and Tailwind CSS.

Try the nmea-demo!

Features

  • Real-time NMEA sentence parsing and visualization
  • Interactive satellite constellation view showing:
    • GPS, GLONASS, Galileo, and BeiDou satellites
    • Signal strength indicators
    • Elevation and azimuth display
    • Satellite status (in use/visible)
  • Position information display with:
    • Latitude/Longitude coordinates
    • Altitude
    • Position accuracy (when GST messages available)
    • Fix type and satellite count
  • Raw NMEA data view with filtering options
  • Processed data inspection panel
  • Responsive design that works on desktop and mobile browsers

Installation

npm install @jbroll/nmea-widgets

This package has peer dependencies that you'll need to install in your project:

npm install preact tailwindcss

Setup

  1. Configure Tailwind CSS in your project. Add the NMEA Widgets content paths to your tailwind.config.js:
/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/@jbroll/nmea-widgets/**/*.{js,ts,jsx,tsx}"
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
  1. Import and initialize Tailwind CSS in your application:
/* styles.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

Basic Usage

import { NMEADisplay, useNMEA } from '@jbroll/nmea-widgets';

function App() {
  const { 
    serialData,
    processedData,
    isConnected,
    connect,
    disconnect,
    setFilter,
    isSupported
  } = useNMEA();

  return (
    <NMEADisplay
      serialData={serialData}
      processedData={processedData}
      onConnect={connect}
      onDisconnect={disconnect}
      onFilterChange={setFilter}
      isConnected={isConnected}
      isSupported={isSupported}
    />
  );
}

Components

NMEADisplay

The main component that provides a complete UI for NMEA data visualization.

import { NMEADisplay } from '@jbroll/nmea-widgets';

<NMEADisplay
  serialData={string}
  processedData={ProcessedData}
  onConnect={() => void}
  onDisconnect={() => void}
  onFilterChange={(sentenceType: string, enabled: boolean) => void}
  isConnected={boolean}
  isSupported={boolean}
/>

SatellitePlot

A standalone component for visualizing satellite positions and signal strengths.

import { SatellitePlot } from '@jbroll/nmea-widgets';

<SatellitePlot data={processedData} />

NMEAInfo

Displays position information and accuracy metrics.

import { NMEAInfo } from '@jbroll/nmea-widgets';

<NMEAInfo data={processedData} />

useNMEA Hook

A React hook that handles Web Serial communication and NMEA data processing.

const {
  serialData,        // Raw NMEA sentences
  processedData,     // Parsed and processed NMEA data
  isConnected,       // Connection state
  isConnecting,      // Connection in progress
  error,             // Error state
  connect,           // Function to initiate connection
  disconnect,        // Function to close connection
  sendCommand,       // Function to send commands to device
  setFilter,         // Function to filter NMEA sentences
  isSupported        // Whether Web Serial API is supported
} = useNMEA();

Types

ProcessedData

interface ProcessedData {
  position: {
    latitude: number;
    longitude: number;
    altitudeMeters: number;
    fixType: number;
    satellites: number;
  } | null;
  errorStats: {
    latitudeError: number;
    longitudeError: number;
    altitudeError: number;
  } | null;
  satellites: {
    visible: Satellite[];
    inUse: number[];
  };
}

interface Satellite {
  prnNumber: number;
  elevationDegrees: number;
  azimuthTrue: number;
  SNRdB: number;
  constellation: string;
}

Browser Support

The Web Serial API is required for this library to function. Currently supported in:

  • Google Chrome (desktop)
  • Microsoft Edge (desktop)
  • Opera (desktop)
  • Chrome for Android (with flag)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

  • Uses nmea-simple for NMEA sentence parsing
  • Interface design inspired by modern GPS visualization tools