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

plot

v1.0.22

Published

The simplest plotting API for JavaScript and TypeScript.

Downloads

1,030

Readme

plot

The simplest and most forgiving plotting API for JavaScript and TypeScript.

Use plot to quickly and conveniently render charts for your data. It is an abstraction layer over JavaScript visualization libraries. Currently supporting Apex Charts, but intending to support more in the future.

Click here for the API docs

For various examples see this repo.

Plot can be used from Node.js, from the browser and is specially designed to integrate with Data-Forge Notebook.

I'm after contributors to help flesh this library out! Can you help?

Please give feedback!

Email the author on [email protected].

Click here to support the developer.

Aims

  • To have a simple way to plot a chart.
  • To be an abstraction over multiple code libraries for visualization in JavaScript.
  • To have a plotting library that works well in Node.js, the browser and in Data-Forge Notebook.
  • To be able to define charts purely as data using a simple JSON format.
  • To be able to serialize a chart to send it over the wire or save it to disk.
  • To be able to separate chart configuration and chart data to make it easy to reuse the charts you create.

Usage

Some instructions for using plot. These instructions are for JavaScript, but this library also works in TypeScript.

Import plot

Browser

npm install --save plot @plotex/render-dom
const { plot } = require("plot");
require("@plotex/render-dom");

const data = [ /* your data */ ];
const parentEl = /* parent DOM to contain the chart */ ;
const chart = plot(data).renderDOM(parentEl);

Node.js

npm install --save plot @plotex/render-image
const { plot } = require("plot");
require("@plotex/render-image");

const data = [ /* your data */ ];
plot(data).renderImage("my-chart.png");

Data-Forge Notebook

plot is integrated into Data-Forge Notebook.

You can plot an array of JavaScript data like this:

const data = [ /* your data */ ];
display.plot(data);

See more Data-Forge Notebook examples in the exported example visualization notebook.

Pass in configuration options

const data = [ /* your data */ ];
const chartConfig = { chartType: "bar" };
const axisConfig = { x: "Date", y: "Close" };
plot(data, chartConfig, axisConfig)
    .renderDOM(parentEl);

Multiple types of data

Plot an array of numbers

plot([10, 15, 30])
    .renderDOM(parentEl);

Plot an array of JavaScirpt object

plot([ { A: 10, B: 52 }, { A: 15, B: 37 }, A: 30, B: 45 }])
    .renderDOM(parentEl);

Plot by column

plot({ A: [10, 15, 30], B: [52, 37, 45] })
    .renderDOM(parentEl);

Resources

Future

There's more work to be done!

Can you contribute, test or give feedback?

Email the developer on [email protected].

Support the developer

Click here to support the developer.