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

@grafana/alloy-pipeline-graph

v0.2.1

Published

Shared Alloy pipeline graph visualization for Grafana Alloy and Fleet Management

Readme

@grafana/alloy-pipeline-graph

NPM Version

Shared Alloy pipeline graph visualization for Grafana Alloy and Grafana Fleet Management.

Usage

import { PipelineGraph, type PipelineGraphData } from '@grafana/alloy-pipeline-graph';
import '@grafana/alloy-pipeline-graph/style.css';

const graph: PipelineGraphData = {
  nodes: [/* ... */],
  edges: [/* ... */],
};

// Graph-level handler — fires for every node click.
<PipelineGraph graph={graph} onNodeClick={(node) => console.log(node.id)} />

Consumers build the PipelineGraph input from their own data source:

  • Alloy — runtime component API (/api/v0/web/components)
  • Collector app — parsed Alloy config via @grafana-cloud/alloy-configurator

A runnable demo/ renders the component against several example datasets and documents the input shape — see demo/README.md.

Click handling

A node is interactive when there's a graph-level onNodeClick and/or the node carries its own onClick. Both fire on click (the per-node handler runs first), so individual nodes can override or augment the default behavior:

const graph: PipelineGraphData = {
  nodes: [
    { id: 'a', /* ... */, onClick: (node) => openDrawerFor(node) }, // per-node
  ],
  edges: [/* ... */],
};

Optional fields

  • PipelineEdge.metric — single aggregate live flow rate. When present, shown on the edge label and collapses the edge to one line.
  • PipelineEdge.signalMetrics — per-signal live rates ({ signal, value, unit? }[]). Each entry renders as its own colored line labelled with its rate, keeping the multi-signal fan-out under live data. Takes precedence over metric. Use this when a single edge carries several signals at independent rates (e.g. an OTLP receiver emitting metrics, logs and traces).
  • SignalKind.Targets — service-discovery output (target counts), colored distinctly from telemetry signals. discovery.* components infer to Targets.
  • PipelineNode.kind / parentId — expandable custom component containers.
  • PipelineNode.description / docsUrl — shown in the node's hover tooltip (docsUrl adds a "View docs" link).
  • PipelineNode.onClick — per-node click handler (see above).
  • PipelineNode.health / meta — carried on the node for consumers (e.g. in onClick); not rendered by the default node.
  • PipelineGraphProps.ui — inject Grafana Icon / Tooltip for in-app consistency.

Theming

The bundled light/dark themes mirror Grafana's GrafanaTheme2 values (colors, radius, shadows, icons), so the graph looks identical inside and outside of Grafana without depending on @grafana/ui / @grafana/data. Pass theme="light" | "dark", or a full PipelineGraphTheme object mapped from a live GrafanaTheme2 when running in-app.

Development

npm install
npm run build
npm test

Release

Releases use Changesets.

For any user-facing change, add a changeset in the PR:

npm run changeset

Pick patch, minor, or major when prompted. That choice decides the next version.

After the PR merges to main and CI passes, the release job opens/updates a release PR with the version bump and changelog. Merging that release PR publishes the package to npm.

Note: if package.json already contains a new unpublished version and there are no pending changesets, the release job will publish that version to npm.

License

Apache-2.0