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
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
Compare Revisions
dev...340-graph-gexf-export-on-the-node-tags-add-a-weight-attribute
Source
340-graph-gexf-export-on-the-node-tags-add-a-weight-attribute
Select Git revision
...
Target
dev
Select Git revision
Compare
Commits (2)
adding weight attribute
· d937e72e
Fabien Manière
authored
1 year ago
d937e72e
export to GEXF: adding the weight attribute to all nodes
· d7948acb
Fabien Maniere
authored
4 months ago
d7948acb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
GEXF.hs
src/Gargantext/Core/Viz/Graph/GEXF.hs
+14
-3
No files found.
src/Gargantext/Core/Viz/Graph/GEXF.hs
View file @
d7948acb
...
...
@@ -51,19 +51,30 @@ graphToXML (G.Graph { .. }) = root _graph_nodes _graph_edges
desc
=
XML
.
tag
"description"
mempty
$
XML
.
content
"Gargantext gexf file"
graph
::
(
Monad
m
)
=>
[
G
.
Node
]
->
[
G
.
Edge
]
->
ConduitT
i
XML
.
Event
m
()
graph
gn
ge
=
XML
.
tag
"graph"
params
$
(
nodes
gn
)
<>
(
edges
ge
)
graph
gn
ge
=
XML
.
tag
"graph"
params
$
graphAttributes
<>
(
nodes
gn
)
<>
(
edges
ge
)
where
params
=
XML
.
attr
"mode"
"static"
<>
XML
.
attr
"defaultedgetype"
"directed"
graphAttributes
::
(
Monad
m
)
=>
ConduitT
i
XML
.
Event
m
()
graphAttributes
=
XML
.
tag
"attributes"
graphAttributesParams
$
graphAttributeWeight
where
graphAttributesParams
=
XML
.
attr
"class"
"node"
graphAttributeWeight
=
XML
.
tag
"attribute"
attrWeightParams
$
XML
.
content
""
attrWeightParams
=
XML
.
attr
"id"
"0"
<>
XML
.
attr
"title"
"weight"
<>
XML
.
attr
"type"
"integer"
nodes
::
(
Monad
m
)
=>
[
G
.
Node
]
->
ConduitT
i
XML
.
Event
m
()
nodes
gn
=
XML
.
tag
"nodes"
mempty
(
yieldMany
gn
.|
awaitForever
node'
)
node'
::
(
Monad
m
)
=>
G
.
Node
->
ConduitT
i
XML
.
Event
m
()
node'
(
G
.
Node
{
..
})
=
XML
.
tag
"node"
params
(
XML
.
tag
"viz:size"
sizeParams
$
XML
.
content
""
)
-- node' (G.Node { .. }) = XML.tag "node" params (XML.tag "viz:size" sizeParams $ XML.content "")
node'
(
G
.
Node
{
..
})
=
XML
.
tag
"node"
params
$
XML
.
tag
"attvalues"
mempty
$
XML
.
tag
"attvalue"
sizeParams
mempty
where
params
=
XML
.
attr
"id"
node_id
<>
XML
.
attr
"label"
node_label
sizeParams
=
XML
.
attr
"value"
(
show
node_size
)
sizeParams
=
XML
.
attr
"for"
"0"
<>
XML
.
attr
"value"
(
show
node_size
)
edges
::
(
Monad
m
)
=>
[
G
.
Edge
]
->
ConduitT
i
XML
.
Event
m
()
edges
ge
=
XML
.
tag
"edges"
mempty
(
yieldMany
ge
.|
awaitForever
edge'
)
...
...
This diff is collapsed.
Click to expand it.