Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Example Highlighting

Benjamin Bach edited this page Aug 2, 2021 · 1 revision
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('set', {nodes: [graph.nodes().get(0)]})
    }, 10 * 1000);

    // add node 1
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('add', {nodes: [graph.nodes().get(1)]})
    }, 11 * 1000);

    // show only node 2 and links 0 and 1
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('set', {
            nodes: [graph.nodes().get(2)], 
            links: [graph.links().get(0), graph.links().get(1)]
        })
    }, 12 * 1000);

    // show only node 2
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('set', {nodes: [graph.nodes().get(2)]})
    }, 13 * 1000);

    // reset all selections
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('reset')
    }, 14 * 1000);

    // highlight all nodes and one link
    window.setTimeout(()=>{
        var graph = window.vc.main.getDynamicGraph(dataset.name, sessionId);
        window.vc.messenger.highlight('set', {
            nodes: graph.nodes().toArray(),
            links: [graph.links().get(0)]
        })
    }, 15 * 1000);
Clone this wiki locally