Parse string passed to loadJSON.
This commit is contained in:
parent
38ff681f1b
commit
ba7663ff2f
|
@ -168,6 +168,10 @@ of nodes and edges:
|
||||||
}
|
}
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
// parse if a string is passed (EC5+ browsers)
|
||||||
|
if (typeof json == 'string' || json instanceof String) {
|
||||||
|
json = JSON.parse( json );
|
||||||
|
}
|
||||||
|
|
||||||
if ('nodes' in json || 'edges' in json) {
|
if ('nodes' in json || 'edges' in json) {
|
||||||
this.addNodes.apply(this, json['nodes']);
|
this.addNodes.apply(this, json['nodes']);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user