js/visualization/abbreviation.js
/**
 * 
 * <p>
 * Manages suffixes and prefixes of a string. A string can have either
 * a prefix or a suffix, but not both.
 * </p>
 *
 * @param prefix String
 * @param root   String
 * @param suffix String
 * 
 */

Manages suffixes and prefixes of a string. A string can have either
a prefix or a suffix, but not both.


Manages suffixes and prefixes of a string . A string can have either a prefix or a suffix but not both .
function Abbreviation(prefix, root, suffix) {
    this.originalString = prefix + root + suffix;
    if (root !== "") {
        this.prefix = prefix;
        this.root = root;
        this.suffix = suffix;
    } else if (prefix !== "") {
        this.prefix = "";
        this.root = prefix
        this.suffix = suffix;
    } else {
        this.prefix = "";
        this.root = suffix
        this.suffix = "";
    }
    this.displayRoot = this.root; 
    this.truncateLeftNext = false; 
    console.assert(this.root !== "" || this.getOriginalString() === "",
        "this.root assigned an empty string when a non-empty is available");
}
function Abbreviation ( prefix , root , suffix ) { this . originalString = prefix + root + suffix ; if ( root !== "" ) { this . prefix = prefix ; this . root = root ; this . suffix = suffix ; } else if ( prefix !== "" ) { this . prefix = "" ; this . root = prefix this . suffix = suffix ; } else { this . prefix = "" ; this . root = suffix this . suffix = "" ; } this . displayRoot = this . root ; this . truncateLeftNext = false ; console . assert ( this . root !== "" || this . getOriginalString ( ) === "" , "this.root assigned an empty string when a non-empty is available" ) ; }
<p>
 Manages suffixes and prefixes of a string.
<p > Manages suffixes and prefixes of a string .
// what is displayed during Ellipsification // flag to keep track of truncation state