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

react-sparklines

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-sparklines - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

2

package.json
{
"name": "react-sparklines",
"version": "0.5.1",
"version": "0.5.2",
"description": "Beautiful and expressive Sparklines React component",

@@ -5,0 +5,0 @@ "main": "index.js",

export default class DataProcessor {
static dataToPoints(data) {
static dataToPoints(data, width, height) {
let width = 300;
let height = 150;
let max = Math.max.apply(Math, data);

@@ -9,0 +6,0 @@ let min = Math.min.apply(Math, data);

@@ -20,3 +20,3 @@ import React from 'react';

let { data, limit } = this.props;
let { width, height, data, limit } = this.props;

@@ -31,3 +31,3 @@ if (!data || data.length === 0) {

let points = DataProcessor.dataToPoints(data);
let points = DataProcessor.dataToPoints(data, width, height);

@@ -64,3 +64,3 @@ let sparklinesBars = !this.props.bars ? {} :

return (
<svg preserveAspectRatio="xMinYMin meet">
<svg width={width} height={height} preserveAspectRatio="xMinYMin meet">
{sparklinesBars}

@@ -74,2 +74,4 @@ {sparklinesGroup}

Sparklines.propTypes = {
width: React.PropTypes.number,
height: React.PropTypes.number,
data: React.PropTypes.array,

@@ -84,2 +86,4 @@ limit: React.PropTypes.number,

Sparklines.defaultProps = {
width: 120,
height: 40,
limit: 100,

@@ -86,0 +90,0 @@ color: 'black',

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