Socket
Socket
Sign inDemoInstall

@fishawack/lab-d3

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fishawack/lab-d3 - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

package.json
{
"name": "@fishawack/lab-d3",
"version": "4.0.0",
"version": "4.0.1",
"description": "Abstract layer built on top of d3",

@@ -5,0 +5,0 @@ "scripts": {

@@ -319,6 +319,6 @@ "use strict";

select.classed('labD3__missing', !datum);
att.threshhold.instant && Shared.applyThreshholds(value, select, att);
att.threshhold.instant && Shared.applyThreshholds(value, select, att, datum);
return function (t) {
var value = parseFloat(i(t));
att.threshhold.instant || Shared.applyThreshholds(value, select, att);
att.threshhold.instant || Shared.applyThreshholds(value, select, att, datum);
local.dataLast.set(node, value);

@@ -325,0 +325,0 @@ node[att.value.html ? 'innerHTML' : 'textContent'] = Shared.valueFormat(value, _objectSpread(_objectSpread({}, d), datum?.properties), att);

@@ -29,9 +29,10 @@ "use strict";

var select = d3.select(this);
var value = data[0] && data[0].value || 0;
var d = data[0];
var value = d && d.value || 0;
var prev = local.dataLast.get(node) || 0;
var i = d3.interpolate(prev, value);
att.threshhold.instant && Shared.applyThreshholds(value, select, att);
att.threshhold.instant && Shared.applyThreshholds(value, select, att, d);
return function (t) {
var value = parseFloat(i(t));
att.threshhold.instant || Shared.applyThreshholds(value, select, att);
att.threshhold.instant || Shared.applyThreshholds(value, select, att, d);
local.dataLast.set(node, value);

@@ -38,0 +39,0 @@ node[att.value.html ? 'innerHTML' : 'textContent'] = Shared.valueFormat(value, data[0], att);

@@ -36,3 +36,4 @@ "use strict";

chart = local.chart;
var value = data[0] && data[0].value || 0;
var d = data[0];
var value = d && d.value || 0;
var split = value.toString().split('');

@@ -50,6 +51,6 @@ var leadingZeros = att.leadingZeros - split.length;

var i = d3.interpolate(prev, value);
att.threshhold.instant && Shared.applyThreshholds(value, select, att);
att.threshhold.instant && Shared.applyThreshholds(value, select, att, d);
return function (t) {
var value = parseFloat(i(t));
att.threshhold.instant || Shared.applyThreshholds(value, select, att);
att.threshhold.instant || Shared.applyThreshholds(value, select, att, d);
local.dataLast.set(node, value);

@@ -56,0 +57,0 @@ };

@@ -328,3 +328,9 @@ "use strict";

for (var i = 0; i < primaryIndex; i++) {
tempElement = tempElement.parentNode.parentNode;
var parentElement = tempElement.parentNode.parentNode;
// If parent element is svg then we're currently dealing with the outermost element so use ITS index
if (parentElement.tagName === 'svg') {
break;
}
tempElement = parentElement;
}

@@ -336,7 +342,7 @@ return tempElement.index;

},
applyThreshholds: function applyThreshholds(value, node, _ref) {
var _ref$threshhold = _ref.threshhold,
ratio = _ref$threshhold.ratio,
bounds = _ref$threshhold.bounds,
totalCount = _ref.totalCount;
applyThreshholds: function applyThreshholds(value, node, att, d) {
var _att$threshhold = att.threshhold,
ratio = _att$threshhold.ratio,
bounds = _att$threshhold.bounds,
totalCount = att.totalCount;
var normal = value / (ratio ? totalCount : 1);

@@ -346,8 +352,7 @@ var index = bounds.findIndex(function (d) {

});
node.classed(bounds.reduce(function (sum, b, i) {
return sum + "labD3__threshhold-".concat(i, " ");
}, ''), false);
index > -1 && node.classed("labD3__threshhold-".concat(index), true);
var prevColor = node.attr('class').split(':').slice(1);
node.classed(prevColor, false);
index > -1 && node.classed(' : ' + Shared.getKey(att, d, index, 'colors'), true);
}
};
export default Shared;

Sorry, the diff of this file is not supported yet

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