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
6421c8f4
Commit
6421c8f4
authored
3 years ago
by
Matthias Konitzny
Browse files
Options
Downloads
Patches
Plain Diff
Workaround to reduce errors from the plugin_path external variable.
parent
b92c14a1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.js
+3
-0
3 additions, 0 deletions
config.js
display/graph.js
+7
-5
7 additions, 5 deletions
display/graph.js
display/infooverlay.js
+6
-4
6 additions, 4 deletions
display/infooverlay.js
with
16 additions
and
9 deletions
config.js
+
3
−
0
View file @
6421c8f4
...
...
@@ -7,3 +7,6 @@ export const COLOR_PALETTE = [
"
rgb(239, 65, 35)
"
,
"
rgb(255, 255, 255)
"
,
];
// Just renaming a variable which is given by the PHP script. This avoids errors in all other files.
export
const
PLUGIN_PATH
=
plugin_path
;
This diff is collapsed.
Click to expand it.
display/graph.js
+
7
−
5
View file @
6421c8f4
...
...
@@ -257,7 +257,9 @@ class Graph {
const
loader
=
new
THREE
.
TextureLoader
();
//const planeMaterial = new THREE.MeshLambertMaterial({color: 0xFF0000, side: THREE.DoubleSide}); //THREE.BackSide
const
planeMaterial
=
new
THREE
.
MeshBasicMaterial
({
map
:
loader
.
load
(
plugin_path
+
"
backgrounds/background_4.jpg
"
),
map
:
loader
.
load
(
Config
.
PLUGIN_PATH
+
"
backgrounds/background_4.jpg
"
),
side
:
THREE
.
DoubleSide
,
});
//THREE.BackSide
const
mesh
=
new
THREE
.
Mesh
(
sphereGeometry
,
planeMaterial
);
...
...
@@ -294,17 +296,17 @@ class Graph {
// Draw node circle image
const
textureLoader
=
new
THREE
.
TextureLoader
();
const
imageAlpha
=
textureLoader
.
load
(
plugin_path
+
"
datasets/images/alpha.png
"
Config
.
PLUGIN_PATH
+
"
datasets/images/alpha.png
"
);
let
imageTexture
=
null
;
if
(
"
image
"
in
node
)
{
imageTexture
=
textureLoader
.
load
(
plugin_path
+
"
datasets/images/
"
+
node
.
image
Config
.
PLUGIN_PATH
+
"
datasets/images/
"
+
node
.
image
);
}
else
{
imageTexture
=
textureLoader
.
load
(
plugin_path
+
"
datasets/images/default.jpg
"
Config
.
PLUGIN_PATH
+
"
datasets/images/default.jpg
"
);
}
...
...
@@ -353,7 +355,7 @@ function createFullScreenButton() {
sceneNode
.
appendChild
(
overlayNode
);
}
const
dataUrl
=
plugin_path
+
"
datasets/aud1.json
"
;
const
dataUrl
=
Config
.
PLUGIN_PATH
+
"
datasets/aud1.json
"
;
const
G
=
new
Graph
(
dataUrl
);
const
linkoverlay
=
new
LinkOverlay
(
G
);
const
infooverlay
=
new
InfoOverlay
(
G
);
...
...
This diff is collapsed.
Click to expand it.
display/infooverlay.js
+
6
−
4
View file @
6421c8f4
import
*
as
Helpers
from
"
./helpers
"
;
import
jQuery
from
"
jquery
"
;
import
*
as
Config
from
"
../config
"
;
export
{
InfoOverlay
};
...
...
@@ -104,7 +105,7 @@ class InfoOverlay {
const
nodeImage
=
document
.
createElement
(
"
img
"
);
nodeImage
.
id
=
"
infoOverlayImage
"
;
nodeImage
.
src
=
plugin_path
+
"
datasets/images/default.jpg
"
;
nodeImage
.
src
=
Config
.
PLUGIN_PATH
+
"
datasets/images/default.jpg
"
;
nodeImage
.
className
=
"
detail-view-image
"
;
topArea
.
appendChild
(
nodeImage
);
...
...
@@ -130,12 +131,12 @@ class InfoOverlay {
if
(
"
image
"
in
node
)
{
jQuery
(
"
#infoOverlayImage
"
).
attr
(
"
src
"
,
plugin_path
+
"
datasets/images/
"
+
node
.
image
Config
.
PLUGIN_PATH
+
"
datasets/images/
"
+
node
.
image
);
}
else
{
jQuery
(
"
#infoOverlayImage
"
).
attr
(
"
src
"
,
plugin_path
+
"
datasets/images/default.jpg
"
Config
.
PLUGIN_PATH
+
"
datasets/images/default.jpg
"
);
}
...
...
@@ -162,7 +163,8 @@ class InfoOverlay {
if
(
"
image
"
in
target
)
{
const
linkImage
=
document
.
createElement
(
"
img
"
);
linkImage
.
src
=
plugin_path
+
"
datasets/images/
"
+
target
.
image
;
linkImage
.
src
=
Config
.
PLUGIN_PATH
+
"
datasets/images/
"
+
target
.
image
;
linkDiv
.
appendChild
(
linkImage
);
}
...
...
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