function getLateralMovements(data){
    var nodes = []
    var edges = []

    var hosts = []      // Stores the label for host i-th
    var types = []      // Stores the type of host i-th


    for (var i=0; i < data.timeline.length; i++) {
        // Only add when both hosts need to be set
        if (data.timeline[i].event_host == null || data.timeline[i].event_source_host == null || data.timeline[i].event_host == "" || data.timeline[i].event_source_host == "") {
            continue;
        }

        //only show if visual is activated
        if(!data.timeline[i].visual || data.timeline[i].visual ==0) continue;

        // Add hosts
        // ---------

        // Add host 1
        host1 = data.timeline[i].event_host
        idx1 = hosts.indexOf(host1)

        if (idx1 == -1){
            hosts.push(host1)
            types.push(getHostType(data.systems, host1))
            idx1 = hosts.length - 1
        }

        // Add host 2
        host2 = data.timeline[i].event_source_host
        idx2 = hosts.indexOf(host2)
        if (idx2 == -1){
            hosts.push(host2)
            types.push(getHostType(data.systems, host2))
            idx2 = hosts.length - 1
        }

        // Figure out direction
        direction = data.timeline[i].direction

        source = 0;
        destination = 0;
        if (direction == "->") {
            //from 1 > 2
            source = idx1
            destination = idx2
        }
        else {
            //from 2 > 1
            source = idx2
            destination = idx1
        }

        // Add connections
        // --------------

        // color lateral and exfil differently
        color = "#cccccc"

        if (data.timeline[i].event_type == "EventLog") {
            color = "limegreen"
        } else if (data.timeline[i].event_type == "File") {
            color = "gold"
        } else if (data.timeline[i].event_type == "Human") {
            color = "palevioletred"
        } else if (data.timeline[i].event_type == "Engagement") {
            color = "lightskyblue"
        } else if (data.timeline[i].event_type == "Lateral Movement") {
            color = "lightseagreen"
        } else if (data.timeline[i].event_type == "Exfil") {
            color = "plum"
        } else if (data.timeline[i].event_type == "Tanium Trace") {
            color = "palevioletred"
        } else if (data.timeline[i].event_type == "Malware") {
            color = "firebrick"
        } else if (data.timeline[i].event_type == "eMail") {
            color = "dodgerblue"
        } else if (data.timeline[i].event_type == "Misc") {
            color = "darksalmon"
        } else if (data.timeline[i].event_type == "C2") {
            color = "lightgrey"
        }

        entry = {
            from: source,
            to: destination,
            arrows: {
                enabled: true,
                type: 'vee',
                to: { enabled: true }
            },
            value: 1,
            smooth: "discrete",
            length: 300,
            color: {
                color: color
            },
            title: "<center><b>[" + data.timeline[i].event_type + "]</b> " + data.timeline[i].date_time + "<br><small>" + data.timeline[i].event_data + "</small></center>"
        }
        edges.push(entry)
    }

    // Build nodes array
    for (var i = 0; i < hosts.length;i++){
        entry = {
            id: i,
            label: "\n" + hosts[i] + "\n" + getHostIP(data.systems, hosts[i]),
            group: types[i]
        }
        nodes.push(entry)
    }

    result = {
        nodes: nodes,
        edges:edges
    }

    return result
}
Generates the data object for vis.js
@param data
@returns {{nodes: Array, edges: Array}|*}