Chemiscope as a library¶
It is possible to use chemiscope as a software library when writing your own web-based interface. This page document how to get the library and give a few usage examples.
You should also look at the API documentation for a list of all public classes, interfaces and functions in chemiscope.
Chemiscope relies on different external dependencies that you should load in all the HTML pages using it. You can serve these from your own web server, or use a CDN to deliver them.
Getting and building the code¶
The easiest way to do so is to download the latest release from the release
page on GitHub. The main
chemiscope.min.js, containing the code required to create the
default visualizer. This file exports a single global object
which contains references to
Partial builds are also available, in particular
partial builds containing only part of chemiscope can be added upon request.
Build from sources¶
Chemiscope is written in TypeScript, a statically typed language which compiles
npm. To build chemiscope from sources, you will first need to
get the sources, either as an archive from the release page, or using git
git clone https://github.com/lab-cosmo/chemiscope
cd chemiscope npm install npm run build
This should create a
yarn, you can use
the version of Chemiscope available on npm. Add it to your project with
npm install chemiscope
And import the library inside your own code using
const Chemiscope = require("chemiscope");
If your are using TypeScript, definition files are also provided with the npm package, and should give you auto-completion, inline documentation and interface checking.