Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
graphology-components
Advanced tools
Connected components for graphology
.
npm install graphology-components
Iterates over the connected components of the given graph using a callback.
import {forEachConnectedComponent} from 'graphology-components';
forEachConnectedComponent(graph, component => {
console.log(component);
});
Specialized version of forEachConnectedComponent that iterates over the connected component orders, i.e. the number of nodes they contain.
It consumes less memory than a naive approach mapping the component lengths using forEachConnectedComponent
.
import {forEachConnectedComponentOrder} from 'graphology-components';
forEachConnectedComponentOrder(graph, order => {
console.log(order);
});
Returns the number of connected components of the given graph.
import {countConnectedComponents} from 'graphology-components';
const count = countConnectedComponents(graph);
Returns the list of connected components of the given graph.
import {connectedComponents} from 'graphology-components';
const components = connectedComponents(graph);
If your graph is mixed or directed, the result will be what are usually called weakly connected components.
Returns the largest connected component of the given graph.
import {largestConnectedComponent} from 'graphology-components';
const largest = largestConnectedComponent(graph);
Returns a subgraph of the largest connected component of the given graph.
import {largestConnectedComponentSubgraph} from 'graphology-components';
const subgraph = largestConnectedComponentSubgraph(graph);
Mutates the given graph to remove nodes and edges that are not part of its largest connected component.
import {cropToLargestConnectedComponent} from 'graphology-components';
cropToLargestConnectedComponent(graph);
Returns the list of strongly connected components of the given graph. (mixed or directed)
import {stronglyConnectedComponents} from 'graphology-components';
const components = stronglyConnectedComponents(graph);
FAQs
Connected components for graphology.
The npm package graphology-components receives a total of 18,477 weekly downloads. As such, graphology-components popularity was classified as popular.
We found that graphology-components 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.