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 🙏

© 2024 – Pkg Stats / Ryan Hefner

csv-chart-generator

v1.0.5

Published

A tool for visualizing data from CSV files as line charts and converting the charts to a PDF document.

Downloads

4

Readme

CSV Data Visualization and PDF Conversion

This npm module is a tool for visualizing data from CSV files as line charts and converting the charts to a PDF document. The CSV data is expected to contain one time column and three columns of numerical values representing the x, y, and z coordinates. The program reads the CSV data, generates line charts for each coordinate using the Chart.js library, and combines the charts into a single PDF document.

Getting Started

These instructions will help you get started with using the CSV Chart Generator in your own project.

Prerequisites

To use this module, you will need to have Node.js and npm installed on your machine. You can check if you have these tools installed by running the following commands in the terminal:

node -v
npm -v

If you do not have Node.js and npm installed, you can download and install them from the official website (https://nodejs.org/).

Installing

To install the CSV Chart Generator, run the following command in your terminal:

npm install csv-chart-generator

Usage

To use the CSV Chart Generator, follow these steps:

  1. Provide a folder containing CSV files with the data you want to visualize. The CSV files should have the following format:
time,x,y,z
<miliseconds>,<numeric value>,<numeric value>,<numeric value>
<miliseconds>,<numeric value>,<numeric value>,<numeric value>
...

The first row should not contain the column names, rows should contain the data values. The time column should contain the time data in number of milliseconds since January 1, 1970. x, y, and z columns should contain numerical values. 2. In your Node.js app, require the CSV Chart Generator module and call the generatePDF function, passing in the path to the folder containing your CSV files:

In your Node.js app, require the CSV Chart Generator module and call the generatePDF function, passing in the path to the folder containing your CSV files:

  1. Run your Node.js app to generate the PDF document:
node app.js

The PDF document will be saved to a file named output.pdf in the project root directory. The PDF will have as many pages as there are CSV files in the specified folder.

Example

Here's an example of how to use the CSV Chart Generator in a Node.js app via providing the folder path on the console:

// app.js

const data = require('csv-chart-generator');

const arguments = process.argv;
const folderPath = arguments[2].toString();

data.generatePDF(folderPath);

To run the example, open a terminal and navigate to the directory containing app.js. Then, run the following command:

node app.js <pathToFolder>

Replace with the path to the folder containing your CSV files. The PDF document will be generated and saved to a file named output.pdf in the project root directory.