async function search()

in web/js/main.js [270:307]


async function search(partition) {

    let searchResult
    try {
        searchResult = await post("search-post", {}, partition)
    } catch (ex) {
        console.error(ex)
        searchResult = {}
    }
    // console.log(JSON.stringify(searchResult))

    // const data = generateTestData()
    document.getElementById("canvas-container").style.display = "block"
    document.getElementById("grid-container").style.display = "none"
    document.getElementById("parts-container").style.display = "none"

    document.getElementById("current-partition").innerHTML = ": " + partition

    const canvas = document.getElementById("canvas")
    // const ctx = canvas.getContext("2d")
    // console.info("Starting transform", ctx.getTransform())

    const graph = {
        canvas,
        data: searchResult,
        offset: {
            x: 0,
            y: 0,
        },
        partition,
    }

    initConstants(graph)
    populateLabelColors(graph)
    initEvents(graph)
    render(graph, true)

}