Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@visx/pattern

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visx/pattern - npm Package Compare versions

Comparing version 3.0.0-alpha.0 to 3.0.0

31

esm/patterns/Circles.js

@@ -6,21 +6,20 @@ import _pt from "prop-types";

export default 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.createElement(Pattern, {

@@ -43,5 +42,5 @@ id: id,

strokeDasharray: strokeDasharray
}), corners && corners.map(function (_ref2) {
}), (_corners = corners) == null ? void 0 : _corners.map(function (_ref2) {
var cornerX = _ref2[0],
cornerY = _ref2[1];
cornerY = _ref2[1];
return /*#__PURE__*/React.createElement("circle", {

@@ -48,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,33 +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, {

@@ -54,5 +47,5 @@ id: id,

strokeDasharray: strokeDasharray
}), corners && corners.map(function (_ref2) {
}), (_corners = corners) == null ? void 0 : _corners.map(function (_ref2) {
var cornerX = _ref2[0],
cornerY = _ref2[1];
cornerY = _ref2[1];
return /*#__PURE__*/_react.default.createElement("circle", {

@@ -71,3 +64,2 @@ key: id + "-complement-" + cornerX + "-" + cornerY,

}
Circles.propTypes = {

@@ -74,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": "3.0.0-alpha.0",
"version": "3.0.0",
"description": "visx pattern",

@@ -36,3 +36,3 @@ "sideEffects": false,

"peerDependencies": {
"react": "^16.0.0-0 || ^17.0.0-0"
"react": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0"
},

@@ -42,3 +42,3 @@ "publishConfig": {

},
"gitHead": "2f2fb26030b5f1328803b2bd7de171d66e088aff"
"gitHead": "2fbffbaee80b88302274266112f8ad9a241def33"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc