ZINC_code.js
/* Searches for relevant chemical properties and adds it to the selected
 * object in the main Hydra interface.
 * @param {String[]} props String array defining the property names to add data as defined by propIndices
 * @param {int[]} propIndices Integer array defining the relevant columns. Matched to props
 * @param {Object} obj The object to modify. Intended object: comp selected in lists
 */
Searches for relevant chemical properties and adds it to the selected
object in the main Hydra interface.
@param {String[]} props String array defining the property names to add data as defined by propIndices
@param {int[]} propIndices Integer array defining the relevant columns. Matched to props
@param {Object} obj The object to modify. Intended object: comp selected in lists
Searches for relevant chemical properties and adds it to the selected object in the main Hydra interface . @param { String [] } props String array defining the property names to add data as defined by propIndices @param { int [] } propIndices Integer array defining the relevant columns . Matched to props @param { Object } obj The object to modify . Intended object : comp selected in lists
function addPropFromDb(props, propIndices, obj){
   var zId = obj.zincId;
   if (propKeyMap[zId]) {
      var match = propKeyMap[zId];
      var lineData = match[0].split('\t');
      for(var x=0; x<props.length; x++){
         obj[props[x]] = lineData[propIndices[x]];
      }
   }
   else{
      obj[props[0]] = ' ';
   }
   console.log(obj);
}
function addPropFromDb ( props , propIndices , obj ) { var zId = obj . zincId ; if ( propKeyMap [ zId ] ) { var match = propKeyMap [ zId ] ; var lineData = match [ 0 ] . split ( '\t' ) ; for ( var x = 0 ; x < props . length ; x ++ ) { obj [ props [ x ] ] = lineData [ propIndices [ x ] ] ; } } else { obj [ props [ 0 ] ] = ' ' ; } console . log ( obj ) ; }
Searches for relevant chemical properties and adds it to the selected
 object in the main Hydra interface.
Searches for relevant chemical properties and adds it to the selected object in the main Hydra interface .
//Loop through all props to add and add sequentially //Square bracket notation allows a var for the prop name //This is because JS overloads the notation with key and index values //This is basically the same thing as obj.propNames[x]