Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Nov 13, 2015
1 parent 40db070 commit d31dce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Materials Informatics HTML5 Player
HTML5 Player for Materials Informatics
======

In-browser ultra-fast and lightweight renderer of the [crystallographic information files (CIF)](https://en.wikipedia.org/wiki/Crystallographic_Information_File) and VASP POSCAR structures, written in a pure JavaScript.
Expand All @@ -9,4 +9,4 @@ Development layout is inside ```src``` folder. The modular approach based on [re

Additionally, CIF and POSCAR files from anywhere on the web can be displayed. A file URL must be then passed via **_document.location.hash_** property (browser's address bar, after sharp symbol). However if the file is served from another domain, PHP or Python proxy for remote requests should be used. There are examples of PHP and Python proxies (not for production use) in ```src``` folder. Obviously, it is safer to serve CIF files from the same domain.

_Let's cooperate on the further development! Your contribution will be very much appreciated._
_Let's cooperate on the further development!_
6 changes: 3 additions & 3 deletions src/js/libs/matinfio.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var custom_CIF_loop_props = {'_atom_site_occupancy': 'site occupancies', '_atom_

function detect_format(str){
if (str.indexOf("_cell_angle_gamma ") > 0 && str.indexOf("loop_") > 0) return 'CIF';
var lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n");
var lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n");
if (lines.length > 6){
if (lines[6].toLowerCase().substr(0, 6) == 'direct') return 'POSCAR';
}
Expand Down Expand Up @@ -179,7 +179,7 @@ function jsobj2flatten(crystal){
}

function cif2jsobj(str){
var structures = [], symops = [], atprop_seq = [], lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n"), cur_structure = {'cell': {}, 'atoms': []};
var structures = [], symops = [], atprop_seq = [], lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n"), cur_structure = {'cell': {}, 'atoms': []};
var loop_active = false, new_structure = false, symops_active = false;
var cur_line = "", line_data = [], symmetry_seq = [];
var cell_props = ['a', 'b', 'c', 'alpha', 'beta', 'gamma'];
Expand Down Expand Up @@ -283,7 +283,7 @@ function cif2jsobj(str){
}

function poscar2jsobj(str){
var lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n"), cell = [], atoms = [], factor = 1.0, atindices = [], types = [];
var lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n"), cell = [], atoms = [], factor = 1.0, atindices = [], types = [];
var atom_props = ['x', 'y', 'z', 'symbol'];
var i, j, len = lines.length, line_data = [], atidx = 0;
for (i = 1; i < len; i++){
Expand Down

0 comments on commit d31dce3

Please sign in to comment.