sketcher window in MarvinJS

User 870ab5b546

07-07-2015 21:04:19

MarvinSketch has this great feature where you can detach the drawing canvas from its position inside a Web page, place it in its own window, and expand the new window to fill the entire screen. I heard a rumor that MarvinJS will soon have this feature as well. Can you tell me when we might expect to see it?

ChemAxon 76c88f5366

09-07-2015 09:43:09

Hi Bob,


As you can see in this example , this feature is already possible in Marvin JS.


A click on a picture triggers the editor opening in a popup window. (The size of the window depends on your custom settings.) 


Please. let us know if any further question arises.


Best regards,


Eszter

User 870ab5b546

09-07-2015 12:19:11

I see. That's not exactly what I am requesting. I guess I can place a custom Marvin JS button in the original sketcher that, upon pressing, will produce the popup sketcher, but I want the user to be able to change the size of the popup sketcher. Plus, I want any changes in the contents of the popup sketcher to be mirrored in the original sketcher. At the very least, the contents of the popup sketcher need to be transferred to the original sketcher when the user closes the popup sketcher.

ChemAxon f052bdfe3c

10-07-2015 11:30:17

"I want the user to be able to change the size of the popup sketcher"


You can make the popup sketcher resizable from html if you apply the iframe settings from this example: https://marvinjs-demo.chemaxon.com/latest/examples/example-setmol.html


"Plus, I want any changes in the contents of the popup sketcher to be mirrored in the original sketcher."


You can do it with function On, exportStructure, importStructure. Please see the details in our API (https://marvinjs-demo.chemaxon.com/latest/jsdoc.html)


"At the very least, the contents of the popup sketcher need to be transferred to the original sketcher when the user closes the popup sketcher"


This page shows an example how you can introduce the done button:


https://marvinjs-demo.chemaxon.com/latest/examples/example-edit-images.html


I hope it helps,


Efi




 o

User 870ab5b546

12-07-2015 01:06:39

Aha! That's excellent! With the ability to resize the canvas, I don't even need the popup window! Thanks!

User 47ec854e59

03-02-2016 12:57:40

hi,


1) When marvin js editor loads in Internet Explorer,it gives " current browser does not support HTML5 canvas" error.


and in mozilla firefox ,editor is loading but we can't draw structures.


Is there any solution to this?


 


2) we are switching from marvin sketch to marvin js.


Earlier,we used to pass structures drawn in editor from one .jsp page to .java page using "msketch_param" in marvin sketch, how to do it in marvin JS?


 


Thanks.

ChemAxon 76c88f5366

03-02-2016 14:03:57

Hi,


Marvin JS is available in browsers which supports HTML 5 canvas technologies.


Please, check whether your browser supports Marvin JS by opening this page: https://marvinjs-demo.chemaxon.com/latest/docs/compatibility.html in it.


If you find that your browser supports Marvin JS, please let us know in which version of Internet Explorer and Mozilla Firefox you experienced this issue.

It would give us more hint, if you could open one of our examples in the same browser to see if the same issue appears.


We would also be grateful if you could send us a code snippet how you integrated Marvin JS on your page.


Thank you in advance.


Best regards,
Eszter

ChemAxon 76c88f5366

03-02-2016 16:30:20

Hi, 


An addition to your first question:


Please, check if your html page has the right doctype declaration, in order to avoid the browsers switching to 'Quirks' compatibility  mode.


You can read more about this here:
https://developer.mozilla.org/en-US/docs/Quirks_Mode_and_Standards_Mode 


http://www.w3schools.com/tags/tag_doctype.asp


Best regards,
Eszter 

ChemAxon 7c2d26e5cf

04-02-2016 09:38:39

Answering your previous question:


Earlier,we used to pass structures drawn in 
editor from one .jsp page to .java page using "msketch_param" in marvin
sketch, how to do it in marvin JS?

I assume you need the importStructure function of editor.



Please, see the following example that demonstrate ho to pass structure to the editor: Set a molecule to the editor

User 47ec854e59

04-02-2016 09:55:32

hi,


 


Thaanks for the reply.


1) following the article on doctype dclarartion ,I used different doctypes but still it is giving html 5 canvas error on IE.


2) I have embedded marvin js editor by following code :-


<iframe id="sketch" src="/jchem/marvin/editor.html" style="overflow: hidden; min-width: 250px; min-height: 250px; border: 1px solid darkgray;"  ></iframe>


I have placed marvin js folder naming it "marvin" in jchem folder which lies in  jboss 6 root  removing the earlier marvin folder of marvin sketch completely.  Is it right?


 


Thanks

ChemAxon 76c88f5366

04-02-2016 13:05:53

Hi,


1. Which Internet Explorer version you use?


2. And  also, please see Compatibility View settings in Internet Explorer Tools>Compatibility View settings, and check whether your page is in the list (if it is, remove this) or if you try to open your page in intranet, you should uncheck "Display intranet sites in compatibility view" check-box.


3. In addition to these it would also good to know in which document mode is in your Internet Explorer. Please check Developer tools(F12)>Emulation >Document Mode (and write us).


Best regards,
Eszter 

User 47ec854e59

05-02-2016 12:05:26

hi,


Thanks for the solution.


Now html 5 error doesn't exist after unchecking "display intranet sites in compatibility view" checkbox in IE and complete editor window appears.


But still we are not able to draw structures in the marvin js editors in mozilla and IE.


Editor is working fine in chrome.


I have described my way of embedding editor in .jsp page in earlier post.


 


