Skip to content

Commit

Permalink
Add factor to scale the length of the arrows in vector field
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Nov 7, 2024
1 parent 20d911a commit d66f49c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/source/vector_field.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ One can visualize the phonon dispersion via lattice vibrations. One only need to
[[0, 0], [0, 0], [-0.5, 0]]]
),
"kpoint": [0, 0, 0], # optional
"amplitude": 5,
"amplitude": 5, # scale the motion of the atoms
"factor": 1.5, # scale the length of the arrows
"nframes": 20,
"repeat": [4, 4, 1],
"color": "blue",
Expand Down
10 changes: 2 additions & 8 deletions js/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function render({ model, el }) {
_currentFrame: model.get("currentFrame"),
};
editor = new weas.WEAS({ domElement, atoms, viewerConfig, guiConfig });
window.editor = editor; // for debugging
// window.editor = editor; // for debugging
editor.avr.selectedAtomsIndices = model.get("selectedAtomsIndices");
// editor.avr.atomScales = model.get("atomScales");
// editor.avr.modelSticks = model.get("modelSticks");
Expand Down Expand Up @@ -82,14 +82,8 @@ function render({ model, el }) {
// if phone is not empty object, then create phonon mode
if (Object.keys(phonon).length > 0) {
editor.avr.fromPhononMode({
...phonon,
atoms: atoms,
eigenvectors: phonon.eigenvectors,
amplitude: phonon.amplitude,
nframes: phonon.nframes,
kpoint: phonon.kpoint,
repeat: phonon.repeat,
color: phonon.color,
radius: phonon.radius,
});
}
// camera settings
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"dat.gui": "^0.7.9",
"three": "^0.161.0",
"weas": ">=0.1.30"
"weas": ">=0.1.31"
},
"devDependencies": {
"esbuild": "^0.20.0"
Expand Down

0 comments on commit d66f49c

Please sign in to comment.