Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
explorviz-frontend-extension-discovery
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExplorViz
explorviz-github-archive
explorviz-frontend-extension-discovery
Commits
5783c67e
Verified
Commit
5783c67e
authored
7 years ago
by
Alexander-Krause
Browse files
Options
Downloads
Patches
Plain Diff
draw agents and their processes with edges
parent
381ef5a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addon/components/node-overview.js
+40
-16
40 additions, 16 deletions
addon/components/node-overview.js
with
40 additions
and
16 deletions
addon/components/node-overview.js
+
40
−
16
View file @
5783c67e
...
...
@@ -10,6 +10,7 @@ export default Component.extend({
agentRepo
:
service
(
"
repos/agent-repository
"
),
cytoscapeGraph
:
null
,
cytoscapeLayout
:
null
,
// @Override
...
...
@@ -23,6 +24,7 @@ export default Component.extend({
this
.
_super
(...
arguments
);
this
.
setupListener
();
this
.
initCytoscape
();
this
.
updateCytoscapeGraph
(
this
.
get
(
'
agentRepo.agentList
'
));
},
...
...
@@ -100,17 +102,19 @@ export default Component.extend({
{
data
:
{
id
:
'
explorVizBackend
'
}
}
],
edges
:
[]
},
}
});
layout
:
{
name
:
'
breadthfirst
'
,
directed
:
true
,
roots
:
'
#explorVizBackend
'
,
padding
:
10
}
const
layout
=
cy
.
layout
({
name
:
'
breadthfirst
'
,
directed
:
true
,
padding
:
10
});
this
.
set
(
'
cytoscapeGraph
'
,
cy
);
this
.
set
(
'
cytoscapeLayout
'
,
layout
);
layout
.
run
();
/*var bfs = cy.elements().bfs('#a', function(){}, true);
...
...
@@ -131,40 +135,60 @@ export default Component.extend({
updateCytoscapeGraph
(
newAgentList
)
{
this
.
debug
(
'
updating cytoscapeGraph
'
);
const
cy
=
this
.
get
(
'
cytoscapeGraph
'
);
const
layout
=
this
.
get
(
'
cytoscapeLayout
'
);
if
(
!
cy
)
{
if
(
!
(
cy
&&
layout
)
||
!
newAgentList
)
{
return
;
}
this
.
debug
(
'
updating cytoscapeGraph
'
);
//cy.startBatch();
newAgentList
.
forEach
((
agentRecord
)
=>
{
const
ip
=
agentRecord
.
get
(
'
ip
'
);
const
edgeIDAgent
=
ip
+
"
ToexplorVizBackend
"
;
cy
.
add
([
{
group
:
"
nodes
"
,
data
:
{
id
:
ip
}
},
{
group
:
"
edges
"
,
data
:
{
id
:
edgeIDAgent
,
source
:
ip
,
target
:
'
explorVizBackend
'
}
}
]);
const
processes
=
agentRecord
.
get
(
'
processes
'
);
cy
.
startBatch
();
processes
.
forEach
((
process
)
=>
{
const
pid
=
process
.
get
(
'
pid
'
);
console
.
log
(
pid
);
cy
.
add
(
const
edgeID
=
pid
+
"
To
"
+
ip
;
cy
.
add
([
{
group
:
"
nodes
"
,
data
:
{
id
:
pid
}
},
{
group
:
"
edges
"
,
data
:
{
id
:
pid
,
source
:
pid
,
target
:
'
explorVizBackend
'
}
data
:
{
id
:
edgeID
,
source
:
pid
,
target
:
ip
}
}
);
]
);
});
});
// END agentList loop
cy
.
endBatch
();
//cy.
layout();
//
cy.endBatch();
layout
.
run
();
cy
.
fit
();
}
...
...
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