Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meshviewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
infrastruktur
meshviewer
Commits
d6b84eba
Commit
d6b84eba
authored
Oct 29, 2017
by
Geno
Committed by
Xaver Maierhofer
Oct 29, 2017
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Filter links by node + perfomance using dict/map
parent
fb857717
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/filters/nodefilter.js
+2
-20
2 additions, 20 deletions
lib/filters/nodefilter.js
lib/infobox/node.js
+2
-2
2 additions, 2 deletions
lib/infobox/node.js
lib/main.js
+2
-11
2 additions, 11 deletions
lib/main.js
with
6 additions
and
33 deletions
lib/filters/nodefilter.js
+
2
−
20
View file @
d6b84eba
...
@@ -12,26 +12,8 @@ define(function () {
...
@@ -12,26 +12,8 @@ define(function () {
}
}
}
}
var
filteredIds
=
new
Set
();
n
.
links
=
data
.
links
.
filter
(
function
(
d
)
{
return
filter
(
d
.
source
)
&&
filter
(
d
.
target
);
n
.
graph
=
{};
n
.
graph
.
nodes
=
data
.
graph
.
nodes
.
filter
(
function
(
d
)
{
var
r
;
if
(
d
.
node
)
{
r
=
filter
(
d
.
node
);
}
else
{
r
=
filter
({});
}
if
(
r
)
{
filteredIds
.
add
(
d
.
id
);
}
return
r
;
});
n
.
graph
.
links
=
data
.
graph
.
links
.
filter
(
function
(
d
)
{
return
filteredIds
.
has
(
d
.
source
.
id
)
&&
filteredIds
.
has
(
d
.
target
.
id
);
});
});
return
n
;
return
n
;
...
...
This diff is collapsed.
Click to expand it.
lib/infobox/node.js
+
2
−
2
View file @
d6b84eba
...
@@ -229,9 +229,9 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper'],
...
@@ -229,9 +229,9 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper'],
}
}
function
renderNeighbourRow
(
n
)
{
function
renderNeighbourRow
(
n
)
{
var
icons
=
[]
;
var
icons
=
''
;
if
(
helper
.
hasLocation
(
n
.
node
))
{
if
(
helper
.
hasLocation
(
n
.
node
))
{
icons
.
push
(
V
.
h
(
'
span
'
,
{
props
:
{
className
:
'
ion-location
'
}
})
)
;
icons
=
V
.
h
(
'
span
'
,
{
props
:
{
className
:
'
ion-location
'
}
});
}
}
var
td1
=
V
.
h
(
'
td
'
,
icons
);
var
td1
=
V
.
h
(
'
td
'
,
icons
);
...
...
This diff is collapsed.
Click to expand it.
lib/main.js
+
2
−
11
View file @
d6b84eba
...
@@ -32,13 +32,8 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
...
@@ -32,13 +32,8 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
});
});
links
.
forEach
(
function
(
d
)
{
links
.
forEach
(
function
(
d
)
{
d
.
source
=
nodes
.
find
(
function
(
a
)
{
d
.
source
=
nodeDict
[
d
.
source
];
return
a
.
node_id
===
d
.
source
;
d
.
target
=
nodeDict
[
d
.
target
];
});
d
.
target
=
nodes
.
find
(
function
(
a
)
{
return
a
.
node_id
===
d
.
target
;
});
d
.
id
=
[
d
.
source
.
node_id
,
d
.
target
.
node_id
].
join
(
'
-
'
);
d
.
id
=
[
d
.
source
.
node_id
,
d
.
target
.
node_id
].
join
(
'
-
'
);
d
.
source
.
neighbours
.
push
({
node
:
d
.
target
,
link
:
d
});
d
.
source
.
neighbours
.
push
({
node
:
d
.
target
,
link
:
d
});
...
@@ -68,10 +63,6 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
...
@@ -68,10 +63,6 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'],
lost
:
lostnodes
lost
:
lostnodes
},
},
links
:
links
,
links
:
links
,
graph
:
{
links
:
[],
nodes
:
[]
},
nodeDict
:
nodeDict
nodeDict
:
nodeDict
};
};
}
}
...
...
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