10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-05 05:33:55 +01:00
QUESTDB_website/static/js/GeometriesLoader.js

17 lines
459 B
JavaScript
Raw Normal View History

2020-09-28 15:39:46 +02:00
class GeometriesLoader{
static async loadForAsync(array){
var xyzs=[]
for (const item of array) {
const mymol=mhchemCE.extract(item.molecule).toLowerCase().replace(" ","_")
const myset=item.set.split("#").join("")
try {
const mol=await Geometry.loadXYZAsync(`/${myset}/${mymol}.xyz`)
2020-11-19 23:56:04 +01:00
xyzs.push(mol)
2020-09-28 15:39:46 +02:00
} catch (error) {
console.error("Geometry not found",item)
2020-11-19 23:56:04 +01:00
}
2020-09-28 15:39:46 +02:00
}
return xyzs.flat()
}
2020-11-19 23:56:04 +01:00
}