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)
23 import Gargantext.Prelude
24 import Gargantext.Core.Utils.Prefix (unPrefix)
26 -----------------------------------------------------------
27 data TypeNode = Terms | Unknown
28 deriving (Show, Generic)
30 $(deriveJSON (unPrefix "") ''TypeNode)
32 data Attributes = Attributes { clust_default :: Int }
33 deriving (Show, Generic)
34 $(deriveJSON (unPrefix "") ''Attributes)
36 data Node = Node { n_size :: Int
40 , n_attributes :: Attributes
42 deriving (Show, Generic)
43 $(deriveJSON (unPrefix "n_") ''Node)
45 data Edge = Edge { e_source :: Int
50 deriving (Show, Generic)
51 $(deriveJSON (unPrefix "e_") ''Edge)
53 data Graph = Graph { g_nodes :: [Node]
56 deriving (Show, Generic)
57 $(deriveJSON (unPrefix "g_") ''Graph)
59 -----------------------------------------------------------