Commit 85f5697f authored by PkSM3's avatar PkSM3

manual-clustering: by country

parent 4a2a92f3
...@@ -147,6 +147,12 @@ ...@@ -147,6 +147,12 @@
</a></li> </a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right">
<li><a>
<button id="clustbyCC">Clusterize</button>
</a></li>
</ul>
</div> </div>
<!-- <!--
...@@ -275,6 +281,7 @@ ...@@ -275,6 +281,7 @@
<script src="geomap2/js/jquery.mapael.js" charset="utf-8" ></script> <script src="geomap2/js/jquery.mapael.js" charset="utf-8" ></script>
<script src="geomap2/js/maps/world_countries.js" charset="utf-8" ></script> <script src="geomap2/js/maps/world_countries.js" charset="utf-8" ></script>
<script src="geomap2/examples.js" charset="utf-8" ></script> <script src="geomap2/examples.js" charset="utf-8" ></script>
<script src="geomap2/js/countries_iso3166.js" charset="utf-8" ></script>
<link rel="stylesheet" type="text/css" href="geomap2/css/geo.css" /> <link rel="stylesheet" type="text/css" href="geomap2/css/geo.css" />
<!-- <script src="tinawebJS/js/canvas2image/base64.js" type="text/javascript"></script>--> <!-- <script src="tinawebJS/js/canvas2image/base64.js" type="text/javascript"></script>-->
......
No preview for this file type
No preview for this file type
...@@ -226,6 +226,8 @@ class extract: ...@@ -226,6 +226,8 @@ class extract:
info['keywords_ids'] = res3[n-1]['keywords_ids'].split(','); info['keywords_ids'] = res3[n-1]['keywords_ids'].split(',');
info['keywords'] = res3[n-1]['keywords']; info['keywords'] = res3[n-1]['keywords'];
info['country'] = res3[n-1]['country']; info['country'] = res3[n-1]['country'];
info['ACR'] = res3[n-1]['affiliation_acronym']
info['CC'] = res3[n-1]['norm_country'];
info['homepage'] = res3[n-1]['homepage']; info['homepage'] = res3[n-1]['homepage'];
info['lab'] = res3[n-1]['lab']; info['lab'] = res3[n-1]['lab'];
info['affiliation'] = res3[n-1]['affiliation']; info['affiliation'] = res3[n-1]['affiliation'];
...@@ -491,6 +493,10 @@ class extract: ...@@ -491,6 +493,10 @@ class extract:
node["type"] = "Document" node["type"] = "Document"
node["label"] = nodeLabel node["label"] = nodeLabel
node["color"] = color node["color"] = color
node["CC"] = self.scholars[idNode]["CC"]
node["ACR"] = self.scholars[idNode]["ACR"]
if node["ACR"]=="": node["ACR"]="-"
if node["CC"]=="": node["CC"]="-"
node["term_occ"] = "12" node["term_occ"] = "12"
if coordsRAW: node["x"] = str(coords[idNode]['x']) if coordsRAW: node["x"] = str(coords[idNode]['x'])
if coordsRAW: node["y"] = str(coords[idNode]['y']) if coordsRAW: node["y"] = str(coords[idNode]['y'])
......
No preview for this file type
...@@ -175,6 +175,8 @@ for (var i in gexfDict){ ...@@ -175,6 +175,8 @@ for (var i in gexfDict){
gexfDictReverse[gexfDict[i]]=i; gexfDictReverse[gexfDict[i]]=i;
} }
var colorList = ["#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059", "#FFDBE5", "#7A4900", "#0000A6", "#63FFAC", "#B79762", "#004D43", "#8FB0FF", "#997D87", "#5A0007", "#809693", "#FEFFE6", "#1B4400", "#4FC601", "#3B5DFF", "#4A3B53", "#FF2F80", "#61615A", "#BA0900", "#6B7900", "#00C2A0", "#FFAA92", "#FF90C9", "#B903AA", "#D16100", "#DDEFFF", "#000035", "#7B4F4B", "#A1C299", "#300018", "#0AA6D8", "#013349", "#00846F", "#372101", "#FFB500", "#C2FFED", "#A079BF", "#CC0744", "#C0B9B2", "#C2FF99", "#001E09", "#00489C", "#6F0062", "#0CBD66", "#EEC3FF", "#456D75", "#B77B68", "#7A87A1", "#788D66", "#885578", "#FAD09F", "#FF8A9A", "#D157A0", "#BEC459", "#456648", "#0086ED", "#886F4C","#34362D", "#B4A8BD", "#00A6AA", "#452C2C", "#636375", "#A3C8C9", "#FF913F", "#938A81", "#575329", "#00FECF", "#B05B6F", "#8CD0FF", "#3B9700", "#04F757", "#C8A1A1", "#1E6E00", "#7900D7", "#A77500", "#6367A9", "#A05837", "#6B002C", "#772600", "#D790FF", "#9B9700", "#549E79", "#FFF69F", "#201625", "#72418F", "#BC23FF", "#99ADC0", "#3A2465", "#922329", "#5B4534", "#FDE8DC", "#404E55", "#0089A3", "#CB7E98", "#A4E804", "#324E72", "#6A3A4C", "#83AB58", "#001C1E", "#D1F7CE", "#004B28", "#C8D0F6", "#A3A489", "#806C66", "#222800", "#BF5650", "#E83000", "#66796D", "#DA007C", "#FF1A59", "#8ADBB4", "#1E0200", "#5B4E51", "#C895C5", "#320033", "#FF6832", "#66E1D3", "#CFCDAC", "#D0AC94", "#7ED379", "#012C58"];
var RVUniformC = function(seed){ var RVUniformC = function(seed){
this.a=16807; this.a=16807;
this.b=0; this.b=0;
......
...@@ -681,6 +681,10 @@ function theListeners(){ ...@@ -681,6 +681,10 @@ function theListeners(){
}); });
$("#clustbyCC").click(function(){
clustersBy("country");
});
$.doTimeout(10,function (){ $.doTimeout(10,function (){
var deftoph=$("#defaultop").height(); var deftoph=$("#defaultop").height();
var refh=$("#fixedtop").height(); var refh=$("#fixedtop").height();
......
...@@ -624,6 +624,8 @@ function extractFromJson(data,seed){ ...@@ -624,6 +624,8 @@ function extractFromJson(data,seed){
node.shape="square"; node.shape="square";
numberOfDocs++; numberOfDocs++;
node.size=desirableScholarSize; node.size=desirableScholarSize;
node.CC = nodesNodes[i].CC;
node.ACR = nodesNodes[i].ACR;
} }
else { else {
node.type="NGram"; node.type="NGram";
......
...@@ -148,3 +148,44 @@ function getClientTime(){ ...@@ -148,3 +148,44 @@ function getClientTime(){
var result = (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds); var result = (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds);
return result; return result;
} }
function getCountries(){
var nodes = getVisibleNodes();
var countries = {}
pr("in getCountries")
for(var i in nodes) {
// pr(i)
// pr(nodes[i].id+" : "+nodes[i].attr["CC"]+" , "+nodes[i].attr["ACR"])
if (nodes[i].attr["CC"]!="-")
countries[nodes[i].attr["CC"]]=1
// pr("")
}
return Object.keys(countries);
}
function clustersBy(daclass) {
if(daclass=="country") {
CCs = getCountries()
CCxID = {}
for(var i in CCs) {
code = CCs[i]
CCxID[code]=parseInt(i);
}
pr(CCxID)
var nodes = getVisibleNodes();
colorList.sort(function(){ return Math.random()-0.5; });
pr(colorList);
for(var i in nodes) {
cc = nodes[i].attr["CC"]
if( !isUndef( cc ) && cc!="-" ) {
nodes[i].color = colorList[ CCxID[cc] ];
}
}
partialGraph.refresh()
partialGraph.draw();
}
}
\ No newline at end of file
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