2 Module : Gargantext.Viz.Graph
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE NoImplicitPrelude #-}
13 {-# LANGUAGE TemplateHaskell #-}
14 {-# LANGUAGE DeriveGeneric #-}
16 module Gargantext.Viz.Graph
19 import GHC.Generics (Generic)
20 import Data.Aeson.TH (deriveJSON)
21 import Data.Text (Text)
24 import Gargantext.Prelude
25 import Gargantext.Core.Utils.Prefix (unPrefix)
27 import Data.Graph.Clustering.Louvain.CplusPlus (LouvainNode)
30 data TypeNode = Terms | Unknown
31 deriving (Show, Generic)
33 $(deriveJSON (unPrefix "") ''TypeNode)
35 data Attributes = Attributes { clust_default :: Int }
36 deriving (Show, Generic)
37 $(deriveJSON (unPrefix "") ''Attributes)
39 data Node = Node { n_size :: Int
43 , n_attributes :: Attributes
45 deriving (Show, Generic)
46 $(deriveJSON (unPrefix "n_") ''Node)
48 data Edge = Edge { e_source :: Int
53 deriving (Show, Generic)
54 $(deriveJSON (unPrefix "e_") ''Edge)
56 data Graph = Graph { g_nodes :: [Node]
59 deriving (Show, Generic)
60 $(deriveJSON (unPrefix "g_") ''Graph)
61 -----------------------------------------------------------