Commit afe77960 authored by Romain Loth's avatar Romain Loth

WIP facet legends 1/2 (samerange)

added binning mode 'samerange' + new syntax for choosing it in settings + finished replacing atts_2_exclude + possibilities for better string cluster mapping TODO: color functions per settings
parent 0c79ed7e
......@@ -43,10 +43,18 @@ This will still evolve but the main steps for any graph initialization messily u
- `somenode.attributes`: the `attributes` property is always an object
- any attribute listed in the sourcenode.attributes will be indexed if the TW.scanClusters flag is true
- data type and style of processing (for heatmap, or for classes, etc.) should be stipulated in settings
- the mapping from attribute values to matching nodes is in TW.Clusters.aType.anAttr.aValue.map
- coloration: "`age`" "`growth_rate`" + any attribute of type float or int
- clustering: "`cluster_index`" ou nom figurant dans `TW.conf.nodeClusAtt`
- vocabulary: (en cours) any attribute of type string and where the amount of distinct values is < TW.somesettings
- finally in GUI we can associate 3 types of coloration
- `"gradient"` coloration
- available for any attribute that looks like a continuous metric
- `"heatmap"` coloration
- colors from cold to hot centered on a white "neutral" color
- applied for attributes stipulated in settings: eg "`age`" "`growth_rate`"
- `"cluster"` coloration for str or num classes like modularity_class, affiliation, etc.
- we use contrasted values from colorList
- automatically applied for "`cluster_index`" or any name in `TW.conf.nodeClusAtt`
## User interaction mecanisms
......
......@@ -64,6 +64,30 @@ TW.conf = (function(TW){
'growth_rate': 12
}
// facetOptions: choose here the visual result of your node attributes
// 3 possible coloring functions
// - cluster (contrasted colors for attributes describing *classes*)
// - gradient (uniform map from a numeric attribute to red/yellow gradient)
// - heatmap (from blue to red/brown, centered on a white "neutral" color)
// 2 possible binning modes
// - samerange: constant intervals between each bin
// - samepop: constant cardinality inside each class (~ quantiles)
// Cases with no binning: if type is not numeric or if there is less than n vdistinct values
TWConf.facetOptions = {
// attribute | coloring | number | binning
// name | function | of bins | mode
// --------------------------------------------------------------------
'numuniform' : {'col': "gradient", 'n': 3, 'binmode': 'samerange'},
'numpareto' : {'col': "gradient", 'n': 8, 'binmode': 'samepop' },
'intfewvalues' : {'col': "heatmap" , 'n': 4, 'binmode': 'samerange'},
'countryuniform':{'col': "cluster" },
}
// other POSS option: display attribute value in label or not ?
// default clustering attribute (<---> used for initial node colors)
TWConf.nodeClusAtt = "modularity_class"
......@@ -101,7 +125,7 @@ TW.conf = (function(TW){
// -----------------------------
TWConf.filterSliders = true // show sliders for nodes/edges subsets
TWConf.colorsByAtt = false; // show "Set colors" menu
TWConf.colorsByAtt = true; // show "Set colors" menu
TWConf.deselectOnclickStage = true // click on background remove selection ?
// (except when dragging)
......@@ -152,7 +176,7 @@ TW.conf = (function(TW){
// nodes
defaultNodeColor: "#333",
twNodeRendBorderSize: 1, // node borders (only iff ourRendering)
twNodeRendBorderColor: "#eee",
twNodeRendBorderColor: "#222",
// edges
minEdgeSize: 2, // in fact used in tina as edge size
......@@ -176,7 +200,7 @@ TW.conf = (function(TW){
// selected nodes <=> special label
twSelectedColor: "node", // "node" for a label bg like the node color,
twSelectedColor: "default", // "node" for a label bg like the node color,
// "default" for note-like yellow
// not selected <=> grey
......@@ -221,7 +245,7 @@ TW.conf = (function(TW){
// show verbose console logs...
logFetchers: false, // ...about ajax/fetching of graph data
logParsers: false, // ...about parsing said data
logFacets: false, // ...about parsing node attribute:value facets
logFacets: true, // ...about parsing node attribute:value facets
logSettings: false, // ...about settings at Tina and Sigma init time
logSelections: false
}
......
This diff is collapsed.
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