Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
Knowledge Space WP Plugin
Commits
ec42c830
Commit
ec42c830
authored
3 years ago
by
Matthias Konitzny
Browse files
Options
Downloads
Patches
Plain Diff
Improved fullscreen handling
parent
4b1a16dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
display/graph.js
+12
-4
12 additions, 4 deletions
display/graph.js
display/helpers.js
+1
-1
1 addition, 1 deletion
display/helpers.js
with
13 additions
and
5 deletions
display/graph.js
+
12
−
4
View file @
ec42c830
...
@@ -62,7 +62,7 @@ export default class Graph {
...
@@ -62,7 +62,7 @@ export default class Graph {
//.nodeAutoColorBy("group")
//.nodeAutoColorBy("group")
//.nodeColor((node) => this.getNodeColor(node))
//.nodeColor((node) => this.getNodeColor(node))
//.linkWidth((link) => this.getLinkWidth(link))
//.linkWidth((link) => this.getLinkWidth(link))
.
onNodeClick
((
node
)
=>
this
.
onNodeClick
(
node
))
.
onNodeClick
((
node
)
=>
this
.
onNodeClick
(
node
))
.
onNodeHover
((
node
)
=>
{
.
onNodeHover
((
node
)
=>
{
this
.
onNodeHover
(
node
);
this
.
onNodeHover
(
node
);
this
.
updateHighlight
();
this
.
updateHighlight
();
...
@@ -70,7 +70,9 @@ export default class Graph {
...
@@ -70,7 +70,9 @@ export default class Graph {
.
onLinkHover
((
link
,
previousLink
)
=>
.
onLinkHover
((
link
,
previousLink
)
=>
this
.
onLinkHover
(
link
,
previousLink
)
this
.
onLinkHover
(
link
,
previousLink
)
)
)
.
onNodeDragEnd
((
node
,
translate
)
=>
this
.
onNodeDragEnd
(
node
,
translate
))
.
onNodeDragEnd
((
node
,
translate
)
=>
this
.
onNodeDragEnd
(
node
,
translate
)
)
//.linkColor((link) => this.getLinkColor(link))
//.linkColor((link) => this.getLinkColor(link))
.
linkPositionUpdate
((
line
,
{
start
,
end
})
=>
.
linkPositionUpdate
((
line
,
{
start
,
end
})
=>
this
.
updateLinkPosition
(
line
,
start
,
end
)
this
.
updateLinkPosition
(
line
,
start
,
end
)
...
@@ -211,7 +213,13 @@ export default class Graph {
...
@@ -211,7 +213,13 @@ export default class Graph {
onNodeDragEnd
(
node
,
translate
)
{
onNodeDragEnd
(
node
,
translate
)
{
// NodeDrag is handled like NodeClick if distance is very short
// NodeDrag is handled like NodeClick if distance is very short
if
(
Math
.
sqrt
(
Math
.
pow
(
translate
.
x
,
2
)
+
Math
.
pow
(
translate
.
y
,
2
)
+
Math
.
pow
(
translate
.
z
,
2
))
<
DRAG_THRESHOLD_3D
)
{
if
(
Math
.
sqrt
(
Math
.
pow
(
translate
.
x
,
2
)
+
Math
.
pow
(
translate
.
y
,
2
)
+
Math
.
pow
(
translate
.
z
,
2
)
)
<
DRAG_THRESHOLD_3D
)
{
this
.
onNodeClick
(
node
);
this
.
onNodeClick
(
node
);
}
}
}
}
...
@@ -363,7 +371,7 @@ export default class Graph {
...
@@ -363,7 +371,7 @@ export default class Graph {
}
}
resize
()
{
resize
()
{
if
(
screenfull
.
is
Enabled
)
{
if
(
screenfull
.
is
Fullscreen
)
{
this
.
graph
.
height
(
screen
.
height
);
this
.
graph
.
height
(
screen
.
height
);
this
.
graph
.
width
(
screen
.
width
);
this
.
graph
.
width
(
screen
.
width
);
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
display/helpers.js
+
1
−
1
View file @
ec42c830
...
@@ -5,7 +5,7 @@ export { getWidth, getHeight, getCanvasDivNode, createDiv, createHTMLElement };
...
@@ -5,7 +5,7 @@ export { getWidth, getHeight, getCanvasDivNode, createDiv, createHTMLElement };
* @returns {number}
* @returns {number}
*/
*/
function
getWidth
()
{
function
getWidth
()
{
return
document
.
getElementById
(
"
3d-graph
"
).
offse
tWidth
;
return
document
.
getElementById
(
"
3d-graph
"
).
clien
tWidth
;
}
}
/**
/**
...
...
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