# jsmol-widget

> Simple molecular viewer based on JSmol

Latest version **0.7.0** (published 2020-01-20) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install jsmol-widget
pnpm add jsmol-widget
yarn add jsmol-widget
bun add jsmol-widget
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2020-01-20 |
| First published | 2020-01-20 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 51 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Guillaume Fraux |
| Maintainers | luthaf |

## Links

- npm: https://www.npmjs.com/package/jsmol-widget
- Repository: https://github.com/cosmo-epfl/jsmol-widget
- Homepage: https://github.com/cosmo-epfl/jsmol-widget#readme
- Issues: https://github.com/cosmo-epfl/jsmol-widget/issues
- npm.io page: https://npm.io/package/jsmol-widget

## Recent versions

- 0.7.0 (latest) — 2020-01-20

## README

# jsmol-widget molecular viewer

This is a small wrapper of JSmol, that provides easy access
to selected visualization options, and that is used e.g. on
[Materials Cloud](https://www.materialscloud.org/) and as a
module of maptomic.
See it in action [here](http://cosmo-epfl.github.io/jsmol-widget/example).

## Using the code

Grab the latest
[release](https://github.com/cosmo-epfl/jsmol-widget/releases) and include
it in your HTML pages:

```html
<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="<PATH_TO_JSMOL>/JSmol.min.js"></script>
        <script type="text/javascript" src="jsmol-widget.min.js"></script>
    </head>
    <body>
        <div id="viewer" style="width: 600px; height: 400px;"></div>
    </body>
    <script type="text/javascript">
        document.addEventListener("DOMContentLoaded", () => {
            const viewer = new JSmolWidget('viewer', '<PATH_TO_JSMOL>/j2s');
            viewer.load('<some data>')
        });
    </script>
</html>
```

This viewer requires `JSmol` to be provided externally, either by yourself or
loaded from `https://chemapps.stolaf.edu/jmol/jsmol-2019-10-30/JSmol.min.js`.

## Documentation

`jsmol-widget.min.js` exports a single global object called
`JSmolWidget`, which is [documented
here](https://cosmo-epfl.github.io/jsmol-widget/classes/jsmolwidget.html).

## Local development

```bash
# Install the dependencies
npm install
# run the example locally
npm start
# navigate to http://localhost:8080
```

## Licensing

The widget code is distributed under the [3-clauses BSD license](LICENSE). By
contributing to this project, you agree to distribute your contributions under
the same license.

Jmol and JSmol are distributed under LGPLv2 license.

---
_Source: https://npm.io/package/jsmol-widget · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
