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

chartme

v0.0.13

Published

Turn an image into a chart.

Readme

ChartMe: Image to chart generation.

ChartMe is a TypeScript library designed to take in an image and turn it into a chart while also providing customization options.

Features

  • Recoloring images using proximity to color.
  • Filtering a processed image to filter for outliers.
  • Saving and loading preprocessed graph data.
  • Recoloring following same colored segments.

Related Links

  • GitHub: https://github.com/CasFre4/EIA-bulk
  • npm: https://www.npmjs.com/package/chartme

Installation

You can install the chartme package using npm:

npm install chartme

Getting Started

1. Imports

import ChartMe from 'chartme'
import {Jimp} from 'jimp'

2. Saving a model

const image = await Jimp.read(imagePath)
const chart = await new ChartMe({image: image, colorBundle: [
    {tcolor: [0,0,0,255], fcolor: 'green'},
    {tcolor: [50,50,50,255], fcolor: 'yellow'},
    {tcolor: [100, 100, 100, 255], fcolor: 'red'},
    {tcolor: [150,150,150,255], fcolor: 'black'}],
    height: image.height/20, width: image.width/20})
    .load()//height and width define image resizing.
chart.cleanData()
chart.splitColors({splits: 3})
chart.preprocess()
chart.saveFile('./data.json')

Example Chart

3. Displaying graph

With saved file and React

const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
    const run = async () => {
        if (!containerRef.current) return
        const chart = new ChartMe({})
        await chart.loadFile('./data.json')
        chart.graph({container: containerRef.current, height: 190, width: 120})//height and width define size of chart
    }
    run();
}, []);

Without save file and using getElementById

const image = await Jimp.read(imagePath)
const chart = await new ChartMe({image: image, colorBundle: [
    {tcolor: [0,0,0,255], fcolor: 'purple'},
    {tcolor: [100,100,100,255], fcolor: 'red'},
    {tcolor: [150, 150, 150, 255], fcolor: 'yellow'}],
    height: image.height/20, width: image.width/20})
    .load()
chart.cleanData()
chart.splitColors({splits: 3})
chart.preprocess()
const container = document.getElementById('my_dataviz')
if (container && container instanceof HTMLDivElement) {
    chart.graph({container: container, height: 190, width: 120})
}

Example Chart

4. With color splitting

const image = await Jimp.read(imagePath)
const chart = await new ChartMe({image: image, colorBundle: [
    {tcolor: [0,0,0,255], fcolor: 'green'},
    {tcolor: [50,50,50,255], fcolor: 'yellow'},
    {tcolor: [100, 100, 100, 255], fcolor: 'red'},
    {tcolor: [150, 150, 150, 255], fcolor: "black"}]})
    .load()
chart.cleanData()
chart.splitColors({splits: 4, colorBundle:
  [{tcolor: [0,0,0,255], fcolor: 'lime'},
  {tcolor: [50,50,50,255], fcolor: 'grey'},
  {tcolor: [150, 150, 150, 255], fcolor: 'blue'},
  {tcolor: [100,100,100,255], fcolor: 'magenta'}]})
chart.preprocess()
const container = document.getElementById('my_dataviz')
if (container && container instanceof HTMLDivElement) {
    chart.graph({container: containerRef.current, height: 190, width: 120})
}

Example Chart

5. Full example

Starting image

Example Chart

Edit image

Switching to an image with an alpha channel and removing parts of the image that you don't want on your chart will facilitate the process. Example Chart

Image processing and chart generation

const editproportion = 1/2
image.flip({horizontal: true})//Flip since charts only face right.
const chart = await new ChartMe({image: image, colorBundle: 
  [{tcolor: [50,51,50,255], fcolor: 'grey'},
  {tcolor: [33,28,25,255], fcolor: 'black'},
  {tcolor: [85,24,24,255], fcolor: 'red'},
  {tcolor: [100, 100, 100, 255], fcolor: 'yellow'},
  {tcolor: [150, 150, 150, 255], fcolor: 'blue'},
  ], height: image.height * newprop, width: image.width * newprop}).load()
chart.cleanData()
chart.splitColors({splits: 5})
chart.preprocess()

Final Chart

Example Chart

Limitations

  • Images may look better with some minimal external image editing.
  • Graphing options are currently limited.
  • Works best with images that have distinct color changes.