1. Reduced size of the json that gets sent to the client-side.

2. Removed unnecessary stop words removal code.
This commit is contained in:
cdtank 2011-04-14 16:53:52 +00:00
parent 6209f2af82
commit 680f9ec2d4
3 changed files with 11 additions and 31 deletions

View file

@ -38,7 +38,7 @@ var year;
var colors, prevColor, colorToAssign, var colors, prevColor, colorToAssign,
colorToRemove, renderedObjects, URIToEntityRecord, colorToRemove, renderedObjects, URIToEntityRecord,
setOfLabels, URIToCheckedEntities, stopWordsToCount; setOfLabels, URIToCheckedEntities, STOP_WORDS_FOR_TABLE;
var graphContainer; var graphContainer;
var tableDiv; var tableDiv;
@ -69,8 +69,11 @@ function initConstants() {
URIToEntityRecord = {}; URIToEntityRecord = {};
setOfLabels = []; setOfLabels = [];
URIToCheckedEntities = {}; URIToCheckedEntities = {};
stopWordsToCount = {};
STOP_WORDS_FOR_TABLE = ["Person", "Organization", "Agent"];
lastCachedAtDateTimes = []; lastCachedAtDateTimes = [];
//options for Flot //options for Flot
FlotOptions = { FlotOptions = {
legend : { legend : {

View file

@ -1040,8 +1040,6 @@ function removeCheckBoxFromGlobalSet(checkbox){
*/ */
function prepareTableForDataTablePagination(jsonData, dataTableParams){ function prepareTableForDataTablePagination(jsonData, dataTableParams){
resetStopWordCount();
var table = $('<table>'); var table = $('<table>');
table.attr('cellpadding', '0'); table.attr('cellpadding', '0');
table.attr('cellspacing', '0'); table.attr('cellspacing', '0');
@ -1165,8 +1163,6 @@ function prepareTableForDataTablePagination(jsonData, dataTableParams){
*/ */
function reloadDataTablePagination(preselectedEntityURIs, jsonData){ function reloadDataTablePagination(preselectedEntityURIs, jsonData){
resetStopWordCount();
/* /*
* In case no entities are selected, we want that redraw should happen so that top entities are * In case no entities are selected, we want that redraw should happen so that top entities are
* pre-selected. * pre-selected.
@ -1246,24 +1242,14 @@ function updateRowHighlighter(linkedCheckBox){
linkedCheckBox.closest("tr").removeClass('datatablerowhighlight'); linkedCheckBox.closest("tr").removeClass('datatablerowhighlight');
} }
function resetStopWordCount(){
stopWordsToCount["Person"] = 0;
stopWordsToCount["Organization"] = 0;
}
function removeStopWords(val) { function removeStopWords(val) {
var typeStringWithoutStopWords = "";
$.each(val.organizationType, function(index, value){ return $.map(val.organizationType, function(type, i){
if(value == "Person"){
stopWordsToCount["Person"]++; if ($.inArray(type, STOP_WORDS_FOR_TABLE) < 0) {
}else if(value == "Organization"){ return (type);
stopWordsToCount["Organization"]++;
}else{
typeStringWithoutStopWords += ', '+ value;
} }
}); }).join(", ");
return typeStringWithoutStopWords.substring(1, typeStringWithoutStopWords.length);
} }
function setEntityLevel(entityLevel){ function setEntityLevel(entityLevel){

View file

@ -19,15 +19,6 @@ public class JsonObject {
private String entityURI; private String entityURI;
private String visMode; private String visMode;
private List<String> organizationType = new ArrayList<String>(); private List<String> organizationType = new ArrayList<String>();
private List<String> stopWords = new ArrayList<String>();
public List<String> getStopWords() {
return stopWords;
}
public void setStopWords(List<String> stopWords) {
this.stopWords = stopWords;
}
public List<String> getOrganizationTypes() { public List<String> getOrganizationTypes() {
return organizationType; return organizationType;