Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
d3plus-network
Advanced tools
Javascript network visualizations built upon d3 modules.
If you use NPM, npm install d3plus-network
. Otherwise, download the latest release. The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom bundle using Rollup or your preferred bundler. You can also load directly from d3plus.org:
<script src="https://d3plus.org/js/d3plus-network.v0.1.full.min.js"></script>
Given an array of nodes and an array of links, d3plus-network can create simple network visualization based on supplied x and y coordinates.
var nodes = [
{id: "alpha", x: 1, y: 1},
{id: "beta", x: 2, y: 1},
{id: "gamma", x: 1, y: 2},
{id: "epsilon", x: 3, y: 2},
{id: "zeta", x: 2.5, y: 1.5},
{id: "theta", x: 2, y: 2}
];
The source
and target
keys in each link need to map to the nodes in one of three ways:
id
of the node.var links = [
{source: 0, target: 1},
{source: 0, target: 2},
{source: 3, target: 4},
{source: 3, target: 5},
{source: 5, target: 0}
];
Finally, these 2 variables simply need to be passed to a new Network class:
new d3plus.Network()
.links(links)
.nodes(nodes)
.render();
Click here to view this example live on the web.
Viz
Kind: global class
Extends: Viz
Viz
Creates an x/y plot based on an array of data.
If links is specified, sets the links array to the specified array and returns the current class instance. If links is not specified, returns the current links array.
Kind: static method of Network
Param | Type | Default |
---|---|---|
[links] | Array | [] |
If value is specified, sets the node group accessor(s) to the specified string, function, or array of values and returns the current class instance. This method overrides the default .groupBy() function from being used with the data passed to .nodes(). If value is not specified, returns the current node group accessor.
Kind: static method of Network
Param | Type |
---|---|
[value] | String | function | Array |
If nodes is specified, sets the nodes array to the specified array and returns the current class instance. If nodes is not specified, returns the current nodes array.
Kind: static method of Network
Param | Type | Default |
---|---|---|
[nodes] | Array | [] |
If value is specified, sets the x accessor to the specified function or string matching a key in the data and returns the current class instance. The data passed to .data() takes priority over the .nodes() data array. If value is not specified, returns the current x accessor. By default, the x and y positions are determined dynamically based on default force layout properties.
Kind: static method of Network
Param | Type |
---|---|
[value] | function | String |
If value is specified, sets the size accessor to the specified function or data key and returns the current class instance. If value is not specified, returns the current size accessor.
Kind: static method of Network
Param | Type |
---|---|
[value] | function | String |
If value is specified, sets the size scale maximum to the specified number and returns the current class instance. If value is not specified, returns the current size scale maximum. By default, the maximum size is determined by half the distance of the two closest nodes.
Kind: static method of Network
Param | Type |
---|---|
[value] | Number |
If value is specified, sets the size scale minimum to the specified number and returns the current class instance. If value is not specified, returns the current size scale minimum.
Kind: static method of Network
Param | Type | Default |
---|---|---|
[value] | Number | 5 |
If value is specified, sets the size scale to the specified string and returns the current class instance. If value is not specified, returns the current size scale.
Kind: static method of Network
Param | Type | Default |
---|---|---|
[value] | String | "sqrt" |
If value is specified, sets the y accessor to the specified function or string matching a key in the data and returns the current class instance. The data passed to .data() takes priority over the .nodes() data array. If value is not specified, returns the current y accessor. By default, the x and y positions are determined dynamically based on default force layout properties.
Kind: static method of Network
Param | Type |
---|---|
[value] | function | String |
FAQs
Javascript network visualizations built upon d3 modules.
The npm package d3plus-network receives a total of 604 weekly downloads. As such, d3plus-network popularity was classified as not popular.
We found that d3plus-network demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.