@nivo/axes
Advanced tools
Comparing version 0.49.0 to 0.49.1
@@ -334,3 +334,3 @@ 'use strict'; | ||
legendY = length; | ||
} else if (legendPosition === 'center') { | ||
} else if (legendPosition === 'middle') { | ||
textAnchor = 'middle'; | ||
@@ -345,3 +345,3 @@ legendY = length / 2; | ||
textAnchor = 'start'; | ||
} else if (legendPosition === 'center') { | ||
} else if (legendPosition === 'middle') { | ||
textAnchor = 'middle'; | ||
@@ -510,2 +510,91 @@ legendX = length / 2; | ||
var axisPropTypes = { | ||
ticksPosition: PropTypes.oneOf(['before', 'after']), | ||
tickValues: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.instanceOf(Date)]))]), | ||
tickSize: PropTypes.number, | ||
tickPadding: PropTypes.number, | ||
tickRotation: PropTypes.number, | ||
tickFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
renderTick: PropTypes.func, | ||
legend: PropTypes.node, | ||
legendPosition: PropTypes.oneOf(['start', 'middle', 'end']), | ||
legendOffset: PropTypes.number | ||
}; | ||
var axisPropType = PropTypes.shape(axisPropTypes); | ||
var positions = ['top', 'right', 'bottom', 'left']; | ||
var Axes = function (_PureComponent) { | ||
inherits(Axes, _PureComponent); | ||
function Axes() { | ||
classCallCheck(this, Axes); | ||
return possibleConstructorReturn(this, _PureComponent.apply(this, arguments)); | ||
} | ||
Axes.prototype.render = function render() { | ||
var _props = this.props, | ||
xScale = _props.xScale, | ||
yScale = _props.yScale, | ||
width = _props.width, | ||
height = _props.height, | ||
top = _props.top, | ||
right = _props.right, | ||
bottom = _props.bottom, | ||
left = _props.left, | ||
theme = _props.theme, | ||
animate = _props.animate, | ||
motionStiffness = _props.motionStiffness, | ||
motionDamping = _props.motionDamping; | ||
var axes = { top: top, right: right, bottom: bottom, left: left }; | ||
return React__default.createElement( | ||
React.Fragment, | ||
null, | ||
positions.map(function (position) { | ||
var axis = axes[position]; | ||
if (!axis) return null; | ||
var isXAxis = position === 'top' || position === 'bottom'; | ||
var ticksPosition = position === 'top' || position === 'left' ? 'before' : 'after'; | ||
return React__default.createElement(Axis$1, _extends({ | ||
key: position | ||
}, axis, { | ||
axis: isXAxis ? 'x' : 'y', | ||
x: position === 'right' ? width : 0, | ||
y: position === 'bottom' ? height : 0, | ||
scale: isXAxis ? xScale : yScale, | ||
length: isXAxis ? width : height, | ||
ticksPosition: ticksPosition, | ||
theme: theme, | ||
animate: animate, | ||
motionDamping: motionDamping, | ||
motionStiffness: motionStiffness | ||
})); | ||
}) | ||
); | ||
}; | ||
return Axes; | ||
}(React.PureComponent); | ||
Axes.propTypes = _extends({ | ||
xScale: PropTypes.func.isRequired, | ||
yScale: PropTypes.func.isRequired, | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired, | ||
top: axisPropType, | ||
right: axisPropType, | ||
bottom: axisPropType, | ||
left: axisPropType, | ||
theme: PropTypes.shape({ | ||
axis: core.axisThemePropType.isRequired | ||
}).isRequired | ||
}, core.motionPropTypes); | ||
var degreesToRadians = function degreesToRadians(degrees) { | ||
@@ -585,3 +674,6 @@ return degrees * Math.PI / 180; | ||
exports.Axes = Axes; | ||
exports.Axis = Axis$1; | ||
exports.renderAxisToCanvas = renderAxisToCanvas; | ||
exports.axisPropTypes = axisPropTypes; | ||
exports.axisPropType = axisPropType; |
{ | ||
"name": "@nivo/axes", | ||
"version": "0.49.0", | ||
"version": "0.49.1", | ||
"license": "MIT", | ||
@@ -37,3 +37,3 @@ "author": { | ||
}, | ||
"gitHead": "35e4fdcdcd11ff2852144efbdc1e67d0bfba8331" | ||
"gitHead": "9abfbfc4af6126ad491f216d363ce0620d42c134" | ||
} |
@@ -329,3 +329,3 @@ (function (global, factory) { | ||
legendY = length; | ||
} else if (legendPosition === 'center') { | ||
} else if (legendPosition === 'middle') { | ||
textAnchor = 'middle'; | ||
@@ -340,3 +340,3 @@ legendY = length / 2; | ||
textAnchor = 'start'; | ||
} else if (legendPosition === 'center') { | ||
} else if (legendPosition === 'middle') { | ||
textAnchor = 'middle'; | ||
@@ -505,2 +505,91 @@ legendX = length / 2; | ||
var axisPropTypes = { | ||
ticksPosition: PropTypes.oneOf(['before', 'after']), | ||
tickValues: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.instanceOf(Date)]))]), | ||
tickSize: PropTypes.number, | ||
tickPadding: PropTypes.number, | ||
tickRotation: PropTypes.number, | ||
tickFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
renderTick: PropTypes.func, | ||
legend: PropTypes.node, | ||
legendPosition: PropTypes.oneOf(['start', 'middle', 'end']), | ||
legendOffset: PropTypes.number | ||
}; | ||
var axisPropType = PropTypes.shape(axisPropTypes); | ||
var positions = ['top', 'right', 'bottom', 'left']; | ||
var Axes = function (_PureComponent) { | ||
inherits(Axes, _PureComponent); | ||
function Axes() { | ||
classCallCheck(this, Axes); | ||
return possibleConstructorReturn(this, _PureComponent.apply(this, arguments)); | ||
} | ||
Axes.prototype.render = function render() { | ||
var _props = this.props, | ||
xScale = _props.xScale, | ||
yScale = _props.yScale, | ||
width = _props.width, | ||
height = _props.height, | ||
top = _props.top, | ||
right = _props.right, | ||
bottom = _props.bottom, | ||
left = _props.left, | ||
theme = _props.theme, | ||
animate = _props.animate, | ||
motionStiffness = _props.motionStiffness, | ||
motionDamping = _props.motionDamping; | ||
var axes = { top: top, right: right, bottom: bottom, left: left }; | ||
return React__default.createElement( | ||
React.Fragment, | ||
null, | ||
positions.map(function (position) { | ||
var axis = axes[position]; | ||
if (!axis) return null; | ||
var isXAxis = position === 'top' || position === 'bottom'; | ||
var ticksPosition = position === 'top' || position === 'left' ? 'before' : 'after'; | ||
return React__default.createElement(Axis$1, _extends({ | ||
key: position | ||
}, axis, { | ||
axis: isXAxis ? 'x' : 'y', | ||
x: position === 'right' ? width : 0, | ||
y: position === 'bottom' ? height : 0, | ||
scale: isXAxis ? xScale : yScale, | ||
length: isXAxis ? width : height, | ||
ticksPosition: ticksPosition, | ||
theme: theme, | ||
animate: animate, | ||
motionDamping: motionDamping, | ||
motionStiffness: motionStiffness | ||
})); | ||
}) | ||
); | ||
}; | ||
return Axes; | ||
}(React.PureComponent); | ||
Axes.propTypes = _extends({ | ||
xScale: PropTypes.func.isRequired, | ||
yScale: PropTypes.func.isRequired, | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired, | ||
top: axisPropType, | ||
right: axisPropType, | ||
bottom: axisPropType, | ||
left: axisPropType, | ||
theme: PropTypes.shape({ | ||
axis: core.axisThemePropType.isRequired | ||
}).isRequired | ||
}, core.motionPropTypes); | ||
var degreesToRadians = function degreesToRadians(degrees) { | ||
@@ -580,4 +669,7 @@ return degrees * Math.PI / 180; | ||
exports.Axes = Axes; | ||
exports.Axis = Axis$1; | ||
exports.renderAxisToCanvas = renderAxisToCanvas; | ||
exports.axisPropTypes = axisPropTypes; | ||
exports.axisPropType = axisPropType; | ||
@@ -584,0 +676,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
51239
1187
0