Comparing version 0.34.0-1 to 0.35.0
@@ -9,12 +9,84 @@ 'use strict'; | ||
var React__default = _interopDefault(React); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var compose = _interopDefault(require('recompose/compose')); | ||
var withPropsOnChange = _interopDefault(require('recompose/withPropsOnChange')); | ||
var pure = _interopDefault(require('recompose/pure')); | ||
var core = require('@nivo/core'); | ||
var reactMotion = require('react-motion'); | ||
var d3Shape = require('d3-shape'); | ||
var reactMotion = require('react-motion'); | ||
var core = require('@nivo/core'); | ||
require('lodash'); | ||
var legends = require('@nivo/legends'); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
require('lodash'); | ||
var compose = _interopDefault(require('recompose/compose')); | ||
var defaultProps = _interopDefault(require('recompose/defaultProps')); | ||
var pure = _interopDefault(require('recompose/pure')); | ||
var PieSlice = function PieSlice(_ref) { | ||
var data = _ref.data, | ||
path = _ref.path, | ||
color = _ref.color, | ||
fill = _ref.fill, | ||
borderWidth = _ref.borderWidth, | ||
borderColor = _ref.borderColor, | ||
showTooltip = _ref.showTooltip, | ||
hideTooltip = _ref.hideTooltip, | ||
onClick = _ref.onClick, | ||
tooltipFormat = _ref.tooltipFormat, | ||
theme = _ref.theme; | ||
var handleTooltip = function handleTooltip(e) { | ||
return showTooltip(React__default.createElement(core.BasicTooltip, { | ||
id: data.label, | ||
value: data.value, | ||
enableChip: true, | ||
color: color, | ||
theme: theme, | ||
format: tooltipFormat | ||
}), e); | ||
}; | ||
return React__default.createElement('path', { | ||
key: data.id, | ||
d: path, | ||
fill: fill, | ||
strokeWidth: borderWidth, | ||
stroke: borderColor, | ||
onMouseEnter: handleTooltip, | ||
onMouseMove: handleTooltip, | ||
onMouseLeave: hideTooltip, | ||
onClick: onClick | ||
}); | ||
}; | ||
PieSlice.propTypes = { | ||
data: PropTypes.shape({ | ||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, | ||
value: PropTypes.number.isRequired | ||
}).isRequired, | ||
path: PropTypes.string.isRequired, | ||
color: PropTypes.string.isRequired, | ||
fill: PropTypes.string.isRequired, | ||
borderWidth: PropTypes.number.isRequired, | ||
borderColor: PropTypes.string.isRequired, | ||
tooltipFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
showTooltip: PropTypes.func.isRequired, | ||
hideTooltip: PropTypes.func.isRequired, | ||
onClick: PropTypes.func, | ||
theme: PropTypes.shape({ | ||
tooltip: PropTypes.shape({}).isRequired | ||
}).isRequired | ||
}; | ||
var enhance = compose(withPropsOnChange(['data', 'onClick'], function (_ref2) { | ||
var data = _ref2.data, | ||
_onClick = _ref2.onClick; | ||
return { | ||
onClick: function onClick(event) { | ||
return _onClick(data, event); | ||
} | ||
}; | ||
}), pure); | ||
var PieSlice$1 = enhance(PieSlice); | ||
var classCallCheck = function (instance, Constructor) { | ||
@@ -84,10 +156,2 @@ if (!(instance instanceof Constructor)) { | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var lineGenerator = d3Shape.line().x(function (d) { | ||
@@ -211,10 +275,2 @@ return d.x; | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var sliceStyle = { | ||
@@ -297,10 +353,2 @@ pointerEvents: 'none' | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var PiePropTypes = { | ||
@@ -350,2 +398,3 @@ data: PropTypes.arrayOf(PropTypes.shape({ | ||
isInteractive: PropTypes.bool, | ||
onClick: PropTypes.func.isRequired, | ||
tooltipFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
@@ -383,2 +432,3 @@ | ||
isInteractive: true, | ||
onClick: core.noop, | ||
@@ -388,22 +438,6 @@ legends: [] | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var enhance = (function (Component$$1) { | ||
return compose(defaultProps(PieDefaultProps), core.withTheme(), core.withDimensions(), core.withColors(), pure)(Component$$1); | ||
var enhance$1 = (function (Component) { | ||
return compose(defaultProps(PieDefaultProps), core.withTheme(), core.withDimensions(), core.withColors(), pure)(Component); | ||
}); | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var Pie = function Pie(_ref) { | ||
@@ -444,2 +478,3 @@ var data = _ref.data, | ||
isInteractive = _ref.isInteractive, | ||
onClick = _ref.onClick, | ||
tooltipFormat = _ref.tooltipFormat, | ||
@@ -482,10 +517,10 @@ legends$$1 = _ref.legends; | ||
var pie$$1 = d3Shape.pie(); | ||
pie$$1.value(function (d) { | ||
var pie = d3Shape.pie(); | ||
pie.value(function (d) { | ||
return d.value; | ||
}); | ||
if (sortByValue !== true) pie$$1.sortValues(null); | ||
if (sortByValue !== true) pie.sortValues(null); | ||
var arc$$1 = d3Shape.arc(); | ||
arc$$1.outerRadius(radius); | ||
var arc = d3Shape.arc(); | ||
arc.outerRadius(radius); | ||
@@ -533,4 +568,4 @@ var enhancedData = data.map(function (d) { | ||
function (interpolatingStyle) { | ||
var interpolatedPie = pie$$1.padAngle(interpolatingStyle.padAngle); | ||
var interpolatedArc = arc$$1.cornerRadius(interpolatingStyle.cornerRadius).innerRadius(interpolatingStyle.innerRadius); | ||
var interpolatedPie = pie.padAngle(interpolatingStyle.padAngle); | ||
var interpolatedArc = arc.cornerRadius(interpolatingStyle.cornerRadius).innerRadius(interpolatingStyle.innerRadius); | ||
@@ -553,22 +588,14 @@ var arcsData = interpolatedPie(enhancedData).map(function (d) { | ||
arcsData.map(function (d) { | ||
var handleTooltip = function handleTooltip(e) { | ||
return showTooltip(React__default.createElement(core.BasicTooltip, { | ||
id: d.data.label, | ||
value: d.data.value, | ||
enableChip: true, | ||
color: d.data.color, | ||
theme: theme, | ||
format: tooltipFormat | ||
}), e); | ||
}; | ||
return React__default.createElement('path', { | ||
return React__default.createElement(PieSlice$1, { | ||
key: d.data.id, | ||
d: interpolatedArc(d), | ||
data: d.data, | ||
path: interpolatedArc(d), | ||
color: d.data.color, | ||
fill: d.data.fill ? d.data.fill : d.data.color, | ||
strokeWidth: borderWidth, | ||
stroke: borderColor(d.data), | ||
onMouseEnter: handleTooltip, | ||
onMouseMove: handleTooltip, | ||
onMouseLeave: hideTooltip | ||
borderWidth: borderWidth, | ||
borderColor: borderColor(d.data), | ||
showTooltip: showTooltip, | ||
hideTooltip: hideTooltip, | ||
theme: theme, | ||
onClick: onClick | ||
}); | ||
@@ -606,13 +633,5 @@ }), | ||
var enhancedPie = enhance(Pie); | ||
var enhancedPie = enhance$1(Pie); | ||
enhancedPie.displayName = 'enhance(Pie)'; | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
var ResponsivePie = (function (props) { | ||
@@ -630,11 +649,2 @@ return React__default.createElement( | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
exports.Pie = enhancedPie; | ||
@@ -641,0 +651,0 @@ exports.ResponsivePie = ResponsivePie; |
{ | ||
"name": "@nivo/pie", | ||
"version": "0.34.0-1", | ||
"version": "0.35.0", | ||
"license": "MIT", | ||
@@ -12,4 +12,4 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@nivo/core": "0.34.0-1", | ||
"@nivo/legends": "0.34.0-1", | ||
"@nivo/core": "0.35.0", | ||
"@nivo/legends": "0.35.0", | ||
"d3-shape": "^1.2.0", | ||
@@ -19,12 +19,2 @@ "react-motion": "^0.5.2", | ||
}, | ||
"devDependencies": { | ||
"@nivo/babel-preset": "0.34.0-1", | ||
"@nivo/generators": "0.34.0-1", | ||
"babel-cli": "^6.26.0", | ||
"babel-jest": "^20.0.3", | ||
"cross-env": "^5.0.5", | ||
"jest": "^21.0.1", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -36,4 +26,3 @@ "prop-types": "^15.5.10", | ||
"access": "public" | ||
}, | ||
"scripts": {} | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
0
545
22793
1
+ Added@nivo/core@0.35.0(transitive)
+ Added@nivo/legends@0.35.0(transitive)
- Removed@nivo/core@0.34.0-1(transitive)
- Removed@nivo/legends@0.34.0-1(transitive)
Updated@nivo/core@0.35.0
Updated@nivo/legends@0.35.0