-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
viewer.cameraSetting = {"direction": [0, 2, 1], "zoom": 0.8}
- Loading branch information
1 parent
b138419
commit 43d39f7
Showing
20 changed files
with
202 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sphinx_rtd_theme==1.2.2 | ||
nbsphinx==0.9.2 | ||
sphinx_rtd_theme==2.0.0 | ||
nbsphinx==0.9.3 | ||
ipython | ||
ase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
=================== | ||
Camera | ||
=================== | ||
|
||
Setting | ||
============= | ||
|
||
One can set the direction and zoom of the camera: | ||
|
||
.. code-block:: python | ||
viewer.cameraSetting = {"direction": [0, 5, 1], "zoom": 2} | ||
Camera Type | ||
============= | ||
|
||
For the moment, only orthographic camera is supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// clone the weas repo and import the weas module | ||
// import * as weas from "../../weas/src/index.js"; | ||
// if not, then use the release version from unpkg | ||
import * as weas from "https://unpkg.com/[email protected]a/dist/weas.mjs"; | ||
import * as weas from "https://unpkg.com/[email protected]b/dist/weas.mjs"; | ||
import "./widget.css"; | ||
|
||
|
||
|
@@ -60,7 +60,9 @@ function render({ model, el }) { | |
avr.showVectorField = model.get("showVectorField") | ||
// mesh primitives | ||
avr.meshPrimitive.fromSettings(model.get("meshPrimitives")); | ||
|
||
// camera settings | ||
const cameraSetting = model.get("cameraSetting"); | ||
avr.tjs.updateCameraAndControls(cameraSetting); | ||
avr.drawModels(); | ||
avr.render(); | ||
return avr; | ||
|
@@ -86,9 +88,6 @@ function render({ model, el }) { | |
case "downloadImage": | ||
avr.tjs.downloadImage(task.kwargs.filename); | ||
break; | ||
case "setCameraPosition": | ||
avr.tjs.updateCameraAndControls(avr.atoms.getCenterOfGeometry(), task.kwargs.position); | ||
break; | ||
} | ||
} | ||
run_task(task); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build" | |
|
||
[project] | ||
name = "weas_widget" | ||
version = "0.0.13" | ||
version = "0.0.14" | ||
description = "A widget to visualize and interact with atomistic structures in Jupyter Notebook." | ||
authors = [{name = "Xing Wang", email = "[email protected]"}] | ||
readme = "README.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.