0.1.0 • Published 14 days ago

butlerov v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
14 days ago

Butlerov core web component - a control to edit and display chemical structures.

Use in frontend projects

When using in projects built by js package managers like npm / yarn, just install into your project:

npm i butlerov

Then, import

import { MoleculeEditor, MW } from "butlerov";
const editor = MoleculeEditor({stage: document.getElementById("div-chemical")});
editor.onchange = () => {
    const mw = new MW(editor.graph).compute();
    console.log(`Molecular weight: ${MW} Da`);
}

Use in browser

You need to put butlerov.umd.js universal module definition (UMD) file somewhere in your project tree.

<html>
    <head>
        <script type="text/javascript" src="/js/butlerov.umd.js"></script>
        <!-- alternative option: -->
        <!-- <script src="https://unpkg.com/butlerov/dist/butlerov.umd.js"></script> -->
        <script type="text/javascript">
            const editor = window.butlerov.MoleculeEditor({stage: document.getElementById("div-chemical")});
            editor.onchange = () => {
                const mw = new window.butlerov.MW(editor.graph).compute();
                console.log(`Molecular weight: ${MW} Da`);
            }
        </script>
    </head>
    <body>
        <p>Now draw some chemistry</p>
        <div style="width: 1000px; height: 600px" id="div-chemical"></div>
    </body>
</html>
0.1.0

14 days ago

0.0.16

6 months ago

0.0.17

5 months ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago