User:Eric Martz/Sandbox 17
From Proteopedia
< User:Eric Martz(Difference between revisions)
(62 intermediate revisions not shown.) | |||
Line 4: | Line 4: | ||
This page created 2020/12/16 after Jaim made changes to enable caption editing. | This page created 2020/12/16 after Jaim made changes to enable caption editing. | ||
- | <br>1. <scene name='87/870563/Pngj_with_caption_2020-12-16/1'>Here is a new PNGJ scene with a caption</scene>. | + | <br>1. <scene name='87/870563/Pngj_with_caption_2020-12-16/1'>Here is a new PNGJ scene with a caption</scene>. This loads '''Image:6zgi-cavities.pngj''' |
<br>When scene 1 was re-loaded, the caption DID APPEAR for editing, but in JSmol, the isosurfaces from the PNGJ file were not displayed. | <br>When scene 1 was re-loaded, the caption DID APPEAR for editing, but in JSmol, the isosurfaces from the PNGJ file were not displayed. | ||
- | <br>2. <scene name='87/870563/Pngj_with_caption_2020-12-16/2'>Here I have re-loaded scene 1, edited the caption, and saved</scene>. | + | <br>2. <scene name='87/870563/Pngj_with_caption_2020-12-16/2'>Here I have re-loaded scene 1, edited ONLY the caption, and saved</scene>. |
- | <br>As in the SAT, the isosurfaces in the PNGJ file have disappeared. | + | <br>As in the SAT, the isosurfaces in the PNGJ file have disappeared. But the edited caption appears correctly. |
+ | |||
+ | ---- | ||
+ | 2020-12-17: | ||
+ | |||
+ | <br>3. <scene name='87/870563/Pngj_with_caption_2020-12-16/3'>Scene 1 saved after editing only the CAPTION</scene>, after further fixes by Jaim (2020-12-17). | ||
+ | |||
+ | <br>BOTH SCENE AND CAPTION ARE CORRECT. HURRAY! | ||
+ | |||
+ | |||
+ | Scenes 4 and 5 use '''Image:6zgi-membrane-proximal-cavity-jmol-cr2.5.pngj'''. | ||
+ | |||
+ | <br>4. <scene name='87/870563/6zgi_mem-prox_cav_4_colors/1'>New PNGJ with membrane-proximal cavity in 4 colors</scene>. These isosurfaces take several minutes to calculate, but when saved as JVXL files, then loaded from the files and cached, and that saved into a new PNGJ file, the results appear in about one second! | ||
+ | |||
+ | ---- | ||
+ | 2020-12-19: | ||
+ | |||
+ | <br>5. This green link runs a JSmol script, loading the PNGJ file, and writing the caption directly. | ||
+ | <jmol> | ||
+ | <jmolLink> | ||
+ | <script> | ||
+ | set echo false;set echo middle center; echo "Loading Model";color echo red;delay 0.1; | ||
+ | load "http://proteopedia.org/wiki/images/3/3d/6zgi-membrane-proximal-cavity-jmol-cr2.5.pngj"; | ||
+ | spin on; | ||
+ | capcmd = "changeCaption(`Four isosurfaces in 4 colors from [[6zgi]].`, '', '')" | ||
+ | javascript @capcmd | ||
+ | </script> | ||
+ | <text>Membrane-proximal cavity in SARS-CoV-2 spike protein.</text> | ||
+ | </jmolLink> | ||
+ | </jmol> | ||
+ | |||
+ | I have not been able to devise a method to color text in the caption. Anything with < or > creates an XML error (page cannot be saved). Using e.g. &lt; can be saved, but confuses JSmol which expects a new command after the ';'. | ||
+ | |||
+ | Proteopedia's wiki lacks Template:Font_color: {{font color|red|red text?}}. | ||
+ | |||
+ | 6. I tried an indirect method to color caption text. This page saves in Proteopedia, and the JSmol variable captext prints correctly. I can't tell if my assignment to the Javascript variable captext is working. The caption does not display. There are no JSmol errors. There are Javascript warnings, but not errors. | ||
+ | <jmol> | ||
+ | <jmolLink> | ||
+ | <script> | ||
+ | script "http://proteopedia.org/wiki/images/6/69/Colortext.spt" | ||
+ | # captext JSmol variable is only for testing. | ||
+ | captext = "Words with " + colortext("some red", "red") + " in this caption." | ||
+ | javascript captext = "Words with " + colortext("some red", "red") + " in this caption." | ||
+ | capcmd = "changeCaption(captext, '', '')" | ||
+ | javascript @capcmd | ||
+ | </script> | ||
+ | <text>Colored caption test.</text> | ||
+ | </jmolLink> | ||
+ | </jmol> | ||
+ | |||
+ | ---- | ||
+ | 2020-12-21: | ||
+ | |||
+ | 7. <scene name='87/870563/2020_12_21_retry_4_isosurfaces/1'>Re-try of the 4-isosurface PNGJ</scene> (Image:6zgi-membrane-proximal-cavity-jmol-cr2.5.pngj). WORKS. | ||
+ | |||
+ | 8. <scene name='87/870563/2020_12_21_retry_4_isosurfaces/2'>Same scene as 7 with caption edited to include colored text</scene>. WORKS WITH COLORED CAPTION. COLORS done with span classes. | ||
+ | |||
+ | 9. <scene name='87/870563/2020_12_21_retry_4_isosurfaces/3'>Same as 8 but with yellow caption text done as a style span</scene>. DOES NOT WORK. | ||
+ | |||
+ | 10. <scene name='87/870563/2020_12_21_retry_4_isosurfaces/4'>Same as 9 but with non-breaking space codes removed</scene>. STILL DOES NOT WORK. Evidently style spans are not supported in captions. | ||
+ | |||
+ | 11. <scene name='87/870563/2020_12_21_retry_4_isosurfaces/5'>Yellow background text changed to a class span</scene>. WORKS. | ||
+ | |||
+ | ====PDB (not PNGJ) scenes==== | ||
+ | |||
+ | 12. <scene name='87/870563/No_isosurfaces_1d66/2'>A simple scene (no isosurfaces) for testing caption text coloring</scene>. WORKS. FONT COLOR TAGS CAN BE USED IN SCENES NOT INVOLVING PNGJ FILES, BUT BE SURE TO DO BOLD/ITALICS WITH HTML TAGS NOT WIKI MARKUP! | ||
+ | |||
+ | 13: <scene name='87/870563/No_isosurfaces_1d66/3'>Test using a color scheme template</scene> for Oxygen. FAILS. | ||
+ | |||
+ | 14: <scene name='87/870563/No_isosurfaces_1d66/4'>Single color template method</scene>: <nowiki>{{Font color|red|red text}}</nowiki>. DOES NOT WORK. | ||
+ | |||
+ | 15: <scene name='87/870563/No_isosurfaces_1d66/5'>Span style method</scene>. FAILS PREVENTING SCENE OR CAPTION FROM LOADING AT ALL. | ||
</StructureSection> | </StructureSection> | ||
+ | ==See Also== | ||
+ | * [[Image:Colortext.spt]] | ||
+ | * [[Proteopedia:DIY:Templates]] |
Current revision
PNGJ scene and caption tests
|