Commit e275556c authored by PkSM3's avatar PkSM3

[UPDATE] show map-list OK

parent 7fbf1e18
......@@ -601,8 +601,18 @@ function CRUD( parent_id , action , nodes , args , http_method , callback) {
} else callback(false);
}
function Main_test( data , initial) {
function Main_test( data , initial , search_filter) {
console.log("")
console.log(" = = = = MAIN_TEST: = = = = ")
console.log("data:")
console.log(data)
console.log("initial:")
console.log(initial)
console.log("search_filter:")
console.log(search_filter)
console.log(" = = = = / MAIN_TEST: = = = = ")
console.log("")
var DistributionDict = {}
for(var i in DistributionDict)
......@@ -610,8 +620,6 @@ function Main_test( data , initial) {
delete DistributionDict;
DistributionDict = {}
AjaxRecords = []
var FirstScore = initial;
var arrayd3 = []
......@@ -640,6 +648,7 @@ function Main_test( data , initial) {
div_stats += "</p>"
$("#stats").html(div_stats)
AjaxRecords = []
for(var i in data.ngrams) {
var le_ngram = data.ngrams[i]
......@@ -647,7 +656,6 @@ function Main_test( data , initial) {
var orig_id = le_ngram.id
var arr_id = parseInt(i)
RecDict[orig_id] = arr_id;
var node_info = {
"id" : le_ngram.id,
"name": le_ngram.name,
......@@ -663,6 +671,8 @@ function Main_test( data , initial) {
DistributionDict[node_info.score]++;
}
console.log(FirstScore)
// console.log("The Distribution!:")
// console.log(Distribution)
var DistributionList = []
......@@ -829,7 +839,7 @@ function Main_test( data , initial) {
$("#filter_search").html( $("#filter_search").html().replace('selected="selected"') );
$("#filter_all").attr( "selected" , "selected" )
$("#"+search_filter).attr( "selected" , "selected" )
var the_content = $("#filter_search").html();
$(""+the_content).insertAfter("#dynatable-query-search-my-ajax-table")
return "OK"
......@@ -841,16 +851,41 @@ function SearchFilters( elem ) {
var MODE = elem.value;
if( MODE == "filter_all") {
var result = Main_test(AjaxRecords , MODE)
console.clear()
var result = Main_test( ngrams_data.ngrams , ngrams_data.scores.initial , MODE)
console.log( result )
MyTable.data('dynatable').sorts.clear();
MyTable.data('dynatable').sorts.add('score', 0) // 1=ASCENDING,
MyTable.data('dynatable').process();
}
if( MODE == "filter_map-list") {
console.clear()
console.log("ngrams_map:")
console.log(ngrams_map)
var sub_ngrams_data = {
"ngrams":[],
"scores": $.extend({}, ngrams_data.scores)
}
for(var r in ngrams_data.ngrams) {
if ( ngrams_map[ngrams_data.ngrams[r].id] ) {
sub_ngrams_data["ngrams"].push( ngrams_data.ngrams[r] )
}
}
var result = Main_test(sub_ngrams_data , ngrams_data.scores.initial , MODE)
console.log( result )
// MyTable.data('dynatable').sorts.clear();
// MyTable.data('dynatable').sorts.add('score', 0) // 1=ASCENDING,
// MyTable.data('dynatable').process();
}
if( MODE == "filter_stop-list") {
console.clear()
console.log("ngrams_stop:")
console.log( {} )
}
}
......@@ -946,7 +981,8 @@ $.when(
}
}
// Initializing the Charts and Table
var result = Main_test( ngrams_data , FirstScore )
console.log( ngrams_data )
var result = Main_test( ngrams_data , FirstScore , "filter_all")
console.log( result )
// Listener for onchange Score-Selector
......@@ -954,8 +990,9 @@ $.when(
$("#ScoresBox").html(scores_div)
$("#scores_selector").on('change', function() {
console.log( this.value )
var result = Main_test( ngrams_data , this.value )
var result = Main_test( ngrams_data , this.value , "filter_all")
console.log( result )
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment