igashov commited on
Commit
cd2152f
1 Parent(s): a68ab98

Always zoom to fragments

Browse files
Files changed (2) hide show
  1. app.py +0 -1
  2. output.py +5 -5
app.py CHANGED
@@ -178,7 +178,6 @@ def clear_protein_input(in_fragments):
178
 
179
 
180
  def click_on_example(example):
181
- print('Clicked:', example)
182
  fragment_fname, target_fname = example
183
  fragment_path = f'examples/{fragment_fname}' if fragment_fname != '' else None
184
  target_path = f'examples/{target_fname}' if target_fname != '' else None
 
178
 
179
 
180
  def click_on_example(example):
 
181
  fragment_fname, target_fname = example
182
  fragment_path = f'examples/{fragment_fname}' if fragment_fname != '' else None
183
  target_path = f'examples/{target_fname}' if target_fname != '' else None
output.py CHANGED
@@ -53,7 +53,7 @@ FRAGMENTS_RENDERING_TEMPLATE = """<!DOCTYPE html>
53
  }}
54
  );
55
 
56
- viewer.zoomTo();
57
  viewer.zoom(0.7);
58
  viewer.render();
59
  }});
@@ -91,7 +91,7 @@ TARGET_RENDERING_TEMPLATE = """<!DOCTYPE html>
91
  viewer.addModel(`{molecule}`, "{fmt}");
92
  viewer.getModel(0).setStyle(proteinStyle);
93
 
94
- viewer.zoomTo();
95
  viewer.zoom(0.7);
96
  viewer.render();
97
  }});
@@ -159,7 +159,7 @@ FRAGMENTS_AND_TARGET_RENDERING_TEMPLATE = """<!DOCTYPE html>
159
  viewer.addModel(`{target}`, "{target_fmt}");
160
  viewer.getModel(1).setStyle(proteinStyle);
161
 
162
- viewer.zoomTo();
163
  viewer.zoom(0.7);
164
  viewer.render();
165
  }});
@@ -203,7 +203,7 @@ SAMPLES_RENDERING_TEMPLATE = """<!DOCTYPE html>
203
  viewer.getModel().hide();
204
  viewer.addModel(`{molecule}`, "{molecule_fmt}")
205
  viewer.getModel().setStyle({{ stick: {{ colorscheme:"greenCarbon" }} }})
206
- viewer.zoomTo();
207
  viewer.zoom(0.7);
208
  viewer.render();
209
  }});
@@ -263,7 +263,7 @@ SAMPLES_WITH_TARGET_RENDERING_TEMPLATE = """<!DOCTYPE html>
263
  viewer.addModel(`{target}`, "{target_fmt}")
264
  viewer.getModel(2).setStyle({{ cartoon: {{ colorscheme: "ssPyMOL" }} }})
265
 
266
- viewer.zoomTo();
267
  viewer.zoom(0.7);
268
  viewer.render();
269
  }});
 
53
  }}
54
  );
55
 
56
+ viewer.zoomTo({{ "model": 0 }});
57
  viewer.zoom(0.7);
58
  viewer.render();
59
  }});
 
91
  viewer.addModel(`{molecule}`, "{fmt}");
92
  viewer.getModel(0).setStyle(proteinStyle);
93
 
94
+ viewer.zoomTo({{ "model": 0 }});
95
  viewer.zoom(0.7);
96
  viewer.render();
97
  }});
 
159
  viewer.addModel(`{target}`, "{target_fmt}");
160
  viewer.getModel(1).setStyle(proteinStyle);
161
 
162
+ viewer.zoomTo({{ "model": 0 }});
163
  viewer.zoom(0.7);
164
  viewer.render();
165
  }});
 
203
  viewer.getModel().hide();
204
  viewer.addModel(`{molecule}`, "{molecule_fmt}")
205
  viewer.getModel().setStyle({{ stick: {{ colorscheme:"greenCarbon" }} }})
206
+ viewer.zoomTo({{ "model": 0 }});
207
  viewer.zoom(0.7);
208
  viewer.render();
209
  }});
 
263
  viewer.addModel(`{target}`, "{target_fmt}")
264
  viewer.getModel(2).setStyle({{ cartoon: {{ colorscheme: "ssPyMOL" }} }})
265
 
266
+ viewer.zoomTo({{ "model": 0 }});
267
  viewer.zoom(0.7);
268
  viewer.render();
269
  }});