cosmol-viewer 0.1.1.dev2__tar.gz → 0.1.1.dev4__tar.gz
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.
Potentially problematic release.
This version of cosmol-viewer might be problematic. Click here for more details.
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/Cargo.lock +5 -5
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/Cargo.toml +1 -1
- cosmol_viewer-0.1.1.dev4/PKG-INFO +58 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/parser/sdf.rs +68 -11
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/canvas.rs +2 -5
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shapes/molecules.rs +3 -6
- cosmol_viewer-0.1.1.dev4/crates/python/README.md +51 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/python/src/lib.rs +0 -2
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/python/src/shapes.rs +5 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/pyproject.toml +2 -1
- cosmol_viewer-0.1.1.dev2/PKG-INFO +0 -5
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/Cargo.toml +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/lib.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/parser/mod.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/scene.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/bg_fragment.glsl +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/bg_vertex.glsl +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/fragment.glsl +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/mod.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/vertex.glsl +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shapes/mod.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shapes/sphere.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shapes/stick.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/utils.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/python/Cargo.toml +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/python/build.rs +0 -0
- {cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/python/src/parser.rs +0 -0
|
@@ -699,7 +699,7 @@ dependencies = [
|
|
|
699
699
|
|
|
700
700
|
[[package]]
|
|
701
701
|
name = "cosmol_viewer"
|
|
702
|
-
version = "0.1.1-nightly.
|
|
702
|
+
version = "0.1.1-nightly.4"
|
|
703
703
|
dependencies = [
|
|
704
704
|
"bytemuck",
|
|
705
705
|
"cosmol_viewer_core",
|
|
@@ -717,7 +717,7 @@ dependencies = [
|
|
|
717
717
|
|
|
718
718
|
[[package]]
|
|
719
719
|
name = "cosmol_viewer_core"
|
|
720
|
-
version = "0.1.1-nightly.
|
|
720
|
+
version = "0.1.1-nightly.4"
|
|
721
721
|
dependencies = [
|
|
722
722
|
"bytemuck",
|
|
723
723
|
"eframe",
|
|
@@ -731,7 +731,7 @@ dependencies = [
|
|
|
731
731
|
|
|
732
732
|
[[package]]
|
|
733
733
|
name = "cosmol_viewer_gui"
|
|
734
|
-
version = "0.1.1-nightly.
|
|
734
|
+
version = "0.1.1-nightly.4"
|
|
735
735
|
dependencies = [
|
|
736
736
|
"bytemuck",
|
|
737
737
|
"cosmol_viewer_core",
|
|
@@ -765,7 +765,7 @@ dependencies = [
|
|
|
765
765
|
|
|
766
766
|
[[package]]
|
|
767
767
|
name = "cosmol_viewer_wasm"
|
|
768
|
-
version = "0.1.1-nightly.
|
|
768
|
+
version = "0.1.1-nightly.4"
|
|
769
769
|
dependencies = [
|
|
770
770
|
"cosmol_viewer_core",
|
|
771
771
|
"eframe",
|
|
@@ -3160,7 +3160,7 @@ dependencies = [
|
|
|
3160
3160
|
|
|
3161
3161
|
[[package]]
|
|
3162
3162
|
name = "test"
|
|
3163
|
-
version = "0.1.1-nightly.
|
|
3163
|
+
version = "0.1.1-nightly.4"
|
|
3164
3164
|
dependencies = [
|
|
3165
3165
|
"cosmol_viewer",
|
|
3166
3166
|
"cosmol_viewer_core",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cosmol-viewer
|
|
3
|
+
Version: 0.1.1.dev4
|
|
4
|
+
Summary: Molecular visualization tools
|
|
5
|
+
Author-email: 95028 <wjt@cosmol.org>
|
|
6
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
7
|
+
|
|
8
|
+
# COSMol-viewer
|
|
9
|
+
|
|
10
|
+
A high-performance molecular visualization library built with Rust and WebGPU, designed for seamless integration into Python workflows.
|
|
11
|
+
|
|
12
|
+
- ⚡ Fast: Native-speed rendering powered by Rust and GPU acceleration
|
|
13
|
+
|
|
14
|
+
- 🧬 Flexible: Load molecules from .sdf, .pdb, and dynamically update 3D structures
|
|
15
|
+
|
|
16
|
+
- 📓 Notebook-friendly: Fully supports Jupyter and Google Colab — ideal for education, research, and live demos
|
|
17
|
+
|
|
18
|
+
- 🔁 Real-time updates: Update molecular coordinates on-the-fly for simulations or animations
|
|
19
|
+
|
|
20
|
+
- 🎨 Customizable: Control styles, camera, and rendering settings programmatically
|
|
21
|
+
|
|
22
|
+
# Installation
|
|
23
|
+
|
|
24
|
+
install with
|
|
25
|
+
```sh
|
|
26
|
+
pip install cosmol-viewer==0.1.1.dev4
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# Usage
|
|
30
|
+
|
|
31
|
+
python:
|
|
32
|
+
```python
|
|
33
|
+
from cosmol_viewer import Scene, Viewer, parse_sdf, Molecules
|
|
34
|
+
|
|
35
|
+
# === Step 1: Load and render a molecule ===
|
|
36
|
+
with open("molecule.sdf", "r") as f:
|
|
37
|
+
sdf = f.read()
|
|
38
|
+
mol = Molecules(parse_sdf(sdf)).centered()
|
|
39
|
+
|
|
40
|
+
scene = Scene.create_viewer()
|
|
41
|
+
scene.scale(0.1)
|
|
42
|
+
scene.add_shape(mol, "mol")
|
|
43
|
+
|
|
44
|
+
viewer = Viewer.render(scene) # Launch the viewer
|
|
45
|
+
|
|
46
|
+
# === Step 2: Update the same molecule dynamically ===
|
|
47
|
+
import time
|
|
48
|
+
|
|
49
|
+
for i in range(1, 10): # Simulate multiple frames
|
|
50
|
+
with open(f"frames/frame_{i}.sdf", "r") as f:
|
|
51
|
+
sdf = f.read()
|
|
52
|
+
updated_mol = Molecules(parse_sdf(sdf)).centered()
|
|
53
|
+
|
|
54
|
+
scene.update_shape("mol", updated_mol)
|
|
55
|
+
viewer.update(scene)
|
|
56
|
+
|
|
57
|
+
time.sleep(0.033) # ~30 FPS
|
|
58
|
+
```
|
|
@@ -14,7 +14,7 @@ pub struct Atom {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
pub type Molecule = Vec<Atom>;
|
|
17
|
-
pub type MoleculeData
|
|
17
|
+
pub type MoleculeData = Vec<Molecule>;
|
|
18
18
|
|
|
19
19
|
#[derive(Default)]
|
|
20
20
|
pub struct ParserOptions {
|
|
@@ -23,7 +23,7 @@ pub struct ParserOptions {
|
|
|
23
23
|
pub onemol: bool,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
pub fn parse_sdf(sdf: &str, options: &ParserOptions) -> MoleculeData
|
|
26
|
+
pub fn parse_sdf(sdf: &str, options: &ParserOptions) -> MoleculeData {
|
|
27
27
|
let lines: Vec<&str> = sdf.lines().collect();
|
|
28
28
|
if lines.len() > 3 && lines[3].len() > 38 {
|
|
29
29
|
let version = lines[3][34..39].trim();
|
|
@@ -36,7 +36,22 @@ pub fn parse_sdf(sdf: &str, options: &ParserOptions) -> MoleculeData {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
fn parse_v2000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData
|
|
39
|
+
fn parse_v2000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
40
|
+
let model_count = count_models(&lines);
|
|
41
|
+
// 多个分子但用户没开启
|
|
42
|
+
if model_count > 0 && !options.multimodel {
|
|
43
|
+
panic!(
|
|
44
|
+
"Found multiple molecules but 'multimodel' is false. Please enable 'multimodel = true' to parse all molecules."
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 用户开启了但其实只有一个
|
|
49
|
+
if model_count == 0 && options.multimodel {
|
|
50
|
+
panic!(
|
|
51
|
+
"Only one molecule found, but 'multimodel = true' was set. Consider setting 'multimodel = false' to avoid confusion."
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
let mut molecules = vec![vec![]];
|
|
41
56
|
let mut current = 0;
|
|
42
57
|
|
|
@@ -80,10 +95,21 @@ fn parse_v2000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
|
80
95
|
|
|
81
96
|
for i in 0..bond_count {
|
|
82
97
|
let line = lines[offset + i];
|
|
83
|
-
let from = line[0..3]
|
|
84
|
-
|
|
98
|
+
let from = line[0..3]
|
|
99
|
+
.trim()
|
|
100
|
+
.parse::<usize>()
|
|
101
|
+
.unwrap_or(0)
|
|
102
|
+
.saturating_sub(1);
|
|
103
|
+
let to = line[3..6]
|
|
104
|
+
.trim()
|
|
105
|
+
.parse::<usize>()
|
|
106
|
+
.unwrap_or(0)
|
|
107
|
+
.saturating_sub(1);
|
|
85
108
|
let order = line[6..].trim().parse::<f32>().unwrap_or(1.0);
|
|
86
|
-
if let (Some(f), Some(t)) = (
|
|
109
|
+
if let (Some(f), Some(t)) = (
|
|
110
|
+
serial_to_index.get(from).and_then(|x| *x),
|
|
111
|
+
serial_to_index.get(to).and_then(|x| *x),
|
|
112
|
+
) {
|
|
87
113
|
molecules[current][f].bonds.push(t);
|
|
88
114
|
molecules[current][f].bond_order.push(order);
|
|
89
115
|
molecules[current][t].bonds.push(f);
|
|
@@ -109,7 +135,23 @@ fn parse_v2000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
|
109
135
|
molecules
|
|
110
136
|
}
|
|
111
137
|
|
|
112
|
-
fn parse_v3000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData
|
|
138
|
+
fn parse_v3000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
139
|
+
let model_count = count_models(&lines);
|
|
140
|
+
|
|
141
|
+
// 多个分子但用户没开启
|
|
142
|
+
if model_count > 0 && !options.multimodel {
|
|
143
|
+
panic!(
|
|
144
|
+
"Found multiple molecules but 'multimodel' is false. Please enable 'multimodel = true' to parse all molecules."
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 用户开启了但其实只有一个
|
|
149
|
+
if model_count == 0 && options.multimodel {
|
|
150
|
+
panic!(
|
|
151
|
+
"Only one molecule found, but 'multimodel = true' was set. Consider setting 'multimodel = false' to avoid confusion."
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
113
155
|
let mut molecules = vec![vec![]];
|
|
114
156
|
let mut current = 0;
|
|
115
157
|
|
|
@@ -119,8 +161,14 @@ fn parse_v3000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
|
119
161
|
}
|
|
120
162
|
|
|
121
163
|
let counts: Vec<_> = lines[5][13..].split_whitespace().collect();
|
|
122
|
-
let atom_count = counts
|
|
123
|
-
|
|
164
|
+
let atom_count = counts
|
|
165
|
+
.get(0)
|
|
166
|
+
.and_then(|s| s.parse::<usize>().ok())
|
|
167
|
+
.unwrap_or(0);
|
|
168
|
+
let bond_count = counts
|
|
169
|
+
.get(1)
|
|
170
|
+
.and_then(|s| s.parse::<usize>().ok())
|
|
171
|
+
.unwrap_or(0);
|
|
124
172
|
let mut offset = 7;
|
|
125
173
|
|
|
126
174
|
let mut serial_to_index = vec![None; atom_count];
|
|
@@ -161,7 +209,10 @@ fn parse_v3000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
|
161
209
|
let from = parts[2].parse::<usize>().unwrap_or(0).saturating_sub(1);
|
|
162
210
|
let to = parts[3].parse::<usize>().unwrap_or(0).saturating_sub(1);
|
|
163
211
|
let order = parts[1].parse::<f32>().unwrap_or(1.0);
|
|
164
|
-
if let (Some(f), Some(t)) = (
|
|
212
|
+
if let (Some(f), Some(t)) = (
|
|
213
|
+
serial_to_index.get(from).and_then(|x| *x),
|
|
214
|
+
serial_to_index.get(to).and_then(|x| *x),
|
|
215
|
+
) {
|
|
165
216
|
molecules[current][f].bonds.push(t);
|
|
166
217
|
molecules[current][f].bond_order.push(order);
|
|
167
218
|
molecules[current][t].bonds.push(f);
|
|
@@ -191,7 +242,13 @@ fn parse_v3000(mut lines: Vec<&str>, options: &ParserOptions) -> MoleculeData {
|
|
|
191
242
|
fn capitalize(s: &str) -> String {
|
|
192
243
|
let mut chars = s.chars();
|
|
193
244
|
match chars.next() {
|
|
194
|
-
Some(first) =>
|
|
245
|
+
Some(first) => {
|
|
246
|
+
first.to_ascii_uppercase().to_string() + &chars.as_str().to_ascii_lowercase()
|
|
247
|
+
}
|
|
195
248
|
None => String::new(),
|
|
196
249
|
}
|
|
197
250
|
}
|
|
251
|
+
|
|
252
|
+
fn count_models(lines: &[&str]) -> usize {
|
|
253
|
+
lines.iter().filter(|line| line.trim() == "$$$$").count()
|
|
254
|
+
}
|
|
@@ -39,7 +39,6 @@ impl Canvas {
|
|
|
39
39
|
// 正值表示向上滚动,通常是“缩小”,负值是放大
|
|
40
40
|
if scroll_delta != 0.0 {
|
|
41
41
|
self.camera_state.scale *= (1.0 + scroll_delta * 0.001).clamp(0.1, 10.0);
|
|
42
|
-
println!("scale {:?}", self.camera_state.scale);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
self.camera_state = rotate_camera(self.camera_state, response.drag_motion());
|
|
@@ -289,15 +288,13 @@ impl Shader {
|
|
|
289
288
|
for mesh in scene_data._get_meshes() {
|
|
290
289
|
self.vertex3d
|
|
291
290
|
.extend(mesh.vertices.iter().enumerate().map(|(i, pos)| {
|
|
292
|
-
let mut j = i;
|
|
293
|
-
j = i % 50;
|
|
294
291
|
Vertex3d {
|
|
295
292
|
position: *pos,
|
|
296
293
|
normal: mesh.normals[i],
|
|
297
294
|
color: mesh
|
|
298
295
|
.colors
|
|
299
296
|
.as_ref()
|
|
300
|
-
.and_then(|colors| colors.get(
|
|
297
|
+
.and_then(|colors| colors.get(i))
|
|
301
298
|
.unwrap_or(&[1.0, 1.0, 1.0, 1.0])
|
|
302
299
|
.clone(),
|
|
303
300
|
}
|
|
@@ -524,7 +521,7 @@ pub fn rotate_camera(mut camera_state: CameraState, drag_motion: Vec2) -> Camera
|
|
|
524
521
|
pub struct Vertex3d {
|
|
525
522
|
pub position: [f32; 3],
|
|
526
523
|
pub normal: [f32; 3],
|
|
527
|
-
pub color: [f32; 4],
|
|
524
|
+
pub color: [f32; 4],
|
|
528
525
|
}
|
|
529
526
|
|
|
530
527
|
#[repr(C)]
|
|
@@ -210,10 +210,7 @@ impl Molecules {
|
|
|
210
210
|
let radius = self.atom_types.get(i).unwrap_or(&AtomType::Unknown).radius() * 0.2;
|
|
211
211
|
let color = self.atom_types.get(i).unwrap_or(&AtomType::Unknown).color();
|
|
212
212
|
|
|
213
|
-
println!("atom: {}, color: {:?}, radius: {}", i, color, radius);
|
|
214
|
-
|
|
215
213
|
let mut sphere = Sphere::new(*pos, radius);
|
|
216
|
-
sphere.style = self.style; // 继承样式
|
|
217
214
|
sphere.interaction = self.interaction;
|
|
218
215
|
sphere = sphere.color(color);
|
|
219
216
|
|
|
@@ -226,7 +223,7 @@ impl Molecules {
|
|
|
226
223
|
for n in mesh.normals {
|
|
227
224
|
normals.push(n.map(|x| x * scale));
|
|
228
225
|
}
|
|
229
|
-
for c in mesh.colors.
|
|
226
|
+
for c in mesh.colors.unwrap() {
|
|
230
227
|
colors.push(c);
|
|
231
228
|
}
|
|
232
229
|
for idx in mesh.indices {
|
|
@@ -243,8 +240,8 @@ impl Molecules {
|
|
|
243
240
|
let pos_b = self.atoms[b as usize];
|
|
244
241
|
|
|
245
242
|
let mut stick = Stick::new(pos_a, pos_b, 0.1); // or radius by bond type
|
|
246
|
-
stick.style = self.style;
|
|
247
243
|
stick.interaction = self.interaction;
|
|
244
|
+
stick = stick.color([0.5, 0.5, 0.5]);
|
|
248
245
|
|
|
249
246
|
let mesh = stick.to_mesh(1.0);
|
|
250
247
|
|
|
@@ -254,7 +251,7 @@ impl Molecules {
|
|
|
254
251
|
for n in mesh.normals {
|
|
255
252
|
normals.push(n.map(|x| x * scale));
|
|
256
253
|
}
|
|
257
|
-
for c in mesh.colors.
|
|
254
|
+
for c in mesh.colors.unwrap() {
|
|
258
255
|
colors.push(c);
|
|
259
256
|
}
|
|
260
257
|
for idx in mesh.indices {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# COSMol-viewer
|
|
2
|
+
|
|
3
|
+
A high-performance molecular visualization library built with Rust and WebGPU, designed for seamless integration into Python workflows.
|
|
4
|
+
|
|
5
|
+
- ⚡ Fast: Native-speed rendering powered by Rust and GPU acceleration
|
|
6
|
+
|
|
7
|
+
- 🧬 Flexible: Load molecules from .sdf, .pdb, and dynamically update 3D structures
|
|
8
|
+
|
|
9
|
+
- 📓 Notebook-friendly: Fully supports Jupyter and Google Colab — ideal for education, research, and live demos
|
|
10
|
+
|
|
11
|
+
- 🔁 Real-time updates: Update molecular coordinates on-the-fly for simulations or animations
|
|
12
|
+
|
|
13
|
+
- 🎨 Customizable: Control styles, camera, and rendering settings programmatically
|
|
14
|
+
|
|
15
|
+
# Installation
|
|
16
|
+
|
|
17
|
+
install with
|
|
18
|
+
```sh
|
|
19
|
+
pip install cosmol-viewer==0.1.1.dev4
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
# Usage
|
|
23
|
+
|
|
24
|
+
python:
|
|
25
|
+
```python
|
|
26
|
+
from cosmol_viewer import Scene, Viewer, parse_sdf, Molecules
|
|
27
|
+
|
|
28
|
+
# === Step 1: Load and render a molecule ===
|
|
29
|
+
with open("molecule.sdf", "r") as f:
|
|
30
|
+
sdf = f.read()
|
|
31
|
+
mol = Molecules(parse_sdf(sdf)).centered()
|
|
32
|
+
|
|
33
|
+
scene = Scene.create_viewer()
|
|
34
|
+
scene.scale(0.1)
|
|
35
|
+
scene.add_shape(mol, "mol")
|
|
36
|
+
|
|
37
|
+
viewer = Viewer.render(scene) # Launch the viewer
|
|
38
|
+
|
|
39
|
+
# === Step 2: Update the same molecule dynamically ===
|
|
40
|
+
import time
|
|
41
|
+
|
|
42
|
+
for i in range(1, 10): # Simulate multiple frames
|
|
43
|
+
with open(f"frames/frame_{i}.sdf", "r") as f:
|
|
44
|
+
sdf = f.read()
|
|
45
|
+
updated_mol = Molecules(parse_sdf(sdf)).centered()
|
|
46
|
+
|
|
47
|
+
scene.update_shape("mol", updated_mol)
|
|
48
|
+
viewer.update(scene)
|
|
49
|
+
|
|
50
|
+
time.sleep(0.033) # ~30 FPS
|
|
51
|
+
```
|
|
@@ -138,8 +138,6 @@ impl Viewer {
|
|
|
138
138
|
|
|
139
139
|
#[staticmethod]
|
|
140
140
|
pub fn render(scene: &Scene, py: Python) -> Self {
|
|
141
|
-
println!("scene {}", serde_json::to_string(&scene.inner).unwrap());
|
|
142
|
-
|
|
143
141
|
let env_type = detect_runtime_env(py).unwrap();
|
|
144
142
|
match env_type {
|
|
145
143
|
RuntimeEnv::Colab | RuntimeEnv::Jupyter => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cosmol-viewer"
|
|
3
|
-
version = "0.1.1.
|
|
3
|
+
version = "0.1.1.dev4"
|
|
4
4
|
description = "Molecular visualization tools"
|
|
5
5
|
authors = [{name = "95028", email = "wjt@cosmol.org"}]
|
|
6
|
+
repository = "https://github.com/COSMol-repl/COSMol-viewer"
|
|
6
7
|
|
|
7
8
|
[build-system]
|
|
8
9
|
requires = ["maturin>=1.0,<2.0"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cosmol_viewer-0.1.1.dev2 → cosmol_viewer-0.1.1.dev4}/crates/core/src/shader/bg_fragment.glsl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|