<commit_before>/** 
* for graphical presentation of phenotype data of a trait
* @author <NAME> <<EMAIL>>
*
*/

//JSAN.use('MochiKit.LoggingPane');
JSAN.use('flot.jquery');
JSAN.use('Prototype');


jQuery(window).load( function() {

        var popId   = jQuery('input[name=population_id]').val();
        var traitId = jQuery('input[name=trait_id]').val();
      
        var params = 'pop_id' + '=' + popId + '&' + 'trait_id' + '=' + traitId;
        var action = '/solgs/phenotype/graph';
     
        var phenoPlotData        = [];
        phenoPlotData[0]         = [];  
        var xAxisTickPhenoValues = [];
        var yAxisTickPhenoValues = [];
        var yPhenoValues         = [];
      
        var phenoDataRenderer = function() {            
            jQuery.ajax({
                    async: false,
                        url: action,
                        dataType:"json",
                        data: params,
                        success: function(data) {
                        var phenoData  = data.trait_data;
                        var state     = data.status;
                     
                        if (state == 'success') {
                            for (var i=0; i < phenoData.length; i++) {
                                var xPD = phenoData[i][0];
                                xPD     = xPD.toString();
                                var yPD = phenoData[i][1];
                                yPD     = yPD.replace(/\s/, '');
                                yPD     = Number(yPD);<commit_msg>added flexibility to handle single and combined populations datasets..<commit_after>/** 
* for graphical presentation of phenotype data of a trait
* @author <NAME> <<EMAIL>>
*
*/

//JSAN.use('MochiKit.LoggingPane');
JSAN.use('jquery');
JSAN.use('Prototype');

jQuery(window).load( function() {

        var popId       = jQuery('input[name=population_id]').val();
        var traitId     = jQuery('input[name=trait_id]').val();
        var comboPopsId = jQuery('input[name=combo_pops_id]').val();

        var params;
        if(popId) {
            params = 'pop_id=' + popId + '&trait_id=' + traitId;
        } else {
            params = 'combo_pops_id=' + comboPopsId + '&trait_id=' + traitId;  
        }

        var action = '/solgs/phenotype/graph';
     
        var phenoPlotData        = [];
        phenoPlotData[0]         = [];  
        var xAxisTickPhenoValues = [];
        var yAxisTickPhenoValues = [];
        var yPhenoValues         = [];
      
        var phenoDataRenderer = function() {            
            jQuery.ajax({
                    async: false,
                        url: action,
                        dataType:"json",
                        data: params,
                        success: function(data) {
                        var phenoData  = data.trait_data;
                        var state     = data.status;
                     
                        if (state == 'success') {
                            for (var i=0; i < phenoData.length; i++) {
                                var xPD = phenoData[i][0];
                                xPD     = xPD.toString();
                                var yPD = phenoData[i][1];
                                yPD     = yPD.replace(/\s/, '');
                                yPD     = Number(yPD);
{'fraction_non_alphanumeric': 0.12466367713004484, 'fraction_numerical': 0.002391629297458894, 'mean_word_length': 1.1969796454366382, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3195251', 'n_tokens_mistral': 945, 'n_tokens_neox': 906, 'n_words': 182}