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

@visx/network

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visx/network - npm Package Compare versions

Comparing version 2.10.0 to 2.17.0-alpha.0

14

esm/DefaultNode.js
import _pt from "prop-types";
var _excluded = ["r", "fill"];
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
export default function DefaultNode(_ref) {
var _ref$r = _ref.r,
r = _ref$r === void 0 ? 15 : _ref$r,
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? '#21D4FD' : _ref$fill,
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
r = _ref$r === void 0 ? 15 : _ref$r,
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? '#21D4FD' : _ref$fill,
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
return /*#__PURE__*/React.createElement("circle", _extends({

@@ -17,0 +13,0 @@ r: r,

@@ -10,8 +10,8 @@ import _pt from "prop-types";

var graph = _ref.graph,
_ref$linkComponent = _ref.linkComponent,
linkComponent = _ref$linkComponent === void 0 ? DefaultLink : _ref$linkComponent,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? DefaultNode : _ref$nodeComponent,
top = _ref.top,
left = _ref.left;
_ref$linkComponent = _ref.linkComponent,
linkComponent = _ref$linkComponent === void 0 ? DefaultLink : _ref$linkComponent,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? DefaultNode : _ref$nodeComponent,
top = _ref.top,
left = _ref.left;
return graph ? /*#__PURE__*/React.createElement(Group, {

@@ -18,0 +18,0 @@ top: top,

@@ -7,5 +7,5 @@ import _pt from "prop-types";

var _ref$links = _ref.links,
links = _ref$links === void 0 ? [] : _ref$links,
linkComponent = _ref.linkComponent,
className = _ref.className;
links = _ref$links === void 0 ? [] : _ref$links,
linkComponent = _ref.linkComponent,
className = _ref.className;
return /*#__PURE__*/React.createElement(React.Fragment, null, links.map(function (link, i) {

@@ -12,0 +12,0 @@ return /*#__PURE__*/React.createElement(Group, {

@@ -8,14 +8,14 @@ import _pt from "prop-types";

var _ref$nodes = _ref.nodes,
nodes = _ref$nodes === void 0 ? [] : _ref$nodes,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? DefaultNode : _ref$nodeComponent,
className = _ref.className,
_ref$x = _ref.x,
x = _ref$x === void 0 ? function (d) {
return (d == null ? void 0 : d.x) || 0;
} : _ref$x,
_ref$y = _ref.y,
y = _ref$y === void 0 ? function (d) {
return (d == null ? void 0 : d.y) || 0;
} : _ref$y;
nodes = _ref$nodes === void 0 ? [] : _ref$nodes,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? DefaultNode : _ref$nodeComponent,
className = _ref.className,
_ref$x = _ref.x,
x = _ref$x === void 0 ? function (d) {
return (d == null ? void 0 : d.x) || 0;
} : _ref$x,
_ref$y = _ref.y,
y = _ref$y === void 0 ? function (d) {
return (d == null ? void 0 : d.y) || 0;
} : _ref$y;
return /*#__PURE__*/React.createElement(React.Fragment, null, nodes.map(function (node, i) {

@@ -22,0 +22,0 @@ return /*#__PURE__*/React.createElement(Group, {

@@ -5,7 +5,4 @@ "use strict";

exports.default = DefaultLink;
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -12,0 +9,0 @@ function DefaultLink(_ref) {

@@ -5,22 +5,14 @@ "use strict";

exports.default = DefaultNode;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _excluded = ["r", "fill"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function DefaultNode(_ref) {
var _ref$r = _ref.r,
r = _ref$r === void 0 ? 15 : _ref$r,
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? '#21D4FD' : _ref$fill,
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
r = _ref$r === void 0 ? 15 : _ref$r,
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? '#21D4FD' : _ref$fill,
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
return /*#__PURE__*/_react.default.createElement("circle", _extends({

@@ -31,3 +23,2 @@ r: r,

}
DefaultNode.propTypes = {

@@ -34,0 +25,0 @@ cx: _propTypes.default.number,

@@ -5,27 +5,18 @@ "use strict";

exports.default = Graph;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _group = require("@visx/group");
var _Links = _interopRequireDefault(require("./Links"));
var _Nodes = _interopRequireDefault(require("./Nodes"));
var _DefaultNode = _interopRequireDefault(require("./DefaultNode"));
var _DefaultLink = _interopRequireDefault(require("./DefaultLink"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Graph(_ref) {
var graph = _ref.graph,
_ref$linkComponent = _ref.linkComponent,
linkComponent = _ref$linkComponent === void 0 ? _DefaultLink.default : _ref$linkComponent,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? _DefaultNode.default : _ref$nodeComponent,
top = _ref.top,
left = _ref.left;
_ref$linkComponent = _ref.linkComponent,
linkComponent = _ref$linkComponent === void 0 ? _DefaultLink.default : _ref$linkComponent,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? _DefaultNode.default : _ref$nodeComponent,
top = _ref.top,
left = _ref.left;
return graph ? /*#__PURE__*/_react.default.createElement(_group.Group, {

@@ -42,3 +33,2 @@ top: top,

}
Graph.propTypes = {

@@ -45,0 +35,0 @@ top: _propTypes.default.number,

"use strict";
exports.__esModule = true;
exports.DefaultNode = exports.DefaultLink = exports.Nodes = exports.Links = exports.Graph = void 0;
exports.Nodes = exports.Links = exports.Graph = exports.DefaultNode = exports.DefaultLink = void 0;
var _Graph = _interopRequireDefault(require("./Graph"));
exports.Graph = _Graph.default;
var _Links = _interopRequireDefault(require("./Links"));
exports.Links = _Links.default;
var _Nodes = _interopRequireDefault(require("./Nodes"));
exports.Nodes = _Nodes.default;
var _DefaultLink = _interopRequireDefault(require("./DefaultLink"));
exports.DefaultLink = _DefaultLink.default;
var _DefaultNode = _interopRequireDefault(require("./DefaultNode"));
exports.DefaultNode = _DefaultNode.default;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -5,18 +5,12 @@ "use strict";

exports.default = Links;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _group = require("@visx/group");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Links(_ref) {
var _ref$links = _ref.links,
links = _ref$links === void 0 ? [] : _ref$links,
linkComponent = _ref.linkComponent,
className = _ref.className;
links = _ref$links === void 0 ? [] : _ref$links,
linkComponent = _ref.linkComponent,
className = _ref.className;
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, links.map(function (link, i) {

@@ -31,3 +25,2 @@ return /*#__PURE__*/_react.default.createElement(_group.Group, {

}
Links.propTypes = {

@@ -34,0 +27,0 @@ links: _propTypes.default.array,

@@ -5,29 +5,22 @@ "use strict";

exports.default = Nodes;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _group = require("@visx/group");
var _DefaultNode = _interopRequireDefault(require("./DefaultNode"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Nodes(_ref) {
var _ref$nodes = _ref.nodes,
nodes = _ref$nodes === void 0 ? [] : _ref$nodes,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? _DefaultNode.default : _ref$nodeComponent,
className = _ref.className,
_ref$x = _ref.x,
x = _ref$x === void 0 ? function (d) {
return (d == null ? void 0 : d.x) || 0;
} : _ref$x,
_ref$y = _ref.y,
y = _ref$y === void 0 ? function (d) {
return (d == null ? void 0 : d.y) || 0;
} : _ref$y;
nodes = _ref$nodes === void 0 ? [] : _ref$nodes,
_ref$nodeComponent = _ref.nodeComponent,
nodeComponent = _ref$nodeComponent === void 0 ? _DefaultNode.default : _ref$nodeComponent,
className = _ref.className,
_ref$x = _ref.x,
x = _ref$x === void 0 ? function (d) {
return (d == null ? void 0 : d.x) || 0;
} : _ref$x,
_ref$y = _ref.y,
y = _ref$y === void 0 ? function (d) {
return (d == null ? void 0 : d.y) || 0;
} : _ref$y;
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, nodes.map(function (node, i) {

@@ -44,3 +37,2 @@ return /*#__PURE__*/_react.default.createElement(_group.Group, {

}
Nodes.propTypes = {

@@ -47,0 +39,0 @@ nodes: _propTypes.default.array,

@@ -9,8 +9,8 @@ export interface DefaultNode {

}
export interface Graph<Link, Node> {
links: Link[];
export interface Graph<L, Node> {
links: L[];
nodes: Node[];
}
export interface LinkProvidedProps<Link> {
link: Link;
export interface LinkProvidedProps<L> {
link: L;
}

@@ -17,0 +17,0 @@ export interface NodeProvidedProps<Node> {

{
"name": "@visx/network",
"version": "2.10.0",
"version": "2.17.0-alpha.0",
"description": "visx network",

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

"@types/react": "*",
"@visx/group": "2.10.0",
"@visx/group": "2.17.0-alpha.0",
"classnames": "^2.3.1",

@@ -35,3 +35,3 @@ "prop-types": "^15.6.2"

},
"gitHead": "3d655a8b100d862c91d4b5655e221259357a094d"
"gitHead": "77292e262dfe082b554b64839eb3ee141439a95f"
}

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