I use  IE version "11.0.9600.17633" and it is in "Edge" document mode.


regards,


Yogaksh

ChemAxon 76c88f5366

05-02-2016 13:03:07

Hi Yogaksh,


I am glad to hear that one of the issues has been solved :).


As far as the editing issue is concerned, it could be more difficult to detect the source of this problem.

1. Is just the editing affected or the whole editor? For example can you open an mrv file in it?

2. If you could send us a standalone example where this problem can be reproduced (not the jsp file, but the generated html) that would be a great help. (If you do not want to attach this to a forum message, you can also send it us via email: [email protected].) 


Regards,
Eszter 

User 47ec854e59

08-02-2016 12:31:42

hi,


I have tried to open .mol file, draw structures in IE,mozilla and chrome browsers.


But I could import .mol file and draw sructures  only in chrome,it is not happening in IE and mozilla.


I have sent you the generated html code of structure search part  on the above mentioned mail Id.


 


regards,


Yogaksh

User 47ec854e59

09-02-2016 12:22:27

hi,


We are switching from marvin sketch to marvin js.


Earlier in marvin sketch,we were using getmol method to pass molecule from .jsp page to .java page while submitting the form.


e.g.-


document.formname.molFile.value=document.MSketch.getMol('mol');


where..,msketch_name = "MSketch"


<input type="hidden" name ="molFile" value="">


 


How can we do it in marvin JS? could you give me an example?


 


thanks and regards,


Yogaksh

ChemAxon 76c88f5366

09-02-2016 12:45:24

Hi,


I think this is what you need: https://marvinjs-demo.chemaxon.com/latest/examples/example-setmol.html


and this example could be also useful: https://marvinjs-demo.chemaxon.com/latest/examples/example-getmol.html


Regards,
Eszter

User 47ec854e59

12-02-2016 09:55:17

hi,


We retrieve structure in marvin sketch from a specific path using code -


msketch_param("mol", "/structures/mol/example.mol");


How to retrieve structure in a editor from a specific path in marvin js ?


I could import it by following code -


marvinSketcherInstance.importStructure("mol", molsource);


molsource = "\n\n\n"+


" 14 15  0  0  0  0  0  0  0  0999 V2000\n"+


"    0.5089    7.8316    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    1.2234    6.5941    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    1.2234    7.4191    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"   -0.2055    6.5941    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"   -0.9200    7.8316    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    0.5089    5.3566    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"   -0.2055    7.4191    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    0.5089    6.1816    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"   -0.9200    6.1816    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    0.5089    8.6566    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    2.4929    7.0066    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    2.0080    7.6740    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    2.0080    6.3391    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"    2.2630    8.4586    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"+


"  1  7  1  0  0  0  0\n"+


"  8  2  1  0  0  0  0\n"+


"  1  3  1  0  0  0  0\n"+


"  2  3  2  0  0  0  0\n"+


"  7  4  1  0  0  0  0\n"+


"  4  8  1  0  0  0  0\n"+


"  4  9  2  0  0  0  0\n"+


"  7  5  1  0  0  0  0\n"+


"  8  6  1  0  0  0  0\n"+


"  1 10  2  0  0  0  0\n"+


"  3 12  1  0  0  0  0\n"+


"  2 13  1  0  0  0  0\n"+


" 13 11  2  0  0  0  0\n"+


" 12 11  1  0  0  0  0\n"+


" 12 14  1  0  0  0  0\n"+


"M  END\n";


 


But I want to import the structure in editor  "from specific path of file system" like "/jchem/marvin/example.mol",how to do it?


 


regards,


Yogaksh

ChemAxon 7c2d26e5cf

15-02-2016 11:07:20

The importStructure function of Marvin JS editor does not accept URL. So you have to load the file content before you call it.

The best practice is an AJAX request that loads the desired content on demand.

The following code snipplet shows how you can do it.

$.ajax("/structure/mol/example.mol").done(function(source) {
        marvinSketcherInstance.importStructure("mol", source).catch(function(error) {
                alert(error);
        });
 });


The
above example use JQuery to create an AJAX request but you can also use
any other JavaScript libraries for AJAX communication.

User 47ec854e59

15-02-2016 12:29:17

It worked.Thanks a lot Tamas.

User 47ec854e59

23-02-2016 06:14:09

1) Currently importing smiles in marvin js editor to convert them into stuctures using autorecognize feature is not happening.,what do we need to do? is it possible with our current licesnse ?


 


2) Can we select or personalise the tools avaliable on the tool bar in the Marvin JS applet . e.g -


view>stereo> R and S label etc.

ChemAxon 76c88f5366

24-02-2016 09:41:20

Hi,


1,
For SMILES import-export, JChem WebServices is needed. 
(If you do not have JChem WebServices, you can download it here: https://www.chemaxon.com/download/jchem-suite/#jcws


Then, please, follow the steps of the installation guide.)


When you received the license, there should be a documentation attached, which contains all the information to set your license file.


If you need further assistance, we are happy to give you help in every license-related issues via email.


2, 
In Marvin JS, Calculate Stereo button calculates and displays all possible R/S labels, and E/Z labels after pressing it.


Absolute stereo flag visibility can be set via View settings (cog icon) menu. (You can find other display settings here.)


There are some display settings which are only possible to be set via API. To see the whole list of these, please check setDisplaysettings() function the API documentation here: 


https://marvinjs-demo.chemaxon.com/latest/jsdoc.html#marvin.Sketch.getDisplaySettings()