Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
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
david Chavalarias
clinicaltrials
Commits
0c79ed7e
Commit
0c79ed7e
authored
Jun 01, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix edge ids in graph saving
but we should rather use the sigma.exporters.gexf.js
parent
f6cec553
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
methods.js
tinawebJS/methods.js
+5
-3
No files found.
tinawebJS/methods.js
View file @
0c79ed7e
...
...
@@ -930,16 +930,18 @@ function saveGraph() {
let
atts
=
{
"size"
:
size
,
"color"
:
color
}
if
(
getByID
(
"fullgraph"
).
checked
)
{
saveGEXF
(
getnodes
()
,
getedges
()
,
atts
);
saveGEXF
(
TW
.
Nodes
,
TW
.
Edges
,
atts
);
}
if
(
getByID
(
"visgraph"
).
checked
)
{
saveGEXF
(
getVisibleNodes
()
,
getVisibleE
dges
(),
atts
)
saveGEXF
(
TW
.
partialGraph
.
graph
.
nodes
()
,
TW
.
partialGraph
.
graph
.
e
dges
(),
atts
)
}
$
(
"#closesavemodal"
).
click
();
}
// £TODO: we should use https://github.com/Linkurious/linkurious.js/tree/develop/plugins/sigma.exporters.gexf
function
saveGEXF
(
nodes
,
edges
,
atts
){
let
gexf
=
'<?xml version="1.0" encoding="UTF-8"?>
\
n'
;
gexf
+=
'<gexf xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gephi.org/gexf/viz" version="1.1">
\
n'
;
...
...
@@ -977,7 +979,7 @@ function saveGEXF(nodes,edges,atts){
gexf
+=
"<edges>
\n
"
;
let
cont
=
1
;
for
(
var
e
in
edges
){
gexf
+=
'<edge id="'
+
cont
+
'" source="'
+
edges
[
e
].
source
.
id
+
'" target="'
+
edges
[
e
].
target
.
id
+
'" weight="'
+
edges
[
e
].
weight
+
'">
\
n'
;
gexf
+=
'<edge id="'
+
cont
+
'" source="'
+
edges
[
e
].
source
+
'" target="'
+
edges
[
e
].
target
+
'" weight="'
+
edges
[
e
].
weight
+
'">
\
n'
;
gexf
+=
'<attvalues> <attvalue for="6" value="'
+
edges
[
e
].
label
+
'"/></attvalues>'
;
gexf
+=
'</edge>
\
n'
;
cont
++
;
...
...
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