Commit 4f9c734e authored by Romain Loth's avatar Romain Loth

louvain as hard-coded default for fillAttrsInForm

it becomes the default even if not selected in defaultColoring (because it is always available and interesting) and its filled with correct values even if never run before and therefore not in TW.Facets list
parent 99093f69
......@@ -662,7 +662,6 @@
<label for="choose-attr" class="smlabel input-group-addon">Attribute</label>
<select id="choose-attr" name="choose-attr"
class="custom-select form-control">
<option selected value="0"></option>
<!-- filled by fillAttrsInForm(.) -->
</select>
</div>
......
......@@ -1009,7 +1009,7 @@ function fillAttrsInForm(menuId, optionalAttTypeConstraint) {
}
// 2- ls | uniq all options (no matter what active type they belong too)
let uniqOptions = {}
let uniqOptions = {'clust_louvain': true}
for (let tid in actypes) {
let ty = actypes[tid]
for (var att in TW.Facets[ty]) {
......@@ -1035,6 +1035,9 @@ function fillAttrsInForm(menuId, optionalAttTypeConstraint) {
else {
opt.innerText = "(" + att + ")"
}
if (att == 'clust_louvain') {
opt.selected = true
}
if (att in TW.sigmaAttributes) {
opt.dataset.opttype = "auto"
}
......@@ -1043,6 +1046,8 @@ function fillAttrsInForm(menuId, optionalAttTypeConstraint) {
}
elChooser.appendChild(opt)
}
showAttrConf(null, 'clust_louvain')
}
// for optional questions:
......@@ -1088,8 +1093,8 @@ function colChangedHandler() {
}
function showAttrConf() {
let attrTitle = this.value
function showAttrConf(event, optionalAttrname) {
let attrTitle = optionalAttrname || this.value
let settings = TW.facetOptions[attrTitle] || {}
document.getElementById('attr-translation').value = settings.legend || attrTitle
document.getElementById('attr-col').value = settings.col || 'gradient'
......
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