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

@nearai/analytics-dashboard

v0.1.10

Published

A configurable React dashboard component for analytics with graphs, tables, and logs views

Readme

Analytics Dashboard

A web application for querying and visualizing analytics metrics data. Features comprehensive views for time series analysis, data tables, and chronological logs. Can be used as a standalone web app or as a configurable web component in other applications.

Prerequisites

  • Node.js 16+ and npm
  • The metrics service running at http://localhost:8000

Installation

  1. Navigate to the project directory:
cd analytics/dashboard
  1. Install dependencies:
npm install
npm run build-css

Running the Application

  1. Ensure the metrics service is running:
metrics-service --metrics-path /path/to/your/tuned/metrics
  1. Start the development server:
npm start
  1. Open your browser and navigate to:
http://localhost:3000

Dashboard Views

The dashboard provides three main views accessible via navigation tabs:

Time Series View (Primary)

Interactive time series visualization with comprehensive graph management:

  • Control Panel: Configure time filters, granulation, and global filters
  • Graph Grid: 2x3 layout supporting up to 6 graphs initially, with unlimited rows capability
  • Add/Remove Graphs: Click-to-add placeholders and remove buttons for existing graphs
  • Graph Configuration Modal: Pop-up interface for configuring multiple lines per graph
  • Metric Tree Selection: Interactive tree for selecting metrics from /metrics/ paths using table API
  • Filter Support: Optional filters with syntax help and recommendations
  • Slice Support: Optional slicing with automatic slice value detection via API
  • Smart Color Management: Automatic color assignment based on success/error patterns, with manual override
  • Auto Time Granulation: Automatically adjusts based on time filter selection:
    • 1 hour over 1 day/week
    • 1 day over 1 month
    • 1 week over 1 year
  • Real-time Data: Uses /graphs/time-series endpoint for live data fetching

Table View

  • Control Panel: Configure parameters, filters, and slices
  • Column Tree: Hierarchical column selection
  • Data Table: Interactive table with sorting and filtering
    • Initially a single row showing overall averages
    • Dynamically filter and slice the data by any column
  • Time Filters: Quick filters for last hour/day/week
  • Details View: Click cells to view detailed JSON data
  • Model Comparison Mode: When using 'COMPARE_MODELS' metricSelection:
    • Uses /table/evaluation endpoint instead of /table/aggregation
    • No parameters, slicing, or time filters available
    • Default column selections: ['/metrics/']
    • Designed for comparing different model performances

Chronological Logs View

This view displays individual log entries in chronological order:

  • Detailed metadata for each run
  • Quick access to metrics and log files
  • Filtering by date ranges and metadata
  • Grouping

Web Component Usage

For detailed web component usage instructions, see WEB_COMPONENT_USAGE.md.

Building for Production

To create a production build:

npm run build

The build files will be in the build/ directory.

Development

The app is built with:

  • React 18
  • Node.js 23+
  • TypeScript
  • Tailwind CSS
  • Lucide React (for icons)
  • Recharts (for time series visualization)

Implementation Status

1. Custom View

Current implementation: ✅ Available

  • Launch on any data as long as it is in canonical metrics format.
  • Interactive time series visualization with graph management.
  • Custom metrics table with full parameter control.
  • Stream of log files with detailed metadata.
  • Configurable through Dashboard component with any combination of parameters.

2. Performance Dashboard

Current implementation: ✅ Available

  • Time granulation: Manual time filters (last hour, day, week, custom ranges).
  • Interactive performance time series graphs.
  • Metrics table with filtering, slicing, performance columns, and custom columns.
  • Stream of log files with chronological ordering.
  • Default parameters optimized for performance tracking.
  • Time filter recommendations can be passed to logs view.

3. Cost/Accuracy/Latency Tracking

Current implementation: ✅ Latency graphs available

  • Interactive latency time series graphs.
  • Future: Will include specialized cost, accuracy, and latency column selections.

4. Error Analysis

Current implementation: ✅ Error logs available

  • Stream of log files specifically for error runs.
  • Future: Error-specific filters and grouping strategies.
  • Future: Error pattern detection and analysis.

5. User Feedback Analysis

Current implementation: ❌ Not implemented

  • Planned: Stream of log files with user feedback data.
  • Future: Feedback sentiment analysis and categorization.
  • Future: User feedback correlation with performance metrics.

6. Compare Models

Current implementation: ✅ Table available

  • Models evaluation table.
  • Future: Model recommendations based on agent's information and developer's preferences (e.g., budget).