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:
parent
6209f2af82
commit
680f9ec2d4
3 changed files with 11 additions and 31 deletions
|
@ -38,7 +38,7 @@ var year;
|
|||
|
||||
var colors, prevColor, colorToAssign,
|
||||
colorToRemove, renderedObjects, URIToEntityRecord,
|
||||
setOfLabels, URIToCheckedEntities, stopWordsToCount;
|
||||
setOfLabels, URIToCheckedEntities, STOP_WORDS_FOR_TABLE;
|
||||
|
||||
var graphContainer;
|
||||
var tableDiv;
|
||||
|
@ -69,8 +69,11 @@ function initConstants() {
|
|||
URIToEntityRecord = {};
|
||||
setOfLabels = [];
|
||||
URIToCheckedEntities = {};
|
||||
stopWordsToCount = {};
|
||||
|
||||
STOP_WORDS_FOR_TABLE = ["Person", "Organization", "Agent"];
|
||||
|
||||
lastCachedAtDateTimes = [];
|
||||
|
||||
//options for Flot
|
||||
FlotOptions = {
|
||||
legend : {
|
||||
|
|
|
@ -1040,8 +1040,6 @@ function removeCheckBoxFromGlobalSet(checkbox){
|
|||
*/
|
||||
function prepareTableForDataTablePagination(jsonData, dataTableParams){
|
||||
|
||||
resetStopWordCount();
|
||||
|
||||
var table = $('<table>');
|
||||
table.attr('cellpadding', '0');
|
||||
table.attr('cellspacing', '0');
|
||||
|
@ -1165,8 +1163,6 @@ function prepareTableForDataTablePagination(jsonData, dataTableParams){
|
|||
*/
|
||||
function reloadDataTablePagination(preselectedEntityURIs, jsonData){
|
||||
|
||||
resetStopWordCount();
|
||||
|
||||
/*
|
||||
* In case no entities are selected, we want that redraw should happen so that top entities are
|
||||
* pre-selected.
|
||||
|
@ -1246,24 +1242,14 @@ function updateRowHighlighter(linkedCheckBox){
|
|||
linkedCheckBox.closest("tr").removeClass('datatablerowhighlight');
|
||||
}
|
||||
|
||||
function removeStopWords(val) {
|
||||
|
||||
return $.map(val.organizationType, function(type, i){
|
||||
|
||||
function resetStopWordCount(){
|
||||
stopWordsToCount["Person"] = 0;
|
||||
stopWordsToCount["Organization"] = 0;
|
||||
}
|
||||
|
||||
function removeStopWords(val){
|
||||
var typeStringWithoutStopWords = "";
|
||||
$.each(val.organizationType, function(index, value){
|
||||
if(value == "Person"){
|
||||
stopWordsToCount["Person"]++;
|
||||
}else if(value == "Organization"){
|
||||
stopWordsToCount["Organization"]++;
|
||||
}else{
|
||||
typeStringWithoutStopWords += ', '+ value;
|
||||
if ($.inArray(type, STOP_WORDS_FOR_TABLE) < 0) {
|
||||
return (type);
|
||||
}
|
||||
});
|
||||
return typeStringWithoutStopWords.substring(1, typeStringWithoutStopWords.length);
|
||||
}).join(", ");
|
||||
}
|
||||
|
||||
function setEntityLevel(entityLevel){
|
||||
|
|
|
@ -19,16 +19,7 @@ public class JsonObject {
|
|||
private String entityURI;
|
||||
private String visMode;
|
||||
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() {
|
||||
return organizationType;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue