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
150
Issues
150
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
d7948acb
Commit
d7948acb
authored
Jan 15, 2025
by
Fabien Maniere
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export to GEXF: adding the weight attribute to all nodes
parent
d937e72e
Pipeline
#7224
passed with stages
in 75 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
GEXF.hs
src/Gargantext/Core/Viz/Graph/GEXF.hs
+14
-4
No files found.
src/Gargantext/Core/Viz/Graph/GEXF.hs
View file @
d7948acb
...
...
@@ -51,20 +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
<>
XML
.
attr
"weight"
(
show
node_size
)
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'
)
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
6b1167bb
·
Jan 27, 2025
mentioned in commit
6b1167bb
mentioned in commit 6b1167bb67ab70d58649b95ce871d3e1e00ba1fb
Toggle commit list
Przemyslaw Kaminski
@cgenie
mentioned in merge request
!385 (merged)
·
Jan 27, 2025
mentioned in merge request
!385 (merged)
mentioned in merge request !385
Toggle commit list
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