Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chartogram

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartogram - npm Package Compare versions

Comparing version 0.1.20 to 0.1.21

bundle/chartogram-react.js

4

package.json
{
"name": "chartogram",
"version": "0.1.20",
"version": "0.1.21",
"description": "Charts in JS with no dependencies",

@@ -30,3 +30,3 @@ "main": "index.commonjs.js",

"rimraf": "^2.5.0",
"rollup": "^1.2.3",
"rollup": "^1.9.0",
"rollup-plugin-terser": "^4.0.4"

@@ -33,0 +33,0 @@ },

@@ -5,2 +5,4 @@ # chartogram

Also includes a [React](#react) component for those who're using React.
[DEMO](https://catamphetamine.github.io/chartogram)

@@ -43,2 +45,3 @@

name: string,
color: string,
points: Number[]

@@ -66,2 +69,3 @@ }[]

name: 'Temperature',
color: '#cc0000',
points: [

@@ -76,2 +80,3 @@ 60,

name: 'CPU load',
color: '#00aa00',
points: [

@@ -118,34 +123,13 @@ 95,

import React from 'react'
import PropTypes from 'prop-types'
import chartogram from 'chartogram'
import Chartogram from 'chartogram/react'
import 'chartogram/style.css'
class Chartogram extends React.Component {
static propTypes = {
data: PropTypes.shape({
x: PropTypes.shape({
points: PropTypes.arrayOf(PropTypes.number).isRequired
}).isRequired,
y: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
points: PropTypes.arrayOf(PropTypes.number).isRequired
})).isRequired
}).isRequired,
title: PropTypes.string.isRequired
}
node = React.createRef()
componentDidMount() {
const { data, title } = this.props
this.cleanUp = chartogram(this.node.current, data, title)
}
componentWillUnmount() {
this.cleanUp
}
export default class Page extends React.Component {
render() {
return <section ref={this.node}/>
return (
<Chartogram
data={data}
title={title}
options={options}/>
)
}

@@ -215,2 +199,2 @@ }

* [`Math.log10`](https://babeljs.io/docs/en/babel-polyfill)
* [`classList`](https://github.com/eligrey/classList.js/)
* [`classList`](https://github.com/eligrey/classList.js/)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc