remove global usage for wasm
ProxmoxAAS-Dashboard Code Style Check / lint-check (push) Successful in 16s
ProxmoxAAS-Dashboard Code Style Check / lint-check (push) Successful in 16s
This commit is contained in:
+1
-1
Submodule WFA-JS updated: f8f8636cc3...f53f344fb3
+1
-1
@@ -560,7 +560,7 @@ export default function init (path) {
|
|||||||
const wasm = obj.instance;
|
const wasm = obj.instance;
|
||||||
global.wfa = wasm
|
global.wfa = wasm
|
||||||
go.run(wasm);
|
go.run(wasm);
|
||||||
res()
|
res(wasm)
|
||||||
}
|
}
|
||||||
if ('instantiateStreaming' in WebAssembly) {
|
if ('instantiateStreaming' in WebAssembly) {
|
||||||
WebAssembly.instantiateStreaming(fetch(path), go.importObject).then(function (obj) {
|
WebAssembly.instantiateStreaming(fetch(path), go.importObject).then(function (obj) {
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ import wfaInit from "../modules/wfa.js";
|
|||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", init);
|
window.addEventListener("DOMContentLoaded", init);
|
||||||
|
|
||||||
|
var wfa;
|
||||||
|
|
||||||
async function init () {
|
async function init () {
|
||||||
setAppearance();
|
setAppearance();
|
||||||
|
|
||||||
wfaInit("modules/wfa.wasm");
|
wfa = await wfaInit("modules/wfa.wasm");
|
||||||
initInstances();
|
initInstances();
|
||||||
|
|
||||||
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
|
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
|
||||||
@@ -272,8 +274,8 @@ function sortInstances () {
|
|||||||
};
|
};
|
||||||
criteria = (item, query) => {
|
criteria = (item, query) => {
|
||||||
// lower is better
|
// lower is better
|
||||||
const { score, CIGAR } = global.wfa.wfAlign(query, item, penalties, true);
|
const { score, CIGAR } = wfa.wfAlign(query, item, penalties, true);
|
||||||
const alignment = global.wfa.DecodeCIGAR(CIGAR);
|
const alignment = wfa.DecodeCIGAR(CIGAR);
|
||||||
return { score: score / item.length, alignment };
|
return { score: score / item.length, alignment };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user