-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
module Gargantext.Viz.Phylo.Main
import Data.GraphViz
+import qualified Data.ByteString as DB
+import qualified Data.List as List
+import qualified Data.Map as Map
import Data.Maybe
+import qualified Data.Text as Text
import Data.Text (Text)
import Debug.Trace (trace)
import GHC.IO (FilePath)
+
import Gargantext.API.Ngrams.Tools (getTermsWith)
import Gargantext.Core.Types
import Gargantext.Database.Action.Flow
+import Gargantext.Database.Admin.Types.Hyperdata
+import Gargantext.Database.Query.Table.Node(defaultList)
+import Gargantext.Database.Query.Table.NodeNode (selectDocs)
import Gargantext.Database.Schema.Ngrams (NgramsType(..))
-import Gargantext.Database.Schema.Node (defaultList)
-import Gargantext.Database.Schema.NodeNode (selectDocs)
import Gargantext.Prelude
import Gargantext.Text.Context (TermList)
import Gargantext.Text.Terms.WithList
import Gargantext.Viz.Phylo.Tools
import Gargantext.Viz.Phylo.View.Export
import Gargantext.Viz.Phylo.View.ViewMaker -- TODO Just Maker is fine
-import qualified Data.ByteString as DB
-import qualified Data.List as List
-import qualified Data.Map as Map
-import qualified Data.Text as Text
type MinSizeBranch = Int
flowPhylo cId = do
list <- defaultList cId
- termList <- Map.toList <$> getTermsWith Text.words [list] NgramsTerms GraphTerm
+ termList <- Map.toList <$> getTermsWith Text.words [list] NgramsTerms MapTerm
docs' <- catMaybes
- <$> map (\h -> (,) <$> _hyperdataDocument_publication_year h
- <*> _hyperdataDocument_abstract h
+ <$> map (\h -> (,) <$> _hd_publication_year h
+ <*> _hd_abstract h
)
<$> selectDocs cId