@fishawack/lab-d3
Advanced tools
Comparing version 2.5.1 to 2.6.0
{ | ||
"name": "@fishawack/lab-d3", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"description": "Abstract layer built on top of d3", | ||
@@ -5,0 +5,0 @@ "vars": { |
@@ -233,2 +233,6 @@ ## Background | ||
### 2.6.0 | ||
* Fixed bug in StackedBars so the animate correctly | ||
* Added pad feature to min/max linear scales | ||
### 2.5.1 | ||
@@ -235,0 +239,0 @@ * Fixed bug in Brush where it wouldn't parse date on first call |
@@ -513,7 +513,15 @@ "use strict"; | ||
} else if (att.scale[scale] === 'linear') { | ||
getLimit = function getLimit(minmax) { | ||
return att[minmax][scale] != null ? att[minmax][scale] : Shared.minmax(minmax, data, scale, att); | ||
}; | ||
var min = att.min[scale] != null ? att.min[scale] : Shared.minmax('min', data, scale, att); | ||
var max = att.max[scale] != null ? att.max[scale] : Shared.minmax('max', data, scale, att); | ||
var diff = max - min; | ||
local.scale[scale] = d3.scaleLinear().domain([getLimit('min'), getLimit('max')]); | ||
if (att.min.pad) { | ||
min -= diff * att.min.pad; | ||
} | ||
if (att.max.pad) { | ||
max += diff * att.max.pad; | ||
} | ||
local.scale[scale] = d3.scaleLinear().domain([min, max]); | ||
} else if (att.scale[scale] === 'group') { | ||
@@ -520,0 +528,0 @@ return; |
@@ -160,6 +160,8 @@ "use strict"; | ||
if (status === 'anim') { | ||
if (att.transitionSpeed) { | ||
// dataLast used to detect initial draw of this element, if so need to animate the bar after the previous bar has finished | ||
if (!local.dataLast.get(this) || att.stagger && att.transitionSpeed) { | ||
var delay = att.delaySpeed + _.index * att.stagger; | ||
delay += att.transitionSpeed * i; | ||
element.delay(delay); | ||
local.dataLast.set(this, true); | ||
} | ||
@@ -291,6 +293,8 @@ | ||
if (status === 'anim') { | ||
if (att.transitionSpeed) { | ||
// dataLast used to detect initial draw of this element, if so need to animate the bar after the previous bar has finished | ||
if (!local.dataLast.get(this) || att.stagger && att.transitionSpeed) { | ||
var delay = att.delaySpeed + _.index * att.stagger; | ||
delay += att.transitionSpeed * i; | ||
element.delay(delay); | ||
local.dataLast.set(this, true); | ||
} | ||
@@ -328,6 +332,8 @@ | ||
if (status === 'anim') { | ||
if (att.transitionSpeed) { | ||
// dataLast used to detect initial draw of this element, if so need to animate the bar after the previous bar has finished | ||
if (!local.dataLast.get(this) || att.stagger && att.transitionSpeed) { | ||
var delay = att.delaySpeed + _.index * att.stagger; | ||
delay += att.transitionSpeed * i; | ||
element.delay(delay); | ||
local.dataLast.set(this, true); | ||
} | ||
@@ -348,2 +354,3 @@ | ||
function minmax(element, d, i, status, name, _) { | ||
/* jshint ignore:start */ | ||
var minmax = name.split('--').pop(); | ||
@@ -357,6 +364,8 @@ var tempWidth = local.width * att.minmax; | ||
if (status === 'anim') { | ||
if (att.transitionSpeed) { | ||
// dataLast used to detect initial draw of this element, if so need to animate the bar after the previous bar has finished | ||
if (!local.dataLast.get(this) || att.stagger && att.transitionSpeed) { | ||
var delay = att.delaySpeed + _.index * att.stagger; | ||
delay += att.transitionSpeed * i; | ||
element.delay(delay); | ||
local.dataLast.set(this, true); | ||
} | ||
@@ -370,2 +379,4 @@ | ||
} | ||
/* jshint ignore:end */ | ||
} | ||
@@ -439,6 +450,7 @@ }; | ||
if (status === 'anim' && !levelIndex && i) { | ||
if (att.transitionSpeed) { | ||
var delay = att.delaySpeed; | ||
if (!local.dataLast.get(this) || att.stagger && att.transitionSpeed) { | ||
var delay = att.delaySpeed + att.stagger; | ||
delay += att.transitionSpeed * i; | ||
element.delay(delay); | ||
local.dataLast.set(this, true); | ||
} | ||
@@ -445,0 +457,0 @@ } |
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
561726
5435
554