User Tools

Site Tools


playground:test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
playground:test [2012/08/30 14:01] – created sillitoeplayground:test [2014/04/09 18:25] (current) sillitoe
Line 1: Line 1:
 +=== Moving from Jmol to JSmol ===
 +
 +I've created a new plugin that will render ''<jmol>'' code fragments using JSmol (Javascript-based) rather than Jmol (Java based).
 +
 +The old code looked something like:
 +
 +<code>
 +
 +<jmol :tutorials:2pfsA01_1wkbA01.pdb.gz 400 400>
 +jmolButton( "cartoon on; cpk off; wireframe off; select *A; color lightblue; select 
 +</jmol>
 +</code>
 +
 +
 +This now looks like:
 +
 +<code>
 +<jsmol 2pfsA01 :tutorials:2pfsA01_1wkbA01.pdb.gz 400 400>
 +Jmol.jmolButton( "2pfsA01", "cartoon on; cpk off; wireframe off; select *A; color lightblue;" );
 +</jsmol>
 +</code>
 +
 +Note a few things have changed:
 +
 + 1. the ''<jmol>'' tag is now replaced by ''<jsmol>''
 +
 + 2. the ''<jsmol>'' tag requires you to enter in a unique ''<id>'' as the first argument, e.g. ''2pf2A01''
 +
 + 3. this ''<id>'' is used in subsequent calls such as ''jmolButton("<script>")'' have been changed to ''Jmol.jmolButton( "<id>", "<script>" )''
 +
 +Example:
 +
 +<code>
 +<jsmol 2pfsA01 :tutorials:2pfsA01_1wkbA01.pdb.gz 400 400>
 +Jmol.jmolButton( "2pfsA01", "cartoon on; cpk off; wireframe off; select *A; color lightblue; select 2-13:A, 14-32:A, 33-53:A, 63-67:A, 68-78:A, 79-93:A, 94-107:A, 108-116:A, 127-136:A, 137-145:A; color blue; select *B; color pink; select 33-44:B, 50-68:B, 74-84:B, 123-126:B, 128-138:B, 140-154:B, 527-540:B, 604-612:B, 616-625:B, 635-643:B; color red", "Click here" );
 +</jsmol>
 +</code>
 +
 +Looks like:
 +
 +<jsmol jsmolid :tutorials:2pfsA01_1wkbA01.pdb.gz 400 400>
 +Jmol.jmolButton( "jsmolid", "cartoon on; cpk off; wireframe off; select *A; color lightblue; select 2-13:A, 14-32:A, 33-53:A, 63-67:A, 68-78:A, 79-93:A, 94-107:A, 108-116:A, 127-136:A, 137-145:A; color blue; select *B; color pink; select 33-44:B, 50-68:B, 74-84:B, 123-126:B, 128-138:B, 140-154:B, 527-540:B, 604-612:B, 616-625:B, 635-643:B; color red", "Click here" );
 +</jsmol>
 +
 +
 +
 +<jmol jmolid :tutorials:2pfsA01_1wkbA01.pdb.gz 400 400>
 +</jmol>
 +
 +