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

editorjs-chartjs

v1.0.2

Published

A Chart.js integration block

Readme

Editor.js Chart Tool

A Chart.js integration plugin for Editor.js that allows you to create charts right in the editor.

Features

  • 6 Chart Types: Bar, Line, Pie, Doughnut, Radar, and Polar Area charts
  • Tune Menu Integration: Chart type switching using Editor.js built-in tune menu
  • Full Editability: Edit labels, data values, titles, and colors in real-time
  • Color Picker: Choose from 12 preset colors for your charts
  • Multiple Datasets: Support for multiple data sets
  • Responsive: Charts automatically adjust to container size

Installation

npm install editorjs-chartjs chart.js

Usage

Basic Setup

import EditorJS from '@editorjs/editorjs';
import ChartTool from 'editorjs-chartjs';

const editor = new EditorJS({
	holder: 'editorjs',
	tools: {
		chart: {
			class: ChartTool,
		},
	},
});

With Initial Data

const editor = new EditorJS({
	holder: 'editorjs',
	tools: {
		chart: ChartTool,
	},
	data: {
		blocks: [
			{
				type: 'chart',
				data: {
					type: 'bar',
					title: 'Monthly Revenue',
					labels: ['Jan', 'Feb', 'Mar', 'Apr'],
					datasets: [
						{
							label: 'Sales',
							data: [12000, 19000, 15000, 25000],
							backgroundColor: '#4A90E2',
						},
					],
				},
			},
		],
	},
});

Development

Setup

npm install

Start Dev Server

npm run dev

This will start a Vite dev server at http://localhost:5173 with a live demo of the chart tool.

Build

npm run build

The built files will be in the dist/ directory.

Data Structure

The plugin saves data in the following format:

{
  type: 'bar',           // Chart type
  title: 'Chart Title',  // Optional chart title
  labels: ['A', 'B'],    // X-axis labels
  datasets: [
    {
      label: 'Dataset 1',        // Dataset name
      data: [10, 20],            // Values
      backgroundColor: '#4A90E2' // Color
    }
  ]
}

Customization

Available Colors

The plugin comes with 12 preset colors:

  • Blue (#4A90E2)
  • Green (#50C878)
  • Red (#FF6B6B)
  • Yellow (#FFD93D)
  • Purple (#A29BFE)
  • Pink (#FD79A8)
  • Orange (#FDCB6E)
  • Teal (#00B894)
  • Indigo (#6C5CE7)
  • Coral (#E17055)
  • Sky Blue (#74B9FF)
  • Mint (#55EFC4)

Styling

You can customize the appearance by overriding the CSS classes:

.chart-tool {
	/* Main wrapper */
}

.chart-tool__canvas-wrapper {
	/* Chart canvas container */
}

.chart-tool__settings {
	/* Settings panel */
}

Credits

Built with: