graphology-gexf
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -123,7 +123,8 @@ /* eslint no-self-compare: 0 */ | ||
* | ||
* @param {object} model - Data model to use. | ||
* @param {Node} element - Target DOM element. | ||
* @return {object} - The collected attributes. | ||
* @param {object} model - Data model to use. | ||
* @param {object} defaults - Default values. | ||
* @param {Node} element - Target DOM element. | ||
* @return {object} - The collected attributes. | ||
*/ | ||
function collectAttributes(model, element) { | ||
function collectAttributes(model, defaults, element) { | ||
var data = {}, | ||
@@ -156,2 +157,10 @@ label = element.getAttribute('label'), | ||
// Applying default values | ||
var k; | ||
for (k in defaults) { | ||
if (!(k in data)) | ||
data[k] = defaults[k]; | ||
} | ||
// TODO: shortcut here to avoid viz when namespace is not set | ||
@@ -288,5 +297,3 @@ | ||
var graph = new Graph({ | ||
type: graphType, | ||
defaultNodeAttributes: NODE_DEFAULT_ATTRIBUTES, | ||
defaultEdgeAttributes: EDGE_DEFAULT_ATTRIBUTES | ||
type: graphType | ||
}); | ||
@@ -309,3 +316,3 @@ | ||
element.getAttribute('id'), | ||
collectAttributes(NODE_MODEL, element) | ||
collectAttributes(NODE_MODEL, NODE_DEFAULT_ATTRIBUTES, element) | ||
); | ||
@@ -322,3 +329,3 @@ } | ||
t = element.getAttribute('target'); | ||
attributes = collectAttributes(EDGE_MODEL, element); | ||
attributes = collectAttributes(EDGE_MODEL, EDGE_DEFAULT_ATTRIBUTES, element); | ||
@@ -325,0 +332,0 @@ // If we encountered an edge with a different type, we upgrade the graph |
The MIT License (MIT) | ||
Copyright (c) 2016-2017 Guillaume Plique (Yomguithereal) | ||
Copyright (c) 2016-2020 Guillaume Plique (Yomguithereal) | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "graphology-gexf", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "GEXF parser & writer for graphology.", | ||
@@ -38,5 +38,5 @@ "main": "index.js", | ||
"@yomguithereal/eslint-config": "^4.0.0", | ||
"eslint": "^4.19.1", | ||
"graphology": "^0.11.4", | ||
"mocha": "^5.2.0" | ||
"eslint": "^6.8.0", | ||
"graphology": "^0.15.1", | ||
"mocha": "^7.0.1" | ||
}, | ||
@@ -50,6 +50,6 @@ "eslintConfig": { | ||
"dependencies": { | ||
"graphology-utils": "^1.3.0", | ||
"xmldom": "^0.1.27", | ||
"graphology-utils": "^1.5.0", | ||
"xmldom": "^0.2.1", | ||
"xml-writer": "^1.7.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27968
770
+ Addedxmldom@0.2.1(transitive)
- Removedxmldom@0.1.31(transitive)
Updatedgraphology-utils@^1.5.0
Updatedxmldom@^0.2.1