FRAGMENTS_RENDERING_TEMPLATE = """
""" TARGET_RENDERING_TEMPLATE = """
""" FRAGMENTS_AND_TARGET_RENDERING_TEMPLATE = """
""" SAMPLES_RENDERING_TEMPLATE = """

""" SAMPLES_WITH_TARGET_RENDERING_TEMPLATE = """

""" INVALID_FORMAT_MSG = """

Invalid file format: {extension}

Allowed formats for the fragments file: Allowed formats for the optional protein file: """ ERROR_FORMAT_MSG = """

Error:

{message} """ IFRAME_TEMPLATE = """""" STARTUP_JS = """ () => { window.selected_elements = {} function handleMessage(event) { if (event.data.name == "atom_selection") { console.log("New message: ", event.data) let atom = event.data.data["atom"]; let add = event.data.data["add"]; console.log("add: ", add, " atom: ", atom); window.selected_elements[atom] = add; } } window.addEventListener("message", handleMessage); console.log("Listener Added"); console.log(window.selected_elements); } """ RETURN_SELECTION_JS = """ (input_file, input_protein_file, n_steps, n_atoms, n_samples, hidden) => { let selected = [] for (const [atom, add] of Object.entries(window.selected_elements)) { if (add) { console.log("Adding atom ", atom); selected.push(String(atom)); //window.parent.postMessage({ // name: "atom_selection", // data: {"atom": parseInt(atom), "add": false} //}, "*"); } } console.log("Finished parsing"); console.log(window.selected_elements); window.selected_elements = {} console.log(window.selected_elements); return [input_file, input_protein_file, n_steps, n_atoms, n_samples, selected.join(",")]; } """