Skip to content

Commit

Permalink
Draw bonds computed by ASE (#535)
Browse files Browse the repository at this point in the history
In nglview, if a system is too big bonds will not be computed.
I bypass the "ball+stick" representation defining it as "spacefill" plus shapes that are computed via `ase` connectivity matrix.
It can now draw a large system, tested with plotting ~1000 atoms. The performance is taken care of as well to render the atom plot fast.

---------

Co-authored-by: Carlo <c.pignedoli@gmail.com>
Co-authored-by: Xing Wang <xingwang1991@gmail.com>
  • Loading branch information
3 people committed Nov 17, 2023
1 parent f403330 commit ca8322d
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 87 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ jobs:
- name: Check out app
uses: actions/checkout@v4

- name: Install povray
run: sudo apt-get install povray

- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
18 changes: 18 additions & 0 deletions aiidalab_widgets_base/dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,21 @@
"Hs": 1.75,
"Mt": 1.75,
}

RGB_COLORS = {
"red": (1, 0, 0),
"green": (0, 1, 0),
"blue": (0, 0, 1),
"yellow": (1, 1, 0),
"cyan": (0, 1, 1),
"magenta": (1, 0, 1),
"white": (1, 1, 1),
"black": (0, 0, 0),
"grey": (0.5, 0.5, 0.5),
"purple": (0.5, 0, 0.5),
"orange": (1, 0.5, 0),
"brown": (0.5, 0.25, 0),
"pink": (1, 0.75, 0.8),
"lime": (0.75, 1, 0),
"olive": (0.5, 0.5, 0),
}
Loading

0 comments on commit ca8322d

Please sign in to comment.