Commit 69e7c039 authored by Romain Loth's avatar Romain Loth

WIP making facets work in bipartite case + further factorizing

facets (ie clusters and other searchable/colorable attributes) should work with bipartite case, but it meant factorizing facetsBinning() and updateValueFacets() from commit 71507331
parent d06a320b
......@@ -21,11 +21,17 @@ This will still evolve but the main steps for any graph initialization messily u
#### About source data
- doc/sem typing: follows the node property "`category`"
- doc/sem typing: follows the node property "`type`" or if absent, "`category`"
- if the category name is "document" => catSoc (type 0)
- if the category name contains the str "term" => catSem (type 1)
- coloration: "`age`" "`growth_rate`" + any attribute of type float or int
- clustering: "`cluster_index`" ou nom figurant dans `TW.nodeClusAtt`
- `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
- 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.nodeClusAtt`
- vocabulary: (en cours) any attribute of type string and where the amount of distinct values is < TW.somesettings
## User interaction mecanisms
......
This diff is collapsed.
......@@ -816,17 +816,24 @@ function clustersBy(daclass) {
for(var nid in NodeID_Val) {
var newval_color = Math.round( ( Min_color+(NodeID_Val[nid]["round"]-real_min)*((Max_color-Min_color)/(real_max-real_min)) ) );
var hex_color = rgbToHex(255, (255-newval_color) , 0)
TW.partialGraph.graph.nodes(nid).color = hex_color
TW.partialGraph.graph.nodes(nid).customAttrs.alt_color = hex_color
// FIXME not used ?
TW.partialGraph.graph.nodes(nid).customAttrs.altgrey_color = false
let n = TW.partialGraph.graph.nodes(nid)
if (n && !n.hidden) {
n.color = hex_color
n.customAttrs.alt_color = hex_color
// FIXME not used ?
n.customAttrs.altgrey_color = false
// £TODO SETTING SIZE HERE SHOULD BE OPTIONAL
var newval_size = Math.round( ( Min_size+(NodeID_Val[nid]["round"]-real_min)*((Max_size-Min_size)/(real_max-real_min)) ) );
n.size = newval_size;
n.label = "("+NodeID_Val[nid]["real"].toFixed(min_pow)+") "+TW.Nodes[nid].label
}
var newval_size = Math.round( ( Min_size+(NodeID_Val[nid]["round"]-real_min)*((Max_size-Min_size)/(real_max-real_min)) ) );
TW.partialGraph.graph.nodes(nid).size = newval_size;
// console.log("real:"+ NodeID_Val[i]["real"] + " | newvalue: "+newval_size)
TW.partialGraph.graph.nodes(nid).label = "("+NodeID_Val[nid]["real"].toFixed(min_pow)+") "+TW.Nodes[nid].label
}
// [ / Scaling node colours(0-255) and sizes(2-7) ]
......@@ -855,15 +862,18 @@ function repaintEdges() {
}
else {
let e = TW.partialGraph.graph.edges(eid)
let src = TW.partialGraph.graph.nodes(idPair[0])
let tgt = TW.partialGraph.graph.nodes(idPair[1])
if (e) {
let src = TW.partialGraph.graph.nodes(idPair[0])
let tgt = TW.partialGraph.graph.nodes(idPair[1])
if (src && tgt) {
let src_color = src.customAttrs.alt_color || '#555'
let tgt_color = tgt.customAttrs.alt_color || '#555'
e.customAttrs.alt_rgb = sigmaTools.edgeRGB(src_color,tgt_color)
// we don't set e.color because opacity may vary if selected or not
if (src && tgt) {
let src_color = src.customAttrs.alt_color || '#555'
let tgt_color = tgt.customAttrs.alt_color || '#555'
e.customAttrs.alt_rgb = sigmaTools.edgeRGB(src_color,tgt_color)
// we don't set e.color because opacity may vary if selected or not
}
}
}
}
......
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