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

Fixed fullscreen mode button.

Added dynamic content resizing.
parent 0b44275e
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ let firstTick = true;
const colorPallette = ['rgb(104, 169, 77)', 'rgb(102, 75, 154)', 'rgb(41, 171, 226)', 'rgb(224, 133, 35)',
'rgb(214, 207, 126)', 'rgb(239, 65, 35)', 'rgb(255, 255, 255)'];
const edgeColors = {};
var graph_element = document.getElementById('3d-graph');
loadGraph();
......@@ -29,7 +30,7 @@ async function loadGraph() {
.nodeThreeObject(drawNode)
.onEngineTick(loadComponents)
.width(getWidth())
.height(969);
.height(getHeight());
//Graph.renderer().sortObjects = true;
}
......@@ -43,14 +44,24 @@ function loadComponents() {
createInfoOverlay();
add_fullscreen_mode_button();
add_fullscreen_Listener();
window.onresize = resize_graph();
firstTick = false;
}
}
function resize_graph() {
Graph.width(getWidth());
Graph.height(getHeight());
}
function getWidth() {
return document.getElementById('3d-graph').offsetWidth;
}
function getHeight() {
return window.innerHeight - 200
}
function mapEdgeColors() {
const linkClasses = getLinkClasses()
for (let i = 0; i < linkClasses.length; i++) {
......@@ -203,10 +214,10 @@ function fullscreen_mode(){
function resize_canvas() {
if(document.fullscreenElement == getCanvasDivNode()) {
Graph.height(getCanvasDivNode().height);
Graph.width(getCanvasDivNode().width);
Graph.height(screen.height);
Graph.width(screen.width);
} else {
Graph.height(969);
Graph.height(window.innerHeight - 200);
Graph.width(getWidth());
}
}
......
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