Skip to content
Snippets Groups Projects
Commit 6421c8f4 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

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
......@@ -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;
......@@ -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);
......
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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment