Socket
Socket
Sign inDemoInstall

@nivo/axes

Package Overview
Dependencies
6
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.49.0 to 0.49.1

96

cjs/nivo-axes.js

@@ -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;

4

package.json
{
"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 });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc