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
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
Julien Moutinho
haskell-gargantext
Commits
a3b5c3c5
Commit
a3b5c3c5
authored
Jan 09, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gexf] fixes to the GEXF file format
parent
4f317061
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
GEXF.hs
src/Gargantext/Core/Viz/Graph/GEXF.hs
+14
-7
No files found.
src/Gargantext/Core/Viz/Graph/GEXF.hs
View file @
a3b5c3c5
...
...
@@ -36,8 +36,11 @@ instance Xmlbf.ToXml Graph where
root
gn
ge
=
Xmlbf
.
element
"gexf"
params
$
meta
<>
(
graph
gn
ge
)
where
params
=
HashMap
.
fromList
[
(
"xmlns"
,
"http://www.gexf.net/1.2draft"
)
,
(
"version"
,
"1.2"
)
]
params
=
HashMap
.
fromList
[
(
"xmlns"
,
"http://www.gexf.net/1.3"
)
,
(
"xmlns:viz"
,
"http://gexf.net/1.3/viz"
)
,
(
"xmlns:xsi"
,
"http://www.w3.org/2001/XMLSchema-instance"
)
,
(
"xsi:schemaLocation"
,
"http://gexf.net/1.3 http://gexf.net/1.3/gexf.xsd"
)
,
(
"version"
,
"1.3"
)
]
meta
=
Xmlbf
.
element
"meta"
params
$
creator
<>
desc
where
params
=
HashMap
.
fromList
[
(
"lastmodifieddate"
,
"2020-03-13"
)
]
...
...
@@ -53,20 +56,24 @@ instance Xmlbf.ToXml Graph where
node'
::
G
.
Node
->
[
Xmlbf
.
Node
]
node'
(
G
.
Node
{
node_id
=
nId
,
node_label
=
l
,
node_size
=
w
})
=
Xmlbf
.
element
"node"
params
[]
Xmlbf
.
element
"node"
params
(
Xmlbf
.
element
"viz:size"
sizeParams
[]
)
where
params
=
HashMap
.
fromList
[
(
"id"
,
nId
)
,
(
"label"
,
l
)
,
(
"size"
,
(
cs
.
show
)
w
)
]
,
(
"label"
,
l
)
]
sizeParams
=
HashMap
.
fromList
[
(
"value"
,
(
cs
.
show
)
w
)
]
edges
::
[
G
.
Edge
]
->
[
Xmlbf
.
Node
]
edges
gn
=
Xmlbf
.
element
"edges"
HashMap
.
empty
$
P
.
concatMap
edge
gn
edge
::
G
.
Edge
->
[
Xmlbf
.
Node
]
edge
(
G
.
Edge
{
edge_id
=
eId
,
edge_source
=
es
,
edge_target
=
et
})
=
edge
(
G
.
Edge
{
edge_id
=
eId
,
edge_source
=
es
,
edge_target
=
et
,
edge_weight
=
ew
})
=
Xmlbf
.
element
"edge"
params
[]
where
params
=
HashMap
.
fromList
[
(
"id"
,
eId
)
,
(
"source"
,
es
)
,
(
"target"
,
et
)
]
,
(
"target"
,
et
)
,
(
"weight"
,
(
cs
.
show
)
ew
)]
-- just to be able to derive a client for the entire gargantext API,
-- we however want to avoid sollicitating this instance
...
...
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