@fishawack/lab-d3
Advanced tools
Comparing version 2.2.4 to 2.3.0
{ | ||
"name": "@fishawack/lab-d3", | ||
"version": "2.2.4", | ||
"version": "2.3.0", | ||
"description": "Abstract layer built on top of d3", | ||
@@ -34,3 +34,3 @@ "vars": { | ||
"@babel/preset-env": "7.3.1", | ||
"@fishawack/config-grunt": "4.4.5", | ||
"@fishawack/config-grunt": "4.5.0", | ||
"@fishawack/lab-ui": "9.0.4", | ||
@@ -37,0 +37,0 @@ "breakpoint-sass": "2.7.1", |
@@ -232,2 +232,7 @@ ## Background | ||
### v2.3.0 | ||
* BarStacked now handles labels differently, the lowest level label sits on the bar instead of underneath | ||
* Added padding to BarStacked width on labels so they don't go right to bounds | ||
* If level is hidden no longer contributes to height calculation | ||
### v2.2.4 | ||
@@ -234,0 +239,0 @@ * Harvey ball reset bug fix |
@@ -265,3 +265,3 @@ "use strict"; | ||
if (!tempBiggest) { | ||
if (!tempBiggest || att.hide['level' + levelIndex]) { | ||
local.levelHeight[levelIndex] = 0; | ||
@@ -268,0 +268,0 @@ } else if (att.axis[local.pA[0]].rotate) { |
@@ -441,2 +441,4 @@ "use strict"; | ||
if (local.pX) { | ||
var width = local.levelWidth[levelIndex] - local.padding.space * 2; | ||
if (att.axis.x.rotate) { | ||
@@ -447,7 +449,7 @@ x -= local.textHeight * 0.5; | ||
if (att.axis.x.flip) { | ||
y += Shared.textHeight(chart, label, local.levelWidth[levelIndex]); | ||
y += Shared.textHeight(chart, label, width); | ||
} | ||
if (status === 'enter' || status === 'update') { | ||
element.call(Shared.wrap, local.levelWidth[levelIndex]); | ||
element.call(Shared.wrap, width); | ||
} | ||
@@ -462,6 +464,6 @@ } | ||
if (!levelIndex && i) { | ||
if (!levelIndex) { | ||
y = local.scale[local.pA[1]](d.accumulated); | ||
y -= Shared.textHeight(chart, label, width); | ||
y -= local.padding.space; | ||
element.attr('dy', '0em'); | ||
} | ||
@@ -473,2 +475,4 @@ | ||
} else { | ||
var _width = local.levelWidth[levelIndex]; | ||
if (att.axis.y.rotate) { | ||
@@ -478,6 +482,7 @@ x -= local.textHeight * 0.5; | ||
} else { | ||
y += Shared.textHeight(chart, label, local.levelWidth[levelIndex]); | ||
y += Shared.textHeight(chart, label, _width); | ||
if (status === 'enter' || status === 'update') { | ||
element.call(Shared.wrap, local.levelWidth[levelIndex]); | ||
// Wrap if text is longer than the width misus padding on either side | ||
element.call(Shared.wrap, _width); | ||
} | ||
@@ -492,3 +497,3 @@ } | ||
if (!levelIndex && i) { | ||
if (!levelIndex) { | ||
y = local.scale[local.pA[1]](d.accumulated); | ||
@@ -573,6 +578,6 @@ y -= local.padding.space; | ||
} | ||
} // Dont add spacing if height 0 | ||
} // Dont add spacing if height 0 / if the level is hidden / if the levelIndex is 0 because this on barstacked is moved onto the bar itself not underneath | ||
if (!tempBiggest) { | ||
if (!tempBiggest || att.hide['level' + levelIndex] || !levelIndex) { | ||
local.levelHeight[levelIndex] = 0; | ||
@@ -579,0 +584,0 @@ } else if (att.axis[local.pA[0]].rotate) { |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -5,0 +5,0 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
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
559070
5388
535