Commit 7e263594 authored by Romain Loth's avatar Romain Loth

optimized settings so far + remarks

parent 435ca68c
...@@ -100,7 +100,7 @@ var semanticConverged=false; ...@@ -100,7 +100,7 @@ var semanticConverged=false;
var showLabelsIfZoom=1.0; var showLabelsIfZoom=1.0;
TW.edgeDefaultOpacity = 0.3 // opacity when true_color TW.edgeDefaultOpacity = 0.3 // opacity when true_color
TW.edgeGreyColor = "rgba(200, 200, 200, 0.5)"; TW.edgeGreyColor = "rgba(200, 200, 200, 0.5)";
TW.overSampling = false // costly hi-def rendering (true => pixelRatio x 2) TW.overSampling = true // costly hi-def rendering (true => pixelRatio x 2)
// ============ < / DEVELOPER OPTIONS > ============ // ============ < / DEVELOPER OPTIONS > ============
......
...@@ -217,20 +217,29 @@ if(RES["OK"]) { ...@@ -217,20 +217,29 @@ if(RES["OK"]) {
TW.graphData = {nodes: [], edges: []} TW.graphData = {nodes: [], edges: []}
TW.graphData = sigma_utils.FillGraph( initialState , catDict , dicts.nodes , dicts.edges , TW.graphData ); TW.graphData = sigma_utils.FillGraph( initialState , catDict , dicts.nodes , dicts.edges , TW.graphData );
// cf github.com/jacomyal/sigma.js/wiki/Settings
var customSettings = Object.assign( var customSettings = Object.assign(
{ {
drawEdges: true, drawEdges: true,
drawNodes: true, drawNodes: true,
drawLabels: true, drawLabels: true,
// nodesPowRatio: .1,
labelSize: "proportional", labelSize: "proportional",
font: "Ubuntu Condensed", font: "Ubuntu Condensed",
fontStyle: "bold",
// labelColor: "node", // labelColor: "node",
// fontStyle: "bold",
// nodesPowRatio: .3,
batchEdgesDrawing: true, batchEdgesDrawing: true,
hideEdgesOnMove: true,
enableHovering: true,
singleHover: true, singleHover: true,
enableEdgeHovering: false,
autoResize: true, autoResize: true,
rescaleIgnoreSize: true,
mouseEnabled: true, mouseEnabled: true,
touchEnabled: false touchEnabled: false
}, },
...@@ -256,6 +265,7 @@ if(RES["OK"]) { ...@@ -256,6 +265,7 @@ if(RES["OK"]) {
// - additionnaly supports 'forcelabel' node property // - additionnaly supports 'forcelabel' node property
sigma.canvas.labels.def = sigma_utils.twRender.canvas.labels.def sigma.canvas.labels.def = sigma_utils.twRender.canvas.labels.def
// ================================================================== // ==================================================================
// sigma js library invocation (https://github.com/jacomyal/sigma.js) // sigma js library invocation (https://github.com/jacomyal/sigma.js)
// ================================================================== // ==================================================================
......
...@@ -130,7 +130,7 @@ SigmaUtils = function () { ...@@ -130,7 +130,7 @@ SigmaUtils = function () {
}; };
// source: github.com/jacomyal/sigma.js/commit/25e2153 // source: github.com/jacomyal/sigma.js/commit/25e2153
// POSS: modify to incorporate mix colors // POSS: modify to incorporate mix colors (repaintEdges)
this.twRender.canvas.edges.curve = function(edge, source, target, context, settings) { this.twRender.canvas.edges.curve = function(edge, source, target, context, settings) {
var color = edge.color, var color = edge.color,
prefix = settings('prefix') || '', prefix = settings('prefix') || '',
...@@ -202,6 +202,7 @@ SigmaUtils = function () { ...@@ -202,6 +202,7 @@ SigmaUtils = function () {
context.fill(); context.fill();
}; };
// ================ /alternative rendering =====================
this.toggleEdges = function() { this.toggleEdges = function() {
var now_flag = TW.partialGraph.settings('drawEdges') var now_flag = TW.partialGraph.settings('drawEdges')
...@@ -209,15 +210,12 @@ SigmaUtils = function () { ...@@ -209,15 +210,12 @@ SigmaUtils = function () {
TW.partialGraph.render() TW.partialGraph.render()
} }
} // /SigmaUtils object
// ================ /alternative rendering =====================
}
//for socialgraph //for socialgraph
function showMeSomeLabels(N){ function showMeSomeLabels(N){
// NB why is this not using methods.manualForceLabel ?!
/*======= Show some labels at the beginning =======*/ /*======= Show some labels at the beginning =======*/
minIn=50, minIn=50,
maxIn=0, maxIn=0,
......
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