<commit_before>// Plot dataset

 $(function(){
     // default options
     var well = 15;
     var dye = 'SYBR';

     function plot_dataset(well, dye){
         var id = 1; // TODO: vary based on the opened page
         var url = '/' + id + '/well/' + well + '/dye/' + dye;
         // plot graph
         $.getJSON(url, function(data){
             // format the data for Rickshaw
             var data2 = [];
             for(key in data){
                 data2.push({x: +key, y: data[key]});
             }
             // clear old graph
             $('#graph').empty();
             // add new graph
             var graph = new Rickshaw.Graph( {
                 element: document.querySelector("#graph"),
                 width: 600,
                 height: 400,
                 series: [{
                     color: 'steelblue',
                     data: data2
                     //   [
                     //   { x: 0, y: 40 },
                     //   { x: 1, y: 49 },
                     //   { x: 2, y: 38 },
                     //   { x: 3, y: 30 },
                     //   { x: 4, y: 32 }
                     // ]
                 }]
             });
             // set the axes
             var axes = new Rickshaw.Graph.Axis.X({
                 graph: graph,
                 orientation: 'top'
             });

             var y_axis = new Rickshaw.Graph.Axis.Y({
                 graph: graph,
                 orientation: 'left',
                 tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
                 element: document.getElementById('y_axis')
             });
             graph.render();
         });
     };

     // initial plot
     plot_dataset(well, dye);

     // on well change redraw the graph
     $('#well-input').on("change", function(){
         well = $(this).val();
         plot_dataset(well, dye);
     });

     // on colour change redraw the graph
     $('#dye-input').on("change", function(){
         dye = $(this).val();
         plot_dataset(well, dye);
     });

 });<commit_msg>plot_model funciton querying the model API<commit_after>// Plot dataset

 $(function(){
     // default options
     var well = 15;
     var dye = 'SYBR';

     function plot_dataset(well, dye){
         var id = 1; // TODO: vary based on the opened page
         var url = '/' + id + '/well/' + well + '/dye/' + dye;
         // plot graph
         $.getJSON(url, function(data){
             // format the data for Rickshaw
             var data2 = [];
             for(key in data){
                 data2.push({x: +key, y: data[key]});
             }
             // clear old graph
             $('#graph').empty();
             // add new graph
             var graph = new Rickshaw.Graph( {
                 element: document.querySelector("#graph"),
                 width: 600,
                 height: 400,
                 series: [{
                     color: 'steelblue',
                     data: data2
                     //   [
                     //   { x: 0, y: 40 },
                     //   { x: 1, y: 49 },
                     //   { x: 2, y: 38 },
                     //   { x: 3, y: 30 },
                     //   { x: 4, y: 32 }
                     // ]
                 }]
             });
             // set the axes
             var axes = new Rickshaw.Graph.Axis.X({
                 graph: graph,
                 orientation: 'top'
             });

             var y_axis = new Rickshaw.Graph.Axis.Y({
                 graph: graph,
                 orientation: 'left',
                 tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
                 element: document.getElementById('y_axis')
             });
             graph.render();
         });
     };

     function plot_model(well, dye){
         var id = 1; // TODO: vary based on the opened page
         var url = '/api/model/' + id + '/well/' + well + '/dye/' + dye;
         // plot graph
         $.getJSON(url, function(data){
             console.log('model data:');
             console.log(data);
         });
     }

     // initial plot
     plot_dataset(well, dye);
     plot_model(well, dye);

     // on well change redraw the graph
     $('#well-input').on("change", function(){
         well = $(this).val();
         plot_dataset(well, dye);
     });

     // on colour change redraw the graph
     $('#dye-input').on("change", function(){
         dye = $(this).val();
         plot_dataset(well, dye);
     });

 });
{'fraction_non_alphanumeric': 0.14066666666666666, 'fraction_numerical': 0.012222222222222223, 'mean_word_length': 1.0590118938700823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5801995', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1178, 'n_words': 323}