Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Persistent camera orientation when modifying crystal structure #367

Open
1 task done
Abhivega opened this issue Sep 12, 2023 · 1 comment
Open
1 task done
Labels
feature request Feature request ux User experience

Comments

@Abhivega
Copy link

Email (Optional)

No response

Problem

In this example, if we rotate the visualized structure interactively and then swap the current structure for another one, the camera orientation is reset.

Proposed Solution

Is there a way to specify a desired view axis, or to make the camera view persistent when the structure is modified?

Alternatives

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mkhorton
Copy link
Member

Hi @Abhivega, a very reasonable request!

The underlying rendering code is currently a little messy, but to support this feature, a conditional on this.settings (perhaps, this.settings.resetCamera) would have to be added to this line:

https://github.com/materialsproject/mp-react-components/blob/5a54523c600919312929fd513ec93e39e680f5ef/src/components/crystal-toolkit/scene/Scene.ts#L493

and an appropriate default added here:

https://github.com/materialsproject/mp-react-components/blob/5a54523c600919312929fd513ec93e39e680f5ef/src/components/crystal-toolkit/scene/constants.ts#L51

I don't have time to add this myself at present, but pull requests very welcome.

@janosh janosh added feature request Feature request ux User experience labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request ux User experience
Projects
None yet
Development

No branches or pull requests

3 participants