@density/chart-count-graph
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -165,3 +165,3 @@ 'use strict'; | ||
var yAxis = d3.axisLeft(yScale).ticks(3).tickSizeOuter(0).tickSize(graphWidth); | ||
var yAxis = d3.axisLeft(yScale).ticks(largestCount - smallestCount < 5 ? 1 : 3).tickSizeOuter(0).tickFormat(d3.format('.0f')).tickSize(graphWidth); | ||
@@ -168,0 +168,0 @@ // Remove all axes that are already drawn |
@@ -266,4 +266,6 @@ 'use strict'; | ||
var currentCount = 0; | ||
this.interval = setInterval(function () { | ||
_this2.setState({ data: [].concat(_toConsumableArray(_this2.state.data), [{ count: Math.floor(Math.random() * 20), timestamp: (0, _moment2.default)().toISOString() }]) }); | ||
currentCount += Math.random() > 0.5 ? 1 : -1; | ||
_this2.setState({ data: [].concat(_toConsumableArray(_this2.state.data), [{ count: currentCount, timestamp: (0, _moment2.default)().toISOString() }]) }); | ||
}, 1000); | ||
@@ -270,0 +272,0 @@ } |
@@ -174,4 +174,5 @@ import './styles.scss'; | ||
const yAxis = d3.axisLeft(yScale) | ||
.ticks(3) | ||
.ticks(largestCount - smallestCount < 5 ? 1 : 3) | ||
.tickSizeOuter(0) | ||
.tickFormat(d3.format('.0f')) | ||
.tickSize(graphWidth); | ||
@@ -178,0 +179,0 @@ |
{ | ||
"name": "@density/chart-count-graph", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Count Graph chart", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -271,6 +271,8 @@ import * as React from 'react'; | ||
componentDidMount() { | ||
let currentCount = 0; | ||
this.interval = setInterval(() => { | ||
currentCount += Math.random() > 0.5 ? 1 : -1; | ||
this.setState({data: [ | ||
...this.state.data, | ||
{ count: Math.floor(Math.random() * 20), timestamp: moment().toISOString() } | ||
{ count: currentCount, timestamp: moment().toISOString() } | ||
]}); | ||
@@ -277,0 +279,0 @@ }, 1000); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
509412
1335
0