Commit c1bc5a86 authored by Lauri Himanen's avatar Lauri Himanen Committed by Markus Scheidgen
Browse files

Added support for visualizing structures without a unit cell, fixed issue in...

Added support for visualizing structures without a unit cell, fixed issue in the viewer not clearing out data from a previous visualization.
parent 23c63537
......@@ -4,7 +4,7 @@
"commit": "e98694e",
"private": true,
"dependencies": {
"@lauri-codes/materia": "0.0.7",
"@lauri-codes/materia": "0.0.9",
"@material-ui/core": "^4.0.0",
"@material-ui/icons": "^4.0.0",
"@material-ui/lab": "^4.0.0-alpha.49",
......
......@@ -46,8 +46,8 @@ export const unitsState = atom({
})
// Shared instance of the StructureViewer
const viewer = new StructureViewer()
const bzViewer = new BrillouinZoneViewer()
const viewer = new StructureViewer(undefined, {view: {autoResize: false}})
const bzViewer = new BrillouinZoneViewer(undefined, {view: {autoResize: false}})
// Contains details about the currently visualized system. Used to detect if a
// reload is needed for the StructureViewer.
......@@ -430,7 +430,7 @@ function Overview({section, def}) {
}
system = {
'species': section.atom_species,
'cell': convertSI(section.lattice_vectors, 'meter', {length: 'angstrom'}, false),
'cell': section.lattice_vectors ? convertSI(section.lattice_vectors, 'meter', {length: 'angstrom'}, false) : undefined,
'positions': convertSI(section.atom_positions, 'meter', {length: 'angstrom'}, false),
'pbc': section.configuration_periodic_dimensions
}
......
......@@ -157,7 +157,7 @@ export default function Structure({className, classes, system, options, viewer,
[1, 0, 0, 30]
]
}
}})
}}, false, false)
// Systems without cell are centered on the center of positions
} else {
refViewer.current.setOptions({layout: {
......@@ -168,7 +168,7 @@ export default function Structure({className, classes, system, options, viewer,
[1, 0, 0, 30]
]
}
}})
}}, false, false)
}
refViewer.current.load(system)
refViewer.current.fitToCanvas()
......
......@@ -1287,10 +1287,10 @@
resolved "https://registry.yarnpkg.com/@kyleshockey/object-assign-deep/-/object-assign-deep-0.4.2.tgz#84900f0eefc372798f4751b5262830b8208922ec"
integrity sha1-hJAPDu/DcnmPR1G1JigwuCCJIuw=
 
"@lauri-codes/materia@0.0.7":
version "0.0.7"
resolved "https://registry.yarnpkg.com/@lauri-codes/materia/-/materia-0.0.7.tgz#7580526874420641e26ab00bf0412d2a803d2cda"
integrity sha512-G3d4kRBNG4rYsLKceiW7Uhqy/uX0PFo70tsOIDZnOiNAICSIFF62LbYLDVHKgJf35xtyQM0kvM1WQGKgL9tmIw==
"@lauri-codes/materia@0.0.9":
version "0.0.9"
resolved "https://registry.yarnpkg.com/@lauri-codes/materia/-/materia-0.0.9.tgz#3ac8cac1b9ce8201a9e881afc0c5c6652c5a692a"
integrity sha512-qtY3pOWCKVG6z6iEs88vl/hqQNgK3tSCVNcAkSKFnuhk/Qdk66xHl7ZGVDMAOyqdXukNR2+iuZC/6CdFKc6/ow==
dependencies:
three "^0.119.1"
threejs-meshline "^2.0.11"
......
......@@ -10,5 +10,5 @@ git submodule update --init --jobs=4
pip install -e .[all]
nomad dev metainfo > gui/src/metainfo.json
nomad dev search-quantities > gui/src/search-quantities.json
nomad dev search-quantities > gui/src/searchQuantities.json
nomad dev units > gui/src/units.js
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment