
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
React-dc is a wrapper around dc.js charts for React. Dc.js is an awesome library, but like many charting libraries, its API is imperative, meaning you have to select a DOM element by its id to transform it into a chart. The goal of this library is to make it very easy for you to create and use dc.js charts as React components.
npm install --save react-dc
An UMD build is available on unpkg:
<script src="https://unpkg.com/react-dc"></script>
Warning: You will also need React, which is a peer dependency of this library. The reasoning behind this is that you are probably already using React in your project, and don't want to end up with two versions of React in your final bundle. If you haven't already installed React, you can install it from npm with npm install --save react, or use a CDN version.
React-js comes with two versions: an UMD ES5 build, and an ES6 module version to allow for a better integration with your module bundler (like Webpack or Rollup), if you use one. Rollup has a great article on this topic on their wiki.
import {BarChart, PieChart, RowChart} from 'react-dc'
The library is available as a global variable: ReactDc
import React from 'react'
import d3 from 'd3'
import crossfilter from 'crossfilter'
import {BarChart} from 'react-dc'
const records = [{x: 0, y: 1}, {x: 1, y: 3}, {x: 2, y: 5}, {x: 3, y: 1}, {x: 4, y: 2}]
const data = crossfilter(records)
const dimension = data.dimension(record => record.x)
const group = dimenion.group().reduceSum(record => record.y)
export default () => <BarChart dimension={dimension} group={group} x={d3.scale.linear().domain([0, 5])} />
When using Webpack, you might see the following error in your console Module not found: Error: Can't resolve 'crossfilter' or Uncaught Error: Cannot find module "crossfilter". This issue is not a problem with react-dc itself. This is due to dc.js' use of a library called crossfilter2, which is a fork of crossfilter. See this issue for more information. It can be fixed using Webpack's resolve feature:
{
resolve: {
alias: {
'crossfilter': 'crossfilter2'
}
}
}
Is React-dc production ready ?
Not yet. This library is still being actively developed, and needs to be thoroughly tested before being production-ready. However, you can use it for a personal project. If you encounter any bug, please open an issue.
FAQs
React bindings for dc.js charts
The npm package react-dc receives a total of 28 weekly downloads. As such, react-dc popularity was classified as not popular.
We found that react-dc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.