pyiron / structuretoolkit

build, analyse and visualise atomistic structures for materials science
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

`plot3d` - go beyond NGLview #124

Open samwaseda opened 8 months ago

samwaseda commented 8 months ago

Currently we have to rely on NGLview for most of the functionalities, especially if we want to have different colours for a continuous value, or vectors. It's not only extremely slow, but it also doesn't give us the possibility to

So the functionalities should be extended with plotly

jan-janssen commented 8 months ago

But there is already a plotly part in the visualize module: https://github.com/pyiron/structuretoolkit/blob/main/structuretoolkit/visualize.py#L146

samwaseda commented 8 months ago

But there is already a plotly part in the visualize module:

I know, but the functionalities are a lot limited than NGLview

superstar54 commented 6 months ago

I opened an issue (#156) regarding adding weas-widget, and found it also related to this issue. weas-widget support coloring atoms by its attributes (charge, force, etc.), and it very fast.

from weas_widget import WeasWidget
import numpy as np
from ase.build import bulk

atoms = bulk('Au', cubic = True)
atoms *= [8, 8, 8]
charges = np.random.random(len(atoms))
atoms.set_array("charge", charges)

viewer = WeasWidget()
viewer.from_ase(atoms)
viewer.colorBy = "charge"
viewer.colorRamp = ["red", "yellow", "blue"]
viewer