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

light settings when mobile client

parent debfb090
......@@ -31,6 +31,10 @@ TW.states = [TW.initialSystemState]
// SystemState() returns the current situation
TW.SystemState = function() { return TW.states.slice(-1)[0] }
// gracefully degrade our most costly settings if the user agent is mobile
if (/mobile/i.test(navigator.userAgent)) mobileAdaptConf()
// ======== [ what to do at start ] ========= //
console.log("Starting TWJS")
......
......@@ -954,3 +954,34 @@ function clusterColoring(daclass) {
set_ClustersLegend ( daclass )
TW.partialGraph.render();
}
// mobile versions should get lighter settings
function mobileAdaptConf() {
TW.conf.overSampling = false
TW.conf.dragNodesAvailable = false
TW.conf.fa2Available = false
TW.conf.filterSliders = false
TW.conf.moreLabelsUnderArea = false
TW.conf.maxPastStates = 2
TW.conf.minLengthAutoComplete = 2
TW.conf.maxSuggestionsAutoComplete = 4
TW.conf.sigmaJsDrawingProperties.drawEdges = false
TW.conf.sigmaJsDrawingProperties.enableHovering = false
TW.conf.sigmaJsDrawingProperties.touchEnabled = true
TW.conf.sigmaJsDrawingProperties.animationsTime = 0
TW.conf.sigmaJsDrawingProperties.mouseZoomDuration = 0
// TW.conf.sigmaJsDrawingProperties.defaultEdgeType = 'line'
// TW.conf.scanClusters = false
// TW.conf.twRendering = false
// £TODO better CSS for histogram on mobile
TW.conf.ModulesFlags.histogramModule = false
}
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