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

@nipunx1999/perspective-viewer-boxplot

v1.0.3

Published

A seaborn-style boxplot plugin for FINOS Perspective with hover tooltips and multi-metric support

Readme

Perspective Viewer Boxplot

A seaborn-style boxplot plugin for FINOS Perspective with rich hover tooltips and multi-metric support.

Features

Generic categorical grouping - Works with any column names
Multi-metric support - Compare multiple metrics side-by-side
Rich hover tooltips - Detailed statistics on hover
Proper statistics - Uses individual data points, not aggregated data
Seaborn-style - Familiar boxplot visualization
React compatible - Easy integration with React apps

Installation

npm install @nipunx1999/perspective-viewer-boxplot

Usage

Basic React Setup

import React, { useEffect, useRef } from 'react';
import perspective from '@finos/perspective';
import '@finos/perspective-viewer';
import '@finos/perspective-viewer-datagrid';
import '@finos/perspective-viewer-d3fc';

// Import the boxplot plugin
import '@nipunx1999/perspective-viewer-boxplot';

function MyComponent() {
  const viewerRef = useRef();

  useEffect(() => {
    const viewer = viewerRef.current;
    
    // Sample data with any categorical column names
    const data = [
      { region: 'North', revenue: 25.5, profit: 18.3 },
      { region: 'South', revenue: 32.1, profit: 24.7 },
      { region: 'East', revenue: 28.9, profit: 21.2 },
      // ... more data
    ];

    // Create table and load data
    const worker = perspective.worker();
    const table = worker.table(data);
    viewer.load(table);

    // Configure boxplot
    viewer.restore({
      plugin: 'boxplot',
      columns: ['region', 'revenue', 'profit'], // categorical + metrics
      // OR with explicit grouping:
      // group_by: ['region'],
      // columns: ['revenue', 'profit']
    });

  }, []);

  return <perspective-viewer ref={viewerRef} />;
}

Configuration Options

Automatic Grouping (Recommended)

// Plugin detects 'region' as categorical and uses it for x-axis
columns: ['region', 'revenue', 'profit']

Explicit Grouping

group_by: ['category_column'],
columns: ['revenue', 'profit']

Multiple Metrics

// Shows side-by-side boxplots for each metric
columns: ['department', 'sales', 'expenses', 'profit']

Data Format

The plugin works with any tabular data:

const data = [
  { 
    category: 'A',        // Any categorical column name
    sales: 25.5,          // Any numeric column name
    profit: 18.3,
    other_col: 'ignore'   // Non-selected columns are ignored
  },
  // ... more rows
];

Grouping Strategies

The plugin uses a smart 4-strategy approach:

  1. group_by config - Use Perspective's standard group_by
  2. Single categorical - Auto-detect if only one categorical column
  3. Multiple categorical - Warning + default to first one
  4. No categorical - Show metrics side-by-side

Features

Rich Hover Tooltips

Hover over any box to see:

  • Count, Min, Q1, Median, Q3, Max, Mean
  • Number of outliers
  • Group and metric names

Visual Feedback

  • Box highlighting on hover
  • Smooth animations
  • Color-coded legend for multiple metrics

Statistical Accuracy

  • Uses individual data points (not aggregated)
  • Proper quartile calculations
  • Outlier detection (1.5 × IQR rule)

Browser Support

  • Modern browsers with ES6 support
  • WebGL for optimal Perspective performance
  • D3.js is bundled - no need to install separately

Development

git clone https://github.com/nipunx1999/perspective-viewer-boxplot
cd perspective-viewer-boxplot
npm install
npm run build    # Production build
npm run dev      # Development with watch
npm run start    # Development server

License

Apache-2.0

Contributing

Issues and PRs welcome on GitHub!