@juliocesar-io/nano-protein-viewer-react 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/index +7309 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.esm +90737 -0
- package/dist/style.css +1 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Julio Castellanos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Nano Protein Viewer React
|
|
2
|
+
|
|
3
|
+
A lightweight, extensible React implementation of the **Nano Protein Viewer**, originally developed as a VSCode extension by [**Steven Yu**](https://marketplace.visualstudio.com/items?itemName=StevenYu.nano-protein-viewer).
|
|
4
|
+
|
|
5
|
+
This project brings the Mol\*-powered molecular visualization experience to the web enabling integration into any React or Next.js application.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## 🚀 Quick start
|
|
10
|
+
|
|
11
|
+
**Install dependencies**
|
|
12
|
+
|
|
13
|
+
Run locally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
npm run dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Go to: http://localhost:5173
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
**Passing structures by URL**
|
|
24
|
+
|
|
25
|
+
You can define your own logic from a list of structures in src/App.tsx:
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import type { StructureUrl } from '@types';
|
|
30
|
+
|
|
31
|
+
const exampleUrls: StructureUrl[] = [
|
|
32
|
+
{
|
|
33
|
+
name: 'AF-A0A2K6V5L6-F1',
|
|
34
|
+
url: 'https://alphafold.ebi.ac.uk/files/AF-A0A2K6V5L6-F1-model_v6.cif',
|
|
35
|
+
format: 'mmcif',
|
|
36
|
+
style: {
|
|
37
|
+
illustrative: true,
|
|
38
|
+
surface: { enabled: true, opacity: 8, inherit: true }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: '1CRN',
|
|
43
|
+
url: 'https://files.rcsb.org/download/1CRN.pdb',
|
|
44
|
+
format: 'pdb',
|
|
45
|
+
style: {
|
|
46
|
+
colorMode: 'secondary',
|
|
47
|
+
customColor: '#4ECDC4',
|
|
48
|
+
illustrative: false,
|
|
49
|
+
surface: { enabled: true, opacity: 40, inherit: true }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
```
|
|
54
|
+
Then render them in your app:
|
|
55
|
+
```ts
|
|
56
|
+
import { NanoProteinViewer } from '@components/NanoProteinViewer';
|
|
57
|
+
|
|
58
|
+
<NanoProteinViewer structureUrls={exampleUrls} />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Design Rationale
|
|
62
|
+
|
|
63
|
+
This React app:
|
|
64
|
+
|
|
65
|
+
- Decouples the viewer logic into reusable components
|
|
66
|
+
- Enables embedding in research dashboards, notebooks, or web portals
|
|
67
|
+
- Provides a base to extend features (grid view, color themes, External API integration) gradually
|
|
68
|
+
- Allows server-side frameworks (Next.js, Remix, Vite) to integrate molecular viewers easily
|
|
69
|
+
|
|
70
|
+
## License & Attribution
|
|
71
|
+
|
|
72
|
+
This project is released under the MIT License.
|
|
73
|
+
|
|
74
|
+
Adapted and inspired by the [Nano Protein Viewer VSCode Extension](https://github.com/54yyyu/nano-protein-viewer) by Steven Yu.
|
|
75
|
+
|
|
76
|
+
Mol* framework © Mol* team – see citation below.
|
|
77
|
+
|
|
78
|
+
## Citation
|
|
79
|
+
|
|
80
|
+
If you use this viewer or the underlying Mol* visualization engine in academic work:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
@article{sehnal2021molstar,
|
|
84
|
+
author = {Sehnal, David and Bittrich, Sebastian and Deshpande, Mandar and Svobodová, Radka and Berka, Karel and Bazgier, Václav and Velankar, Sameer and Burley, Stephen K and Koča, Jaroslav and Rose, Alexander S},
|
|
85
|
+
title = "{Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures}",
|
|
86
|
+
journal = {Nucleic Acids Research},
|
|
87
|
+
volume = {49},
|
|
88
|
+
number = {W1},
|
|
89
|
+
pages = {W431-W437},
|
|
90
|
+
year = {2021},
|
|
91
|
+
doi = {10.1093/nar/gkab314}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
|
|
97
|
+
Contributions are welcome!
|
|
98
|
+
If you’ve added a visualization mode, folding integration, or UI control, please open a PR.
|
|
99
|
+
|
|
100
|
+
The roadmap includes:
|
|
101
|
+
- APIs integration for folding
|
|
102
|
+
- Structure alignment
|
|
103
|
+
- Animation playback
|
|
104
|
+
- Alphafold DB/ RCSB PDB search import
|
|
105
|
+
|