miew
Miew is a high performance web tool for advanced visualization and manipulation
of molecular structures.
The miew
package is the core JavaScript library that implements the functionality.
Please refer to the topmost README for an overview of the entire project.
Installation and Usage
Miew library is available as an npm package.
It provides both UMD and ES2015 modules, so can be included in a SCRIPT tag via a CDN
or built with a bundler of your choice. For more details refer to:
SCRIPT tag
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script src="https://unpkg.com/lodash@^4.17.21/lodash.js"></script>
<script src="https://unpkg.com/three@0.153.0/build/three.min.js"></script>
<script src="https://unpkg.com/miew@0.11.0/dist/Miew.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/miew@0.11.0/dist/Miew.min.css" />
</head>
<body>
<div class="miew-container" style="width:640px; height:480px"></div>
<script>
(function () {
var viewer = new Miew({ load: '1CRN' });
if (viewer.init()) {
viewer.run();
}
})();
</script>
</body>
</html>
Webpack
Install using npm:
npm i miew
src/index.js
import Miew from 'miew';
import './index.css';
window.onload = function () {
var viewer = new Miew({ load: '1CRN' });
if (viewer.init()) {
viewer.run();
}
};
src/index.css
@import 'miew';
dist/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script src="main.js"></script>
</head>
<body>
<div class="miew-container" style="width:640px; height:480px"></div>
</body>
</html>
webpack.config.js
module.exports = {
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}],
},
};
Contribution
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
License
MIT
Copyright (c) 2015–2024 EPAM Systems, Inc.