rnautils.js
ColorScheme
Parse a string containing coloring information and store it in an object.
Example:
let cs = '10:red';
The important parts of the returned object will look like this:
colorsText: '10:red' colorsJson: '': '10': 'red' range: 'white' 'steelblue' domain: Infinity -Infinity }
Another exmaple using continuous colors:
let cs = '1:0.7 2:0.8';
Yields...
colorsText: '1:0.7 2:0.8' colorsJson: '': '1': 07 '2': 08 range: 'white' 'steelblue' domain: 07 08 }
Apply colors only to molecules with a particular name:
let cs = '>blah\n 7:orange';
...
colorsText: '>blah\n 7:orange' colorsJson: '': {} 'blah': '7': orange range: 'white' 'steelblue' domain: Infinity -Infinity }
Specify a domain and a range for continuous values:
let cs = 'domain=0:10 range=red:green 1: 0.7 2:0.8';
...
colorsText: '1:0.7 2:0.8' colorsJson: '': '1': 07 '2': 08 range: 'red' 'green' domain: '0' '10' }
Other examples:
let cs = '1-3:red 4,5:blue';
Development
First:
npm install
bower install
To debug:
gulp serve
To build:
gulp build
The output will be placed in the dist
directory. To use rnautils
in a web page, simply include dist/scripts/rnautils.js
in your web page.