Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
56153d31
Unverified
Commit
56153d31
authored
Oct 03, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build only NodeType which are used and have an ID
parent
f420c18a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
42 deletions
+55
-42
Config.hs
src/Gargantext/Database/Config.hs
+44
-36
Node.hs
src/Gargantext/Database/Types/Node.hs
+11
-6
No files found.
src/Gargantext/Database/Config.hs
View file @
56153d31
...
...
@@ -28,51 +28,59 @@ import Data.List (lookup)
import
Gargantext.Database.Types.Node
import
Gargantext.Prelude
-- | Nodes are typed in the database according to a specific ID
--
nodeTypeInv
::
[(
NodeTypeId
,
NodeType
)]
nodeTypeInv
=
map
swap
nodeTypes
nodeTypeId
::
NodeType
->
NodeTypeId
nodeTypeId
n
=
case
n
of
NodeUser
->
1
Folder
->
2
NodeCorpus
->
3
-- NodeCorpus -> 30 TODO ERRR
Annuaire
->
31
Document
->
4
UserPage
->
41
--NodeSwap -> 19
---- Lists
-- StopList -> 5
-- GroupList -> 6
-- MainList -> 7
-- MapList -> 8
nodeTypes
::
[(
NodeType
,
NodeTypeId
)]
nodeTypes
=
[
(
NodeUser
,
1
)
,
(
Folder
,
2
)
,
(
NodeCorpus
,
3
)
,
(
NodeCorpus
,
30
)
,
(
Annuaire
,
31
)
,
(
Document
,
4
)
,
(
UserPage
,
41
)
--, (NodeSwap , 19)
------ Lists
-- , (StopList , 5)
-- , (GroupList , 6)
-- , (MainList , 7)
-- , (MapList , 8)
---- Scores
,
(
Occurrences
,
10
)
,
(
Graph
,
9
)
,
(
Dashboard
,
5
)
,
(
Chart
,
51
)
-- , (Cooccurrences , 9)
--
-- , (Specclusion , 11)
-- , (Genclusion , 18)
-- , (Cvalue , 12)
Occurrences
->
10
Graph
->
9
Dashboard
->
5
Chart
->
51
-- Cooccurrences -> 9
--
-- , (TfidfCorpus , 13)
-- , (TfidfGlobal , 14)
-- Specclusion -> 11
-- Genclusion -> 18
-- Cvalue -> 12
--
--
, (TirankLocal , 16)
--
, (TirankGlobal , 17)
--
TfidfCorpus -> 13
--
TfidfGlobal -> 14
--
-- TirankLocal -> 16
-- TirankGlobal -> 17
---- Node management
,
(
Favorites
,
15
)
Favorites
->
15
-- Project -> TODO
-- Individu -> TODO
-- Classification -> TODO
-- Lists -> TODO
-- Metrics -> TODO
--
]
-- | Nodes are typed in the database according to a specific ID
--
nodeTypeId
::
NodeType
->
NodeTypeId
nodeTypeId
tn
=
fromMaybe
(
panic
$
pack
$
"Typename "
<>
show
tn
<>
" does not exist"
)
(
lookup
tn
nodeTypes
)
nodeTypeInv
::
[(
NodeTypeId
,
NodeType
)]
nodeTypeInv
=
map
swap
nodeTypes
nodeTypes
::
[(
NodeType
,
NodeTypeId
)]
nodeTypes
=
[
(
n
,
nodeTypeId
n
)
|
n
<-
allNodeTypes
]
typeId2node
::
NodeTypeId
->
NodeType
typeId2node
tId
=
fromMaybe
(
panic
$
pack
$
"Type Id "
<>
show
tId
<>
" does not exist"
)
...
...
src/Gargantext/Database/Types/Node.hs
View file @
56153d31
...
...
@@ -275,15 +275,20 @@ type Document = Node HyperdataDocument
------------------------------------------------------------------------
data
NodeType
=
NodeUser
|
Project
|
Folder
-- | Project
|
Folder
|
NodeCorpus
|
Annuaire
|
Document
|
Individu
|
Document
-- | Individu
|
UserPage
|
Favorites
|
Graph
|
Dashboard
|
Chart
|
Classification
|
Lists
|
Metrics
|
Occurrences
deriving
(
Show
,
Read
,
Eq
,
Generic
)
-- | Classification
-- | Lists
-- | Metrics
|
Occurrences
deriving
(
Show
,
Read
,
Eq
,
Generic
,
Bounded
,
Enum
)
allNodeTypes
::
[
NodeType
]
allNodeTypes
=
[
minBound
..
]
instance
FromJSON
NodeType
instance
ToJSON
NodeType
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment