Commit 1eb80e68 authored by Romain Loth's avatar Romain Loth

debounce change labelsize

parent 2390499f
......@@ -824,6 +824,7 @@ TinaWebJS = function ( sigmacanvas ) {
$("#category1").hide();
//finished
var labelSizeTimeout = null
$("#slidercat0nodessize").freshslider({
step:.5,
min:0,
......@@ -831,13 +832,20 @@ TinaWebJS = function ( sigmacanvas ) {
value: TW.partialGraph.settings('labelSizeRatio'),
bgcolor:"#27c470",
onchange:function(value){
if (labelSizeTimeout) {
clearTimeout(labelSizeTimeout)
}
labelSizeTimeout = setTimeout(function(){
if (TW.partialGraph.settings('labelSizeRatio') != value) {
var adaptedLabelThreshold = (5 - value) + 1
console.log("value", value, "thres", adaptedLabelThreshold)
TW.partialGraph.settings('labelSizeRatio', value)
TW.partialGraph.settings('labelThreshold', adaptedLabelThreshold)
TW.partialGraph.render()
}
}, 200)
var adaptedLabelThreshold = (5 - value) + 1
// console.log("value", value, "thres", adaptedLabelThreshold)
TW.partialGraph.settings('labelSizeRatio', value)
TW.partialGraph.settings('labelThreshold', adaptedLabelThreshold)
TW.partialGraph.render()
}
});
......
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