Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

carbon-addons-data-viz-react

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carbon-addons-data-viz-react - npm Package Compare versions

Comparing version 1.12.1 to 1.13.0

25

cjs/components/PieChart/PieChart.js

@@ -43,2 +43,6 @@ 'use strict';

var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -53,3 +57,4 @@

id: _propTypes2.default.string,
color: _propTypes2.default.array
color: _propTypes2.default.array,
onHover: _propTypes2.default.func
};

@@ -86,5 +91,12 @@

value: function componentWillReceiveProps(nextProps) {
this.renderSVG(nextProps);
if (!_lodash2.default.isEqual(this.props, nextProps)) {
this.renderSVG(nextProps);
}
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return !_lodash2.default.isEqual(this.props, nextProps);
}
}, {
key: 'renderSVG',

@@ -98,3 +110,4 @@ value: function renderSVG() {

formatFunction = _props.formatFunction,
id = _props.id;
id = _props.id,
onHover = _props.onHover;

@@ -123,5 +136,11 @@ var color = d3.scaleOrdinal(this.props.color);

d3.select('#' + id + ' .bx--pie-value').text('' + formatFunction(d.data[1]));
if (onHover) {
onHover(true, d.data[0]);
}
}).on('mouseout', function (d) {
d3.select('#' + id + ' .bx--pie-tooltip').style('display', 'none');
d3.select(this).transition().attr('d', path);
if (onHover) {
onHover(false);
}
});

@@ -128,0 +147,0 @@ }

@@ -10,2 +10,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';

import * as d3 from 'd3';
import _ from 'lodash';

@@ -17,3 +18,4 @@ var propTypes = {

id: PropTypes.string,
color: PropTypes.array
color: PropTypes.array,
onHover: PropTypes.func
};

@@ -51,5 +53,12 @@

value: function componentWillReceiveProps(nextProps) {
this.renderSVG(nextProps);
if (!_.isEqual(this.props, nextProps)) {
this.renderSVG(nextProps);
}
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
return !_.isEqual(this.props, nextProps);
}
}, {
key: 'renderSVG',

@@ -63,3 +72,4 @@ value: function renderSVG() {

formatFunction = _props.formatFunction,
id = _props.id;
id = _props.id,
onHover = _props.onHover;

@@ -88,5 +98,11 @@ var color = d3.scaleOrdinal(this.props.color);

d3.select('#' + id + ' .bx--pie-value').text('' + formatFunction(d.data[1]));
if (onHover) {
onHover(true, d.data[0]);
}
}).on('mouseout', function (d) {
d3.select('#' + id + ' .bx--pie-tooltip').style('display', 'none');
d3.select(this).transition().attr('d', path);
if (onHover) {
onHover(false);
}
});

@@ -93,0 +109,0 @@ }

2

package.json
{
"name": "carbon-addons-data-viz-react",
"version": "1.12.1",
"version": "1.13.0",
"description": "Carbon Data Visualization",

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