Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
window.loadGraph = function (json) {
// Remove loading message
var loading = document.getElementById("loading");
loading.parentNode.removeChild(loading);
// Load graph
var editor = document.getElementById('editor');
var graph = json.data ? JSON.parse(json.data.files['noflo.json'].content) : json;
var graphString = JSON.stringify(graph);
editor.graph = graph;
// Attach editor to nav
var nav = document.getElementById('nav');
nav.editor = editor;
// Simulate a library update
setTimeout(function () {
var originalComponent = editor.getComponent('core/Split');
if (!originalComponent) {
console.warn("Didn't find component. Something is amiss.");
return;
}
var component = JSON.parse(JSON.stringify(originalComponent));
component.icon = 'github';
window.loadGraph = function (json) {
// Load graph
var graphData = json.data.files['noflo.json'].content;
var thumb = document.getElementById('thumb');
window.fbpGraph.graph.loadJSON(graphData, function(err, graph) {
thumb.graph = graph;
});
};
var body = document.querySelector('body');