<commit_before>/**
 * Ouput widget to display a pangenome object.
 * @author <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
 * @public
 */

(function( $, undefined ) {
    $.KBWidget({
        name: "kbasePanGenome",
        parent: "kbaseAuthenticatedWidget",
        version: "1.0.0",
        options: {
        	ws: null,
        	name: null,
            loadingImage: "assets/img/ajax-loader.gif",
            withExport: false,
            width: 1000
        },

        pref: null,
        wsUrl: "https://kbase.us/services/ws/",  //"http://dev04.berkeley.kbase.us:7058",
        token: null,
        kbws: null,
        geneIndex: {},   // {genome_ref -> {feature_id -> feature_index}}
        genomeNames: {}, // {genome_ref -> genome_name}
        genomeRefs: {},  // {genome_ref -> workspace/genome_object_name}
        loaded: false,
        	
        init: function(options) {
            this._super(options);
            this.pref = this.genUUID();
            this.token = this.authToken();
        	var container = this.$elem;
        	container.empty();
        	container.append("<div><img src=\""+this.options.loadingImage+"\">&nbsp;&nbsp;loading pan-genome data...</div>");
            this.render();
            return this;
        },

        render: function() {
        	var self = this;
        	var ws = this.options.ws;
        	var name = this.options.name;            

        	var container = this.$elem;

        	if (!this.token) {<commit_msg>Fix for one really bad bug in pangenome widget (old global data wasn't cleaned when you open next pangenome object).<commit_after>/**
 * Ouput widget to display a pangenome object.
 * @author <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
 * @public
 */

(function( $, undefined ) {
    $.KBWidget({
        name: "kbasePanGenome",
        parent: "kbaseAuthenticatedWidget",
        version: "1.0.0",
        options: {
        	ws: null,
        	name: null,
            loadingImage: "assets/img/ajax-loader.gif",
            withExport: false,
            width: 1000
        },

        pref: null,
        wsUrl: "https://kbase.us/services/ws/",  //"http://dev04.berkeley.kbase.us:7058",
        token: null,
        kbws: null,
        geneIndex: {},   // {genome_ref -> {feature_id -> feature_index}}
        genomeNames: {}, // {genome_ref -> genome_name}
        genomeRefs: {},  // {genome_ref -> workspace/genome_object_name}
        loaded: false,
        	
        init: function(options) {
            this._super(options);
            this.pref = this.genUUID();
            this.token = this.authToken();
            this.geneIndex = {};
            this.genomeNames = {};
            this.genomeRefs = {};
        	var container = this.$elem;
        	container.empty();
        	container.append("<div><img src=\""+this.options.loadingImage+"\">&nbsp;&nbsp;loading pan-genome data...</div>");
            this.render();
            return this;
        },

        render: function() {
        	var self = this;
        	var ws = this.options.ws;
        	var name = this.options.name;            

        	var container = this.$elem;

        	if (!this.token) {
{'fraction_non_alphanumeric': 0.15014344915524386, 'fraction_numerical': 0.008288173414089895, 'mean_word_length': 1.7843833185448092, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6799694', 'n_tokens_mistral': 978, 'n_tokens_neox': 935, 'n_words': 200}