victory-canvas
Advanced tools
Comparing version 36.4.1 to 36.5.0
@@ -1,6 +0,14 @@ | ||
import _omit from "lodash/omit"; | ||
import _assign from "lodash/assign"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
import { Bar, getBarPath, getBarWidth, getCornerRadius, getPolarBarPath, getStyle } from "victory-bar"; | ||
import { getBarPath, getBarWidth, getCornerRadius, getPolarBarPath, getStyle } from "victory-bar"; | ||
import { useCanvasContext } from "./hooks/use-canvas-context"; | ||
import { CommonProps } from "victory-core"; | ||
@@ -85,3 +93,22 @@ var evaluateProps = function (props) { | ||
CanvasBar.propTypes = _omit(Bar.propTypes, "pathComponent"); | ||
CanvasBar.propTypes = _objectSpread(_objectSpread({}, CommonProps.primitiveProps), {}, { | ||
alignment: PropTypes.oneOf(["start", "middle", "end"]), | ||
barRatio: PropTypes.number, | ||
barWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
cornerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.func, PropTypes.shape({ | ||
top: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
topLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
topRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottomLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottomRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]) | ||
})]), | ||
datum: PropTypes.object, | ||
getPath: PropTypes.func, | ||
horizontal: PropTypes.bool, | ||
width: PropTypes.number, | ||
x: PropTypes.number, | ||
y: PropTypes.number, | ||
y0: PropTypes.number | ||
}); | ||
export default CanvasBar; |
@@ -8,6 +8,6 @@ "use strict"; | ||
var _omit2 = _interopRequireDefault(require("lodash/omit")); | ||
var _assign2 = _interopRequireDefault(require("lodash/assign")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -19,4 +19,12 @@ | ||
var _victoryCore = require("victory-core"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var evaluateProps = function (props) { | ||
@@ -110,4 +118,23 @@ /** | ||
CanvasBar.propTypes = (0, _omit2.default)(_victoryBar.Bar.propTypes, "pathComponent"); | ||
CanvasBar.propTypes = _objectSpread(_objectSpread({}, _victoryCore.CommonProps.primitiveProps), {}, { | ||
alignment: _propTypes.default.oneOf(["start", "middle", "end"]), | ||
barRatio: _propTypes.default.number, | ||
barWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
cornerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func, _propTypes.default.shape({ | ||
top: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
topLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
topRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
bottom: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
bottomLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]), | ||
bottomRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]) | ||
})]), | ||
datum: _propTypes.default.object, | ||
getPath: _propTypes.default.func, | ||
horizontal: _propTypes.default.bool, | ||
width: _propTypes.default.number, | ||
x: _propTypes.default.number, | ||
y: _propTypes.default.number, | ||
y0: _propTypes.default.number | ||
}); | ||
var _default = CanvasBar; | ||
exports.default = _default; |
{ | ||
"name": "victory-canvas", | ||
"version": "36.4.1", | ||
"version": "36.5.0", | ||
"description": "HTML5 Canvas Components for Victory", | ||
@@ -24,6 +24,6 @@ "keywords": [ | ||
"prop-types": "^15.8.1", | ||
"victory-core": "^36.4.1" | ||
"victory-core": "^36.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.6.0 || ^17.0.0" | ||
"react": ">=16.6.0" | ||
}, | ||
@@ -34,3 +34,3 @@ "scripts": { | ||
"sideEffects": false, | ||
"gitHead": "aa44a22e5a93989773a560f765f83ac151f44c46" | ||
"gitHead": "7cecba921f751c3decc8215f7e866f51d11203c1" | ||
} |
/*global Path2D:false */ | ||
import { assign, omit } from "lodash"; | ||
import { assign } from "lodash"; | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
import { | ||
Bar, | ||
getBarPath, | ||
@@ -13,2 +13,3 @@ getBarWidth, | ||
import { useCanvasContext } from "./hooks/use-canvas-context"; | ||
import { CommonProps } from "victory-core"; | ||
@@ -112,4 +113,28 @@ const evaluateProps = (props) => { | ||
CanvasBar.propTypes = omit(Bar.propTypes, "pathComponent"); | ||
CanvasBar.propTypes = { | ||
...CommonProps.primitiveProps, | ||
alignment: PropTypes.oneOf(["start", "middle", "end"]), | ||
barRatio: PropTypes.number, | ||
barWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
cornerRadius: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.func, | ||
PropTypes.shape({ | ||
top: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
topLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
topRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottomLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), | ||
bottomRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]) | ||
}) | ||
]), | ||
datum: PropTypes.object, | ||
getPath: PropTypes.func, | ||
horizontal: PropTypes.bool, | ||
width: PropTypes.number, | ||
x: PropTypes.number, | ||
y: PropTypes.number, | ||
y0: PropTypes.number | ||
}; | ||
export default CanvasBar; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
536494
10425
+ Added@types/d3-time@3.0.3(transitive)
+ Addedreact@18.3.1(transitive)
- Removed@types/d3-time@3.0.4(transitive)
- Removedreact@17.0.2(transitive)
Updatedvictory-core@^36.5.0