Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
eefff9a1
Commit
eefff9a1
authored
Nov 16, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added types for graph
parent
ca5fe2f6
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
340 deletions
+99
-340
Types.purs
src/Gargantext/Components/GraphExplorer/Types.purs
+13
-11
yarn.lock
yarn.lock
+86
-329
No files found.
src/Gargantext/Components/GraphExplorer/Types.purs
View file @
eefff9a1
...
...
@@ -39,18 +39,18 @@ derive instance newtypeGraphData :: Newtype GraphData _
instance decodeJsonGraphData :: DecodeJson GraphData where
decodeJson json = do
obj <- decodeJson json
nodes <- obj .? "nodes"
edges <- obj .? "edges"
nodes <- obj .? "
graph_
nodes"
edges <- obj .? "
graph_
edges"
pure $ GraphData { nodes, edges }
instance decodeJsonNode :: DecodeJson Node where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "id"
type_ <- obj .? "type"
label <- obj .? "label"
size <- obj .? "size"
attributes <- obj .? "attributes"
id_ <- obj .? "
node_
id"
type_ <- obj .? "
node_
type"
label <- obj .? "
node_
label"
size <- obj .? "
node_
size"
attributes <- obj .? "
node_
attributes"
pure $ Node { id_, type_, size, label, attributes }
instance decodeJsonCluster :: DecodeJson Cluster where
...
...
@@ -62,10 +62,10 @@ instance decodeJsonCluster :: DecodeJson Cluster where
instance decodeJsonEdge :: DecodeJson Edge where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "id"
source <- obj .? "source"
target <- obj .? "target"
weight <- obj .? "weight"
id_ <- obj .? "
edge_
id"
source <- obj .? "
edge_
source"
target <- obj .? "
edge_
target"
weight <- obj .? "
edge_
weight"
pure $ Edge { id_, source, target, weight }
newtype Legend = Legend {id_ ::Int , label :: String}
...
...
@@ -88,3 +88,5 @@ t' :: Node -> Legend
t' (Node r) = Legend { id_ : clustDefault, label : r.label}
where
(Cluster {clustDefault}) = r.attributes
yarn.lock
View file @
eefff9a1
This diff is collapsed.
Click to expand it.
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