@visx/pattern
Advanced tools
Comparing version 2.10.0 to 2.17.0-alpha.0
@@ -7,22 +7,19 @@ import _pt from "prop-types"; | ||
var _corners; | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
_ref$radius = _ref.radius, | ||
radius = _ref$radius === void 0 ? 2 : _ref$radius, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
background = _ref.background, | ||
_ref$complement = _ref.complement, | ||
complement = _ref$complement === void 0 ? false : _ref$complement, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
_ref$radius = _ref.radius, | ||
radius = _ref$radius === void 0 ? 2 : _ref$radius, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
background = _ref.background, | ||
_ref$complement = _ref.complement, | ||
complement = _ref$complement === void 0 ? false : _ref$complement, | ||
className = _ref.className; | ||
var corners; | ||
if (complement) { | ||
corners = [[0, 0], [0, height], [width, 0], [width, height]]; | ||
} | ||
return /*#__PURE__*/React.createElement(Pattern, { | ||
@@ -47,3 +44,3 @@ id: id, | ||
var cornerX = _ref2[0], | ||
cornerY = _ref2[1]; | ||
cornerY = _ref2[1]; | ||
return /*#__PURE__*/React.createElement("circle", { | ||
@@ -50,0 +47,0 @@ key: id + "-complement-" + cornerX + "-" + cornerY, |
@@ -7,13 +7,13 @@ import _pt from "prop-types"; | ||
var id = _ref.id, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? 3 : _ref$size; | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? 3 : _ref$size; | ||
var sqrtSize = Math.sqrt(size); | ||
@@ -20,0 +20,0 @@ return /*#__PURE__*/React.createElement(Path, { |
@@ -8,14 +8,10 @@ import _pt from "prop-types"; | ||
var height = _ref.height, | ||
orientation = _ref.orientation; | ||
orientation = _ref.orientation; | ||
switch (orientation) { | ||
case PatternOrientation.horizontal: | ||
return "M 0," + height / 2 + " l " + height + ",0"; | ||
case PatternOrientation.diagonal: | ||
return "M 0," + height + " l " + height + "," + -height + " M " + -height / 4 + "," + height / 4 + " l " + height / 2 + "," + -height / 2 + "\n M " + 3 / 4 * height + "," + 5 / 4 * height + " l " + height / 2 + "," + -height / 2; | ||
case PatternOrientation.diagonalRightToLeft: | ||
return "M 0,0 l " + height + "," + height + "\n M " + -height / 4 + "," + 3 / 4 * height + " l " + height / 2 + "," + height / 2 + "\n M " + 3 / 4 * height + "," + -height / 4 + " l " + height / 2 + "," + height / 2; | ||
case PatternOrientation.vertical: | ||
@@ -28,15 +24,15 @@ default: | ||
var id = _ref2.id, | ||
width = _ref2.width, | ||
height = _ref2.height, | ||
stroke = _ref2.stroke, | ||
strokeWidth = _ref2.strokeWidth, | ||
strokeDasharray = _ref2.strokeDasharray, | ||
_ref2$strokeLinecap = _ref2.strokeLinecap, | ||
strokeLinecap = _ref2$strokeLinecap === void 0 ? 'square' : _ref2$strokeLinecap, | ||
_ref2$shapeRendering = _ref2.shapeRendering, | ||
shapeRendering = _ref2$shapeRendering === void 0 ? 'auto' : _ref2$shapeRendering, | ||
_ref2$orientation = _ref2.orientation, | ||
orientation = _ref2$orientation === void 0 ? ['vertical'] : _ref2$orientation, | ||
background = _ref2.background, | ||
className = _ref2.className; | ||
width = _ref2.width, | ||
height = _ref2.height, | ||
stroke = _ref2.stroke, | ||
strokeWidth = _ref2.strokeWidth, | ||
strokeDasharray = _ref2.strokeDasharray, | ||
_ref2$strokeLinecap = _ref2.strokeLinecap, | ||
strokeLinecap = _ref2$strokeLinecap === void 0 ? 'square' : _ref2$strokeLinecap, | ||
_ref2$shapeRendering = _ref2.shapeRendering, | ||
shapeRendering = _ref2$shapeRendering === void 0 ? 'auto' : _ref2$shapeRendering, | ||
_ref2$orientation = _ref2.orientation, | ||
orientation = _ref2$orientation === void 0 ? ['vertical'] : _ref2$orientation, | ||
background = _ref2.background, | ||
className = _ref2.className; | ||
var orientations = Array.isArray(orientation) ? orientation : [orientation]; | ||
@@ -43,0 +39,0 @@ return /*#__PURE__*/React.createElement(Pattern, { |
@@ -7,16 +7,16 @@ import _pt from "prop-types"; | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
path = _ref.path, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? 'transparent' : _ref$fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
_ref$strokeLinecap = _ref.strokeLinecap, | ||
strokeLinecap = _ref$strokeLinecap === void 0 ? 'square' : _ref$strokeLinecap, | ||
_ref$shapeRendering = _ref.shapeRendering, | ||
shapeRendering = _ref$shapeRendering === void 0 ? 'auto' : _ref$shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
path = _ref.path, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? 'transparent' : _ref$fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
_ref$strokeLinecap = _ref.strokeLinecap, | ||
strokeLinecap = _ref$strokeLinecap === void 0 ? 'square' : _ref$strokeLinecap, | ||
_ref$shapeRendering = _ref.shapeRendering, | ||
shapeRendering = _ref$shapeRendering === void 0 ? 'auto' : _ref$shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
return /*#__PURE__*/React.createElement(Pattern, { | ||
@@ -23,0 +23,0 @@ id: id, |
@@ -5,5 +5,5 @@ import _pt from "prop-types"; | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
children = _ref.children; | ||
width = _ref.width, | ||
height = _ref.height, | ||
children = _ref.children; | ||
return /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", { | ||
@@ -10,0 +10,0 @@ id: id, |
@@ -7,12 +7,12 @@ import _pt from "prop-types"; | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
return /*#__PURE__*/React.createElement(Path, { | ||
@@ -19,0 +19,0 @@ className: cx('visx-pattern-wave', className), |
"use strict"; | ||
exports.__esModule = true; | ||
exports.PatternOrientation = exports.PatternPath = exports.PatternHexagons = exports.PatternWaves = exports.PatternCircles = exports.PatternLines = exports.Pattern = void 0; | ||
exports.PatternWaves = exports.PatternPath = exports.PatternOrientation = exports.PatternLines = exports.PatternHexagons = exports.PatternCircles = exports.Pattern = void 0; | ||
var _Pattern = _interopRequireDefault(require("./patterns/Pattern")); | ||
exports.Pattern = _Pattern.default; | ||
var _Lines = _interopRequireDefault(require("./patterns/Lines")); | ||
exports.PatternLines = _Lines.default; | ||
var _Circles = _interopRequireDefault(require("./patterns/Circles")); | ||
exports.PatternCircles = _Circles.default; | ||
var _Waves = _interopRequireDefault(require("./patterns/Waves")); | ||
exports.PatternWaves = _Waves.default; | ||
var _Hexagons = _interopRequireDefault(require("./patterns/Hexagons")); | ||
exports.PatternHexagons = _Hexagons.default; | ||
var _Path = _interopRequireDefault(require("./patterns/Path")); | ||
exports.PatternPath = _Path.default; | ||
var _constants = require("./constants"); | ||
exports.PatternOrientation = _constants.PatternOrientation; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -5,35 +5,26 @@ "use strict"; | ||
exports.default = Circles; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _Pattern = _interopRequireDefault(require("./Pattern")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Circles(_ref) { | ||
var _corners; | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
_ref$radius = _ref.radius, | ||
radius = _ref$radius === void 0 ? 2 : _ref$radius, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
background = _ref.background, | ||
_ref$complement = _ref.complement, | ||
complement = _ref$complement === void 0 ? false : _ref$complement, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
_ref$radius = _ref.radius, | ||
radius = _ref$radius === void 0 ? 2 : _ref$radius, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
background = _ref.background, | ||
_ref$complement = _ref.complement, | ||
complement = _ref$complement === void 0 ? false : _ref$complement, | ||
className = _ref.className; | ||
var corners; | ||
if (complement) { | ||
corners = [[0, 0], [0, height], [width, 0], [width, height]]; | ||
} | ||
return /*#__PURE__*/_react.default.createElement(_Pattern.default, { | ||
@@ -58,3 +49,3 @@ id: id, | ||
var cornerX = _ref2[0], | ||
cornerY = _ref2[1]; | ||
cornerY = _ref2[1]; | ||
return /*#__PURE__*/_react.default.createElement("circle", { | ||
@@ -73,3 +64,2 @@ key: id + "-complement-" + cornerX + "-" + cornerY, | ||
} | ||
Circles.propTypes = { | ||
@@ -76,0 +66,0 @@ id: _propTypes.default.string.isRequired, |
@@ -5,26 +5,20 @@ "use strict"; | ||
exports.default = Hexagons; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _Path = _interopRequireDefault(require("./Path")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Hexagons(_ref) { | ||
var id = _ref.id, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? 3 : _ref$size; | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? 3 : _ref$size; | ||
var sqrtSize = Math.sqrt(size); | ||
@@ -46,3 +40,2 @@ return /*#__PURE__*/_react.default.createElement(_Path.default, { | ||
} | ||
Hexagons.propTypes = { | ||
@@ -49,0 +42,0 @@ id: _propTypes.default.string.isRequired, |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = Lines; | ||
exports.pathForOrientation = pathForOrientation; | ||
exports.default = Lines; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _Pattern = _interopRequireDefault(require("./Pattern")); | ||
var _constants = require("../constants"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function pathForOrientation(_ref) { | ||
var height = _ref.height, | ||
orientation = _ref.orientation; | ||
orientation = _ref.orientation; | ||
switch (orientation) { | ||
case _constants.PatternOrientation.horizontal: | ||
return "M 0," + height / 2 + " l " + height + ",0"; | ||
case _constants.PatternOrientation.diagonal: | ||
return "M 0," + height + " l " + height + "," + -height + " M " + -height / 4 + "," + height / 4 + " l " + height / 2 + "," + -height / 2 + "\n M " + 3 / 4 * height + "," + 5 / 4 * height + " l " + height / 2 + "," + -height / 2; | ||
case _constants.PatternOrientation.diagonalRightToLeft: | ||
return "M 0,0 l " + height + "," + height + "\n M " + -height / 4 + "," + 3 / 4 * height + " l " + height / 2 + "," + height / 2 + "\n M " + 3 / 4 * height + "," + -height / 4 + " l " + height / 2 + "," + height / 2; | ||
case _constants.PatternOrientation.vertical: | ||
@@ -38,18 +27,17 @@ default: | ||
} | ||
function Lines(_ref2) { | ||
var id = _ref2.id, | ||
width = _ref2.width, | ||
height = _ref2.height, | ||
stroke = _ref2.stroke, | ||
strokeWidth = _ref2.strokeWidth, | ||
strokeDasharray = _ref2.strokeDasharray, | ||
_ref2$strokeLinecap = _ref2.strokeLinecap, | ||
strokeLinecap = _ref2$strokeLinecap === void 0 ? 'square' : _ref2$strokeLinecap, | ||
_ref2$shapeRendering = _ref2.shapeRendering, | ||
shapeRendering = _ref2$shapeRendering === void 0 ? 'auto' : _ref2$shapeRendering, | ||
_ref2$orientation = _ref2.orientation, | ||
orientation = _ref2$orientation === void 0 ? ['vertical'] : _ref2$orientation, | ||
background = _ref2.background, | ||
className = _ref2.className; | ||
width = _ref2.width, | ||
height = _ref2.height, | ||
stroke = _ref2.stroke, | ||
strokeWidth = _ref2.strokeWidth, | ||
strokeDasharray = _ref2.strokeDasharray, | ||
_ref2$strokeLinecap = _ref2.strokeLinecap, | ||
strokeLinecap = _ref2$strokeLinecap === void 0 ? 'square' : _ref2$strokeLinecap, | ||
_ref2$shapeRendering = _ref2.shapeRendering, | ||
shapeRendering = _ref2$shapeRendering === void 0 ? 'auto' : _ref2$shapeRendering, | ||
_ref2$orientation = _ref2.orientation, | ||
orientation = _ref2$orientation === void 0 ? ['vertical'] : _ref2$orientation, | ||
background = _ref2.background, | ||
className = _ref2.className; | ||
var orientations = Array.isArray(orientation) ? orientation : [orientation]; | ||
@@ -81,3 +69,2 @@ return /*#__PURE__*/_react.default.createElement(_Pattern.default, { | ||
} | ||
Lines.propTypes = { | ||
@@ -84,0 +71,0 @@ id: _propTypes.default.string.isRequired, |
@@ -5,29 +5,23 @@ "use strict"; | ||
exports.default = Path; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _Pattern = _interopRequireDefault(require("./Pattern")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Path(_ref) { | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
path = _ref.path, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? 'transparent' : _ref$fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
_ref$strokeLinecap = _ref.strokeLinecap, | ||
strokeLinecap = _ref$strokeLinecap === void 0 ? 'square' : _ref$strokeLinecap, | ||
_ref$shapeRendering = _ref.shapeRendering, | ||
shapeRendering = _ref$shapeRendering === void 0 ? 'auto' : _ref$shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
path = _ref.path, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? 'transparent' : _ref$fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
_ref$strokeLinecap = _ref.strokeLinecap, | ||
strokeLinecap = _ref$strokeLinecap === void 0 ? 'square' : _ref$strokeLinecap, | ||
_ref$shapeRendering = _ref.shapeRendering, | ||
shapeRendering = _ref$shapeRendering === void 0 ? 'auto' : _ref$shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
return /*#__PURE__*/_react.default.createElement(_Pattern.default, { | ||
@@ -52,3 +46,2 @@ id: id, | ||
} | ||
Path.propTypes = { | ||
@@ -55,0 +48,0 @@ id: _propTypes.default.string.isRequired, |
@@ -5,14 +5,10 @@ "use strict"; | ||
exports.default = Pattern; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Pattern(_ref) { | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
children = _ref.children; | ||
width = _ref.width, | ||
height = _ref.height, | ||
children = _ref.children; | ||
return /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("pattern", { | ||
@@ -25,3 +21,2 @@ id: id, | ||
} | ||
Pattern.propTypes = { | ||
@@ -28,0 +23,0 @@ id: _propTypes.default.string.isRequired, |
@@ -5,25 +5,19 @@ "use strict"; | ||
exports.default = Waves; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _Path = _interopRequireDefault(require("./Path")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Waves(_ref) { | ||
var id = _ref.id, | ||
width = _ref.width, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
width = _ref.width, | ||
height = _ref.height, | ||
fill = _ref.fill, | ||
stroke = _ref.stroke, | ||
strokeWidth = _ref.strokeWidth, | ||
strokeDasharray = _ref.strokeDasharray, | ||
strokeLinecap = _ref.strokeLinecap, | ||
shapeRendering = _ref.shapeRendering, | ||
background = _ref.background, | ||
className = _ref.className; | ||
return /*#__PURE__*/_react.default.createElement(_Path.default, { | ||
@@ -44,3 +38,2 @@ className: (0, _classnames.default)('visx-pattern-wave', className), | ||
} | ||
Waves.propTypes = { | ||
@@ -47,0 +40,0 @@ id: _propTypes.default.string.isRequired, |
{ | ||
"name": "@visx/pattern", | ||
"version": "2.10.0", | ||
"version": "2.17.0-alpha.0", | ||
"description": "visx pattern", | ||
@@ -41,3 +41,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "3d655a8b100d862c91d4b5655e221259357a094d" | ||
"gitHead": "77292e262dfe082b554b64839eb3ee141439a95f" | ||
} |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
43782
1