New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

barchart

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

barchart - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

19

index.js

@@ -66,3 +66,3 @@ //TODO unit tests

BarChart.prototype.data = function(data, dataIdKey) {
BarChart.prototype.data = function(data) {
if (!_.isArray(data)) {

@@ -72,5 +72,2 @@ console.warn('Data should be an array.');

}
if (typeof dataIdKey !== 'undefined') {
this.dataIdKey = dataIdKey;
}

@@ -170,3 +167,3 @@ if (!_.isArray(data[0])) {

var heightScale = d3.scale[this.heightScaleType]()
.domain([1, this._maximum - this._minimum + 1])
.domain([1, this.maximum - this.minimum + 1])
.range([this.minBarSize, this.maxBarSize]);

@@ -176,6 +173,6 @@

//shift domain to [1, max - min + 1] so it plays-nice with log, etc.
return heightScale(val + 1 - chart._minimum);
return heightScale(val + 1 - chart.minimum);
};
this.heightScale.invert = function(val) {
return heightScale.invert(val) + chart._minimum - 1;
return heightScale.invert(val) + chart.minimum - 1;
};

@@ -292,5 +289,5 @@

.attr('x', byIndex(this.xScale))
.attr('y', this.yScale(this._minimum))
.attr('y', this.yScale(this.minimum))
.attr('width', this.hasRendered ? '0' : this.barWidth)
.attr('height', this.heightScale(this._minimum))
.attr('height', this.heightScale(this.minimum))
.style('opacity', this.hasRendered ? '0' : '1')

@@ -312,3 +309,3 @@ .style('fill', byDatasetIndex(this.barColors, this.numDatasets));

.style('color', byDatasetIndex(this.labelTopColors, this.numDatasets))
.style('top', this.labelTopYScale(this._minimum, this) + 'px')
.style('top', px(_.partial(this.labelTopYScale, this.minimum)))
.style('left', px(byIndex(this.xScale)))

@@ -344,3 +341,3 @@ .style('width', this.hasRendered ? '0' : this.barWidth + 'px')

.style('width', '100%')
.text(this._minimum);
.text(this.minimum);
}

@@ -347,0 +344,0 @@

{
"name": "barchart",
"version": "0.5.1",
"version": "0.5.2",
"description": "make some barcharts",

@@ -5,0 +5,0 @@ "main": "index.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