Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
ma-impl
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eccochu
ma-impl
Commits
4aed5fea
Commit
4aed5fea
authored
Feb 18, 2016
by
Eike Cochu
Browse files
Options
Downloads
Patches
Plain Diff
fixed network controller
parent
4ad4298d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
vipra-ui/app/html/network.html
+1
-1
1 addition, 1 deletion
vipra-ui/app/html/network.html
vipra-ui/app/js/controllers.js
+12
-13
12 additions, 13 deletions
vipra-ui/app/js/controllers.js
with
13 additions
and
14 deletions
vipra-ui/app/html/network.html
+
1
−
1
View file @
4aed5fea
<div
ui-view
ng-cloak
>
<div
ng-cloak
>
<div
class=
"fullsize navpadding"
>
<div
class=
"graph-legend overlay"
>
<label
style=
"color:{{colors.articles}}"
>
...
...
This diff is collapsed.
Click to expand it.
vipra-ui/app/js/controllers.js
+
12
−
13
View file @
4aed5fea
...
...
@@ -72,7 +72,6 @@
var
id
=
0
,
ids
=
{},
container
=
$
(
"
#visgraph
"
)[
0
],
edges
=
{};
$scope
.
colors
=
{
...
...
@@ -130,6 +129,7 @@
ids
[
data
.
id
]
=
id
;
// create graph
var
container
=
document
.
getElementById
(
"
visgraph
"
);
$scope
.
graph
=
new
vis
.
Network
(
container
,
$scope
.
data
,
$scope
.
options
);
$scope
.
graph
.
on
(
'
selectNode
'
,
$scope
.
select
);
$scope
.
graph
.
on
(
'
doubleClick
'
,
$scope
.
open
);
...
...
@@ -184,13 +184,12 @@
};
// construct new nodes
var
constructor
=
function
(
result
,
node
,
key
,
nodeFunction
)
{
if
(
result
.
data
&&
(
!
key
||
result
.
data
[
key
]))
{
var
data
=
key
?
result
.
data
[
key
]
:
result
.
data
,
newNodes
=
[],
var
constructor
=
function
(
result
,
node
,
nodeFunction
)
{
if
(
result
)
{
var
newNodes
=
[],
newEdges
=
[];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
current
=
data
[
i
];
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
var
current
=
result
[
i
];
if
(
ids
.
hasOwnProperty
(
current
.
id
))
{
if
(
edgeExists
(
ids
[
current
.
id
],
node
.
id
))
continue
;
...
...
@@ -220,23 +219,23 @@
// node is article, load article to get topics
ArticleFactory
.
get
({
id
:
node
.
dbid
},
function
(
data
)
{
for
(
var
i
=
0
;
i
<
data
.
topics
.
length
;
i
++
)
data
.
topics
[
i
]
=
res
.
data
.
topics
[
i
].
topic
;
constructor
(
data
,
node
,
'
topics
'
,
topicNode
);
data
.
topics
[
i
]
=
data
.
topics
[
i
].
topic
;
constructor
(
data
.
topics
,
node
,
topicNode
);
});
}
else
if
(
node
.
type
===
'
topic
'
)
{
// node is topic, load topic to get words and articles
if
(
$scope
.
shown
.
words
)
TopicFactory
.
get
({
id
:
node
.
dbid
},
function
(
data
)
{
constructor
(
data
,
node
,
'
words
'
,
wordNode
);
constructor
(
data
.
words
,
node
,
wordNode
);
});
if
(
$scope
.
shown
.
articles
)
TopicFactory
.
articles
({
id
:
node
.
dbid
},
function
(
data
)
{
constructor
(
data
,
node
,
null
,
articleNode
);
constructor
(
data
,
node
,
articleNode
);
});
}
else
if
(
node
.
type
===
'
word
'
&&
$scope
.
shown
.
topics
)
{
// node is word, load word to get topics
WordFactory
.
get
({
id
:
node
.
dbid
},
function
(
data
)
{
constructor
(
data
,
node
,
'
topics
'
,
topicNode
);
WordFactory
.
topics
({
id
:
node
.
dbid
},
function
(
data
)
{
constructor
(
data
,
node
,
topicNode
);
});
}
$scope
.
nodes
.
update
(
node
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment