Commit f4c42b8f authored by Romain Loth's avatar Romain Loth

[minor] side column size initialization *before* graph rendering gives better results

parent 6e151202
......@@ -70,12 +70,13 @@ $("#network").html(files_selector)
var file = (Array.isArray(mainfile))?mainfile[0]:mainfile;
$.ajax({
url: file,
success : function(data, textStatus, jqXHR) {
var format = 'gexf' // default value
var header = jqXHR.getResponseHeader("Content-Type")
if ("msg" in data)
showDialog(file, false, textStatus, data["msg"])
if (header.indexOf("application/json") != -1)
format = 'compactjson'
Result = { "format":format , "data":data };
......@@ -83,11 +84,11 @@ $.ajax({
},
error: function(exception) {
// console.warn(JSON.stringify(exception, null, 2))
showErrorDialog(file, exception.status, exception.responseJSON.msg)
showDialog(file, true, exception.status, exception.responseJSON.msg)
}
});
function showErrorDialog(url, status, msg) {
function showDialog(url, hasError, status, msg) {
console.log('FUN t.main:showErrorDialog')
// hide loader gif etc
$("#semLoader").hide();
......@@ -175,6 +176,10 @@ function MainFunction( RES ) {
Filters[i]["#slidercat"+i+"edgesweight"] = true;
}
// apply width from settings on left column
document.getElementById('sidecolumn').style.width = sidecolumnSize ;
// [ Initiating Sigma-Canvas ]
var twjs_ = new TinaWebJS('#sigma-example');
print( twjs_.AdjustSigmaCanvas() );
......@@ -357,8 +362,6 @@ function MainFunction( RES ) {
partialGraph.stopForceAtlas2();
}, fa2seconds*1000);
// apply width from settings on left column
document.getElementById('sidecolumn').style.width = sidecolumnSize ;
}
......
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