Highlight nodes being processed.

master
Alinson S. Xavier 11 years ago
parent a004f36043
commit bd7d36a5ab

@ -1,7 +1,9 @@
var visjs_options = { var visjs_options = {
nodes: { nodes: {
borderWidth: 3,
borderWidthSelected: 3,
color: { color: {
border: '#bbb', border: '#fff',
background: '#fff', background: '#fff',
highlight: { highlight: {
border: '#fff', border: '#fff',
@ -48,5 +50,5 @@ var visjs_options = {
} }
}; };
var seed_url = 'http://www.scopus.com/results/results.url?sort=plf-f&src=s&st1=urea+permeation+immobilized&sid=B0FE19FE3CFF4CCF86DD857756E90636.FZg2ODcJC9ArCe8WOZPvA%3a1400&sot=b&sdt=b&sl=34&s=TITLE%28urea+permeation+immobilized%29&origin=searchbasic&txGid=B0FE19FE3CFF4CCF86DD857756E90636.FZg2ODcJC9ArCe8WOZPvA%3a140'; var node_queued_color = jQuery.extend({},visjs_options.nodes.color);
node_queued_color.background = '#da2d2f';

@ -51,14 +51,22 @@ ScholarCrawler.prototype.process = function(url, parent_node)
if(crawler.node_ids.indexOf(child['id']) == -1) if(crawler.node_ids.indexOf(child['id']) == -1)
{ {
if(child['depth'] < crawler.max_depth && child['n_citations'] > 0) {
crawler.push(child['citations_url'], child);
child.color = node_queued_color;
}
crawler.node_ids.push(child['id']); crawler.node_ids.push(child['id']);
crawler.nodes.add(child); crawler.nodes.add(child);
if(child['depth'] < crawler.max_depth) {
crawler.push(child['citations_url'], child);
} }
} }
if(!(parent_node === null))
{
parent_node.color = visjs_options.nodes.color;
crawler.nodes.update(parent_node);
} }
}); });
}; };

@ -1,6 +1,6 @@
function ScopusParser() {}; function ScopusParser() {};
ScopusParser.prototype.parse = function(url, callback) ScopusParser.prototype._parse_results_page = function(url, callback)
{ {
var iframe = document.createElement("iframe"); var iframe = document.createElement("iframe");
$(iframe).hide(); $(iframe).hide();
@ -15,6 +15,7 @@ ScopusParser.prototype.parse = function(url, callback)
if(select_pages.val() != 200) { if(select_pages.val() != 200) {
select_pages.val(200); select_pages.val(200);
select_pages.change(); select_pages.change();
return;
} }
$(ibody).find(".resultItemLists li").each(function(index, li) $(ibody).find(".resultItemLists li").each(function(index, li)
@ -56,3 +57,10 @@ ScopusParser.prototype.parse = function(url, callback)
document.body.removeChild(iframe); document.body.removeChild(iframe);
}); });
} }
ScopusParser.prototype.parse = function(url, callback)
{
if(url === undefined) return;
//if(url.indexOf("/results/") > 0 || url.indexOf("/search/") > 0)
this._parse_results_page(url, callback);
}