scripts/aiv.js
/**
         * @function chopMapman - decides whether or not to chop off MapMan Code/Name based on its detail/length (decided with discussion with Nick)
         * @param {string} nameOrCode - "27.2.1 or RNA.regulation.transcription" as an example
         */
@function chopMapman - decides whether or not to chop off MapMan Code/Name based on its detail/length (decided with discussion with Nick)
@param {string} nameOrCode - "27.2.1 or RNA.regulation.transcription" as an example
@function chopMapman - decides whether or not to chop off MapMan Code / Name based on its detail / length ( decided with discussion with Nick ) @param { string } nameOrCode - " 27 . 2 . 1 or RNA . regulation . transcription " as an example
function chopMapMan(nameOrCode) {
            if ( (nameOrCode.match(/\./g)||[]).length > 3 ){ 
                return nameOrCode.substr(0, nameOrCode.lastIndexOf("."));
            }
            return nameOrCode; 
        }
function chopMapMan ( nameOrCode ) { if ( ( nameOrCode . match ( / \. / g ) || [ ] ) . length > 3 ) { return nameOrCode . substr ( 0 , nameOrCode . lastIndexOf ( "." ) ) ; } return nameOrCode ; }
@function chopMapman - decides whether or not to chop off MapMan Code/Name based on its detail/length (decided with discussion with Nick)
 @param {string} nameOrCode - "27.2.1 or RNA.regulation.transcription" as an example
@function chopMapman - decides whether or not to chop off MapMan Code / Name based on its detail / length ( decided with discussion with Nick ) @param { string } nameOrCode - " 27 . 2 . 1 or RNA . regulation . transcription " as an example
//If the MapMan is too detailed, remove the last occurence //By default return unmodified string if it is not too detailed