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

react-d3-dash

v0.1.2

Published

React-d3-dash is a library for building dashboard to visualize your data using ReactJS and D3.

Readme

react-d3-dash

React-d3-dash is a library for building dashboard to visualize your data using ReactJS and D3.

preview

React-d3-dash provides UI components out of the box to visualize various data-types but allows to extend more chart invididual chart types using D3.

Features

  • Grid based layout
  • Add/Remove Charts
  • Drag and drop widget re-ordering
  • Changing Chart Types
  • Interactive Charts

Installation

npm install react-d3-dash

Use

import Dashboard from 'react-d3-dash';
import {React} from 'react';
import {ReactDOM} from 'react-dom';

var dataset1={
	name: "my_dataset_1",
	type: "Dataset"
	data: [
		{
		name: "logged_var_arr1",
		type: "Array",
		data:[
			{t:1, id:1, value:12},
			{t:2, id:2, value:15},
			{t:5, id:3, value:18}
			...
			]
		},
		{
		name: "logged_arr_2",
		type: "Array",
		data:[
			{t:2, id:3, value:12},
			{t:2, id:3, value:14},
			...
			]
		}
	]
}	
		
var dataset2={
	...
}

ReactDOM.render(<Dashboard datasets={[dataset1, dataset2]}/>, document.getElementById('container'));

Dashboard only accepts an array of datasets, where each dataset can contain other datasets. Each dataset must be an object with the fields name (String) type (String) and data (Array). Each data-item specifies the type of the data (e.g. Array, Variable, Dataset) and the array of data items (e.g. list of objects of the form {t, id, value}). All Datasets and Data items are displayed in a tree view and can be selected for visualization if an appropriate Chart type exists.

Documentation

Adding new Chart types

The Dashboard can be used with the provided basic chart types (Line-chart, Bar-chart, Pie-chart, etc.) but can be easily extended for more types.

Every new Chart must inherit from D3Chart. It defines a React Wrapper for D3 Charts and handles the rendering. The Child class must override

renderD3(svg,dataset,selector,width,height,padding){}

and implement the d3 Code for initializing and updating the chart. Selector defines a filter function for selecting the data to be displayed of the whole dataset. This should be done by calling

var selected_data=dataset.data.filter(selector)

Every Child class must also override the method

accepts(type){
	if(type==="some particular type"){
		return true;
	}elseif type==="some other type"){
		return true;
	}

	return false;
}

which receives the type of a dataset and returns whether it can display this datatype. This is important for selecting dynamically between different Chart-types for the same dataset.

Afterwards the Map chartTypes in src/Components/Charts/ChartTypes.js has to be extended

...
chartTypes.set("My New Chart-type",MyChart);
...

TODO List

  • [ ] Histogram Chart
  • [ ] Graph Chart
  • [ ] Select multiple variables to be displayed in the same chart
  • [ ] Global Color-Theme selector for the dashboard
  • [ ] Adding more Data-Selectors (Interval-selection, etc.)