INNER CODE UNIT · JavaScript

readFileAndloadCytoscapeGraph

philippemerle/KubeDiagrams · interactive_viewer/script/main.js:42

function readFileAndloadCytoscapeGraph(event) {
    const file = event.target.files[0];
    const reader = new FileReader();

    reader.onload = function(e) {
        try {
            const content = e.target.result;
            const json = JSON.parse(content);
            const elements = IV.elementsBuilder.buildElementsFromDotJson(json);
            load_cytoscape(elements);
        } catch (err) {
            console.error('Invalid DOT_JSON file:', err);
        }
    };
    reader.readAsText(file);
}

/**

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…