Commit b1bbfaea authored by qlobbe's avatar qlobbe

working on level links

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