Skip to content
Snippets Groups Projects
Commit c4d88bcb authored by Stahl, Merle's avatar Stahl, Merle
Browse files

Größe angepasst

parent 725f8ad5
No related branches found
No related tags found
1 merge request!20Main
...@@ -144,7 +144,6 @@ function success(graph){ ...@@ -144,7 +144,6 @@ function success(graph){
} }
function failure(graph){ function failure(graph){
localStorage.setItem("oldjson","irgendwaswasimmergespeichertwirdwennkeinejsondaist") localStorage.setItem("oldjson","irgendwaswasimmergespeichertwirdwennkeinejsondaist")
} }
var intervalId=window.setInterval(function(){ var intervalId=window.setInterval(function(){
......
...@@ -49,7 +49,6 @@ var rect = svg.append("rect") ...@@ -49,7 +49,6 @@ var rect = svg.append("rect")
/** /**
* creates svg object (legend) and associated attributes * creates svg object (legend) and associated attributes
* transform * transform
* mehr kommentare
*/ */
var svg_legend = d3.select("svg.legendsvg"), var svg_legend = d3.select("svg.legendsvg"),
legend_position = [65,95,125], legend_position = [65,95,125],
...@@ -159,11 +158,9 @@ var gX = svg.append("g") ...@@ -159,11 +158,9 @@ var gX = svg.append("g")
d3.json("json_text.json").then(success,failure) d3.json("json_text.json").then(success,failure)
function success(graph){ function success(graph){
update(graph.links, graph.nodes); update(graph.links, graph.nodes);
} }
function failure(graph){ function failure(graph){
localStorage.setItem("oldjson","irgendwaswasimmergespeichertwirdwennkeinejsondaist") localStorage.setItem("oldjson","irgendwaswasimmergespeichertwirdwennkeinejsondaist")
} }
var intervalId=window.setInterval(function(){ var intervalId=window.setInterval(function(){
...@@ -211,7 +208,7 @@ function updateXAxis(nodes) { ...@@ -211,7 +208,7 @@ function updateXAxis(nodes) {
xscale = d3.scaleLinear() xscale = d3.scaleLinear()
.domain([d3.min(years)-1, d3.max(years)+1]) .domain([d3.min(years)-1, d3.max(years)+1])
.range([50, width-50]) .range([1, width-1])
xAxis.scale(xscale); xAxis.scale(xscale);
gX.call(xAxis); gX.call(xAxis);
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
position: absolute; position: absolute;
left: 455px; left: 75px;
top: 575px; top: 580px;
transition-duration: 0.4s; transition-duration: 0.4s;
border-radius: 3px; border-radius: 3px;
border: 1px solid #909090; border: 1px solid #909090;
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
width: 146px; width: 146px;
position: absolute; position: absolute;
top: 181px; top: 181px;
left: 1114px; left: 624px;
border-radius: 0; border-radius: 0;
border: 1px solid #909090; border: 1px solid #909090;
} }
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
position: absolute; position: absolute;
display: inline-block; display: inline-block;
top: 181px; top: 181px;
left: 968px; left: 478px;
border-radius: 0; border-radius: 0;
border: 1px solid #909090; border: 1px solid #909090;
} }
...@@ -59,10 +59,9 @@ ...@@ -59,10 +59,9 @@
width: 270px; width: 270px;
height: 170px; height: 170px;
padding: 10px; padding: 10px;
/*border: 1px solid #999;*/
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 968px; left: 478px;
display: inline-block; display: inline-block;
margin: 0; margin: 0;
} }
...@@ -70,16 +69,21 @@ ...@@ -70,16 +69,21 @@
div.textbox { div.textbox {
width: 270px; width: 270px;
min-height: 200px; min-height: 200px;
max-height:370px; max-height: 375px;
padding: 10px; padding: 10px;
border: 1px solid #999; border: 1px solid #999;
position: absolute; position: absolute;
top: 200px; top: 200px;
left: 968px; left: 478px;
display: inline-block; display: inline-block;
overflow-y: scroll; overflow-y: scroll;
margin: 0; margin: 0;
} }
svg.graph {
position: absolute;
top: 20px
}
</style> </style>
</head> </head>
...@@ -87,7 +91,7 @@ ...@@ -87,7 +91,7 @@
<button id="change_graph" class="display" onclick="display()">Display Timeline</button> <button id="change_graph" class="display" onclick="display()">Display Timeline</button>
<!-- graph 576--> <!-- graph 576-->
<svg class="graph" width="960" height="560"></svg> <svg class="graph" width="470" height="560"></svg>
<p id="oldjson"></p> <p id="oldjson"></p>
<!-- legend --> <!-- legend -->
...@@ -117,18 +121,17 @@ ...@@ -117,18 +121,17 @@
if (window.location.hash=='#default') { if (window.location.hash=='#default') {
document.getElementById("change_graph").innerHTML = 'Display Timeline'; document.getElementById("change_graph").innerHTML = 'Display Timeline';
load_default(); load_default();
} }
else if (window.location.hash=='#time') { else if (window.location.hash=='#time') {
document.getElementById("change_graph").innerHTML = 'Display Default'; document.getElementById("change_graph").innerHTML = 'Display Default';
load_time(); load_time();
} }
else if (window.location.hash=='') { else if (window.location.hash=='') {
window.location.hash = 'default'; window.location.hash = 'default';
document.getElementById("change_graph").innerHTML = 'Display Timeline'; document.getElementById("change_graph").innerHTML = 'Display Timeline';
load_default(); load_default();
} }
function display(){ function display(){
if (window.location.hash=='#time') { if (window.location.hash=='#time') {
display_default(); display_default();
...@@ -137,15 +140,17 @@ ...@@ -137,15 +140,17 @@
display_time(); display_time();
} }
} }
function display_default() { function display_default() {
window.location.hash = 'default'; window.location.hash = 'default';
window.location.reload(); window.location.reload();
} }
function display_time() { function display_time() {
window.location.hash = 'time'; window.location.hash = 'time';
window.location.reload(); window.location.reload();
} }
function load_default() { function load_default() {
var htmlHeader = document.getElementsByTagName("head")[0]; var htmlHeader = document.getElementsByTagName("head")[0];
var myScript = document.createElement('script'); var myScript = document.createElement('script');
...@@ -154,6 +159,7 @@ ...@@ -154,6 +159,7 @@
myScript.id='abc'; myScript.id='abc';
htmlHeader.appendChild(myScript); htmlHeader.appendChild(myScript);
} }
function load_time() { function load_time() {
var htmlHeader = document.getElementsByTagName("head")[0]; var htmlHeader = document.getElementsByTagName("head")[0];
var myScript = document.createElement('script'); var myScript = document.createElement('script');
...@@ -161,12 +167,7 @@ ...@@ -161,12 +167,7 @@
myScript.src = 'cn2.js'; myScript.src = 'cn2.js';
myScript.id='abc'; myScript.id='abc';
htmlHeader.appendChild(myScript); htmlHeader.appendChild(myScript);
} }
</script> </script>
<!-- javascript for force-directed graph
<script type="text/javascript" id="cn" src="cn.js"></script> -->
</body> </body>
</html> </html>
\ No newline at end of file
<<<<<<< HEAD
{ {
"nodes": [ "nodes": [
{ {
...@@ -113,6 +112,3 @@ ...@@ -113,6 +112,3 @@
} }
] ]
} }
=======
{"nodes": [], "links": []}
>>>>>>> upstream/main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment