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

data-visualizer-library

v1.0.0

Published

A simple JavaScript library for creating various charts with Chart.js and Papa Parse.

Readme

#data-visualization-library A lightweight JavaScript library to easily create and display various types of charts (bar, line, doughnut, polar area) from manually entered data or CSV file uploads.

Features Supports Multiple Chart Types: Visualize your data as bar, line, doughnut, or polar area charts. Manual Data Input: Quickly generate charts from comma-separated numerical data and labels. CSV Import: Upload CSV files to visualize your data, with automatic header detection for axis labels. Easy to Use: A straightforward API to integrate charting into your web projects. How to Use Include the Library: Add the following script tags to your HTML file, preferably at the end of the section:

HTML

(Replace path/to/your/data-visualizer.js with the actual path where you save your library file.)

Prepare your HTML: You'll need a element where the chart will be drawn.

HTML

Create a Chart: In your JavaScript, get the canvas context and use DataVisualizer.createChart():

JavaScript

document.addEventListener('DOMContentLoaded', () => { const ctx = document.getElementById('myChart').getContext('2d');

// Example: Create a Bar Chart with manual data DataVisualizer.createChart( ctx, 'bar', ['Jan', 'Feb', 'Mar', 'Apr', 'May'], // Labels [100, 150, 80, 200, 120], // Data Values ['Month', 'Sales'] // Header Labels (for axis titles) );

// You can also clear the chart if needed // DataVisualizer.clearGraph(myChartInstance, dataInput, labelInput, fileInput); }); Parse CSV Data: To visualize data from a CSV file, use DataVisualizer.parseCSV():

JavaScript

document.addEventListener('DOMContentLoaded', () => { const ctx = document.getElementById('myChart').getContext('2d'); const fileInput = document.getElementById('fileInput'); // Assuming you have an input type="file"

fileInput.addEventListener('change', (event) => { const file = event.target.files[0]; if (file) { DataVisualizer.parseCSV(file, (labels, dataValues, headerLabels) => { DataVisualizer.createChart(ctx, 'line', labels, dataValues, headerLabels); }); } }); }); API Reference DataVisualizer.createChart(ctx, chartType, labels, dataValues, headerLabels)

ctx (CanvasRenderingContext2D): The 2D rendering context of the element. chartType (string): The type of chart ('bar', 'line', 'doughnut', 'polarArea'). labels (string[]): An array of labels for the data points. dataValues (number[]): An array of numerical data values. headerLabels (string[]): An array [xAxisLabel, yAxisLabel] for axis titles (optional, primarily for bar/line charts). DataVisualizer.parseCSV(file, callback)

file (File): The CSV file object from an . callback (function): A function that receives (labels, dataValues, headerLabels) once the CSV is parsed. DataVisualizer.clearGraph(chartInstance, dataInput, labelInput, fileInput)

chartInstance (Chart): The Chart.js instance to destroy. dataInput (HTMLInputElement): Reference to your data input field (for clearing). labelInput (HTMLInputElement): Reference to your label input field (for clearing). fileInput (HTMLInputElement): Reference to your file input field (for clearing). Dependencies This library relies on:

Chart.js for chart rendering. Papa Parse for CSV parsing. Make sure these libraries are included in your project before data-visualizer.js.

License MIT License

data-visualization-library

A lightweight JavaScript library to easily create and display various types of charts (bar, line, doughnut, polar area) from manually entered data or CSV file uploads.

Features Supports Multiple Chart Types: Visualize your data as bar, line, doughnut, or polar area charts. Manual Data Input: Quickly generate charts from comma-separated numerical data and labels. CSV Import: Upload CSV files to visualize your data, with automatic header detection for axis labels. Easy to Use: A straightforward API to integrate charting into your web projects. How to Use Include the Library: Add the following script tags to your HTML file, preferably at the end of the section:

HTML

(Replace path/to/your/data-visualizer.js with the actual path where you save your library file.)

Prepare your HTML: You'll need a element where the chart will be drawn.

HTML

Create a Chart: In your JavaScript, get the canvas context and use DataVisualizer.createChart():

JavaScript

document.addEventListener('DOMContentLoaded', () => { const ctx = document.getElementById('myChart').getContext('2d');

// Example: Create a Bar Chart with manual data
DataVisualizer.createChart(
    ctx,
    'bar',
    ['Jan', 'Feb', 'Mar', 'Apr', 'May'], // Labels
    [100, 150, 80, 200, 120],            // Data Values
    ['Month', 'Sales']                   // Header Labels (for axis titles)
);

// You can also clear the chart if needed
// DataVisualizer.clearGraph(myChartInstance, dataInput, labelInput, fileInput);

}); Parse CSV Data: To visualize data from a CSV file, use DataVisualizer.parseCSV():

JavaScript

document.addEventListener('DOMContentLoaded', () => { const ctx = document.getElementById('myChart').getContext('2d'); const fileInput = document.getElementById('fileInput'); // Assuming you have an input type="file"

fileInput.addEventListener('change', (event) => {
    const file = event.target.files[0];
    if (file) {
        DataVisualizer.parseCSV(file, (labels, dataValues, headerLabels) => {
            DataVisualizer.createChart(ctx, 'line', labels, dataValues, headerLabels);
        });
    }
});

}); API Reference DataVisualizer.createChart(ctx, chartType, labels, dataValues, headerLabels)

ctx (CanvasRenderingContext2D): The 2D rendering context of the element. chartType (string): The type of chart ('bar', 'line', 'doughnut', 'polarArea'). labels (string[]): An array of labels for the data points. dataValues (number[]): An array of numerical data values. headerLabels (string[]): An array [xAxisLabel, yAxisLabel] for axis titles (optional, primarily for bar/line charts). DataVisualizer.parseCSV(file, callback)

file (File): The CSV file object from an . callback (function): A function that receives (labels, dataValues, headerLabels) once the CSV is parsed. DataVisualizer.clearGraph(chartInstance, dataInput, labelInput, fileInput)

chartInstance (Chart): The Chart.js instance to destroy. dataInput (HTMLInputElement): Reference to your data input field (for clearing). labelInput (HTMLInputElement): Reference to your label input field (for clearing). fileInput (HTMLInputElement): Reference to your file input field (for clearing). Dependencies This library relies on:

Chart.js for chart rendering. Papa Parse for CSV parsing. Make sure these libraries are included in your project before data-visualizer.js.

License MIT License

b822b45ab132dc609ae887caafaea4b71f27d51b