Commit b1bbfaea authored by qlobbe's avatar qlobbe

working on level links

parent d30dd753
......@@ -80,7 +80,8 @@ phyloToClusters lvl clus p = Map.fromList
--------------------------------------
graphs :: [([GroupNode],[GroupEdge])]
graphs = traceGraph lvl (getThreshold prox)
$ map (\prd -> groupsToGraph (periodsToNbDocs [prd] p) prox (getGroupsWithFilters lvl prd p)) periods
$ map (\prd -> groupsToGraph (periodsToNbDocs [prd] p) prox (getGroupsWithFilters lvl prd p))
$ trace (show(map (\prd -> (prd,length $ getGroupsWithFilters lvl prd p)) periods)) periods
--------------------------------------
prox :: Proximity
prox = getProximity clus
......
......@@ -21,7 +21,7 @@ module Gargantext.Viz.Phylo.LevelMaker
import Control.Lens hiding (both, Level)
import Data.List ((++), sort, concat, nub, zip, last)
import Data.Map (Map, (!), empty, singleton)
import Data.Map (Map, (!), empty, singleton,mapWithKey)
import Data.Text (Text)
import Data.Tuple.Extra
import Gargantext.Prelude
......@@ -151,9 +151,12 @@ toNthLevel lvlMax prox clus p
$ setPhyloBranches (lvl + 1)
$ transposePeriodLinks (lvl + 1)
$ setLevelLinks (lvl, lvl + 1)
$ trace (show (mapWithKey (\k v -> (k,length v)) clusters))
$ addPhyloLevel (lvl + 1)
(phyloToClusters lvl clus p) p
(clusters) p
where
--------------------------------------
clusters = phyloToClusters lvl clus p
--------------------------------------
lvl :: Level
lvl = getLastLevel p
......
......@@ -240,7 +240,7 @@ toLevelUp lst p = Map.toList
where
--------------------------------------
pointers :: [Pointer]
pointers = map (\(id,v) -> (getGroupLevelParentId $ getGroupFromId id p, v)) lst
pointers = trace(show(map (\(id,_) -> length $ getGroupLevelParentId $ getGroupFromId id p) lst)) $ map (\(id,v) -> (getGroupLevelParentId $ getGroupFromId id p, v)) lst
--------------------------------------
......@@ -250,7 +250,7 @@ transposePeriodLinks lvl p = alterGroupWithLevel
(\g ->
--------------------------------------
let childs = getGroupsFromIds (map fst $ getGroupLevelChilds g) p
ascLink = toLevelUp (concat $ map getGroupPeriodParents childs) p
ascLink = trace (show(length childs)) $ toLevelUp (concat $ map getGroupPeriodParents childs) p
desLink = toLevelUp (concat $ map getGroupPeriodChilds childs) p
--------------------------------------
in g & phylo_groupPeriodParents %~ (++ ascLink)
......
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