PistoiaHELM / HELMWebEditor

Web browser based editor for drawing HELM macromolecules.
MIT License
19 stars 10 forks source link

How to create ViewOnly HELM Viewer? #102

Closed scilligence closed 7 years ago

scilligence commented 7 years ago

Technically you need only the Canvas for viewonly mode to display HELM structure. The Canvas is JSDraw. So here steps:

  1. Load Monomer Library using
  2. Create a DIV as placeholder
  3. Initialize DIV as a JSDraw viewonly editor

Example Code:

<script type="text/javascript" src="http://SERVER/JSDraw/monomerdb20161106.js"></script>
<div id='Div2' dataformat='helm' data="PEPTIDE1{A.C.T.G.C.T.W.G.T.W.E.C.W.C.Q.W}|PEPTIDE2{A.C.T.G.C.T.W.G.T.W.E.Q}$PEPTIDE1,PEPTIDE1,5:R3-14:R3|PEPTIDE2,PEPTIDE1,2:R3-12:R3$$$"></div>
<script type="text/javascript">
    dojo.ready(function () {
        var jsd = new JSDraw("Div2", { width: 800, height: 400, skin: "w8", viewonly: true });
    });
</script>