Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
graphology-gexf
Advanced tools
GEXF parser & writer for graphology
.
For more information about the GEXF file format, you can head there.
npm install graphology-gexf
The parser must be passed a graphology
constructor and is able to read either a string, or an XMLDocument
instance.
var Graph = require('graphology');
// Node
var gexf = require('graphology-gexf');
// Browser
var gexf = require('graphology-gexf/browser');
// Reading a string
var graph = gexf.parse(Graph, string);
// Reading a dom document
var graph = gexf.parse(Graph, xmlDocument);
Arguments
The writer must be passed a graphology
instance and will output a GEXF string.
// Node
var gexf = require('graphology-gexf');
// Browser
var gexf = require('graphology-gexf/browser');
// Writing the graph
var gexfString = gexf.write(graph);
// Using custom formatting for nodes & edges
var gexfString = gexf.write(graph, {
formatNode: function(key, attributes) {
return {
label: attributes.label,
attributes: {
age: attributes.age,
name: attributes.name
},
viz: {
color: '#FF0',
x: attributes.x,
y: attributes.y,
shape: 'circle',
size: 20
}
};
},
formatEdge: function(key, attributes) {
return {
label: attributes.label,
attributes: {
number: attributes.number
},
weight: attributes.weight,
viz: {
color: '#FF0',
x: attributes.x,
y: attributes.y,
shape: 'dotted',
thickness: 20
}
};
}
});
Arguments
UTF-8
]: encoding declaration.true
]: pretty-print output?0.8.0
#.nodesIterator
method.FAQs
GEXF parser & writer for graphology.
The npm package graphology-gexf receives a total of 3,438 weekly downloads. As such, graphology-gexf popularity was classified as popular.
We found that graphology-gexf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.