Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arose committed Jun 3, 2019
0 parents commit 91cf5b7
Show file tree
Hide file tree
Showing 17 changed files with 17,513 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json binary
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/
lib/

node_modules/
debug.log
npm-debug.log

*.sublime-workspace
.idea
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2017 - now, Mol* contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](./LICENSE)
[![Gitter](https://badges.gitter.im/molstar/Lobby.svg)](https://gitter.im/molstar/Lobby)

## Building & Running

### Build:
npm install
npm run build

### Build automatically on file save:
npm run watch

### Build with debug mode enabled:
DEBUG=molstar npm run watch

### Build for production:
NODE_ENV=production npm run build

## Development

### Scripts installation
npm run build
npm install -g

## Contributing
Just open an issue or make a pull request. All contributions are welcome.

## Funding
Funding sources include but are not limited to:
* [RCSB PDB](https://www.rcsb.org) funding by a grant [DBI-1338415; PI: SK Burley] from the NSF, the NIH, and the US DoE
* [PDBe, EMBL-EBI](https://pdbe.org)
* [CEITEC](https://www.ceitec.eu/)
34 changes: 34 additions & 0 deletions examples/basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Mol*/CIFTools Basic Example</title>
<script type="text/javascript" src="../build/dist/ciftools.js"></script>
</head>
<body>
<div id="info"></div>
<script type="text/javascript">
fetch('//files.rcsb.org/download/1CRN.cif')
.then(function(response) { return response.text() })
.then(function(text) { return CIFTools.parseText(text).run() })
.then(function(parsed) {
const info = document.getElementById('info')
const block = parsed.result.blocks[0]
const html = ['<h2>' + block.header + '<h2>', '<h3>Categories</h3>', '<ul>']
for (let i = 0, il = block.categoryNames.length; i < il; ++i) {
const c = block.categories[block.categoryNames[i]]
const rowCount = c.rowCount === 0 ? 'empty'
: c.rowCount === 1 ? '1 row'
: (c.rowCount + ' rows')
html.push('<li>', block.categoryNames[i] + ' (' + rowCount + ')', '<ul>')
for (let j = 0, jl = c.fieldNames.length; j < jl; ++j) {
html.push('<li>', c.fieldNames[j], '</li>')
}
html.push('</ul>', '</li>')
}
html.push('</ul>')
info.innerHTML = html.join('\n')
})
</script>
</body>
</html>
Loading

0 comments on commit 91cf5b7

Please sign in to comment.