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

Einrückung

parent f5d4fc5a
No related branches found
No related tags found
1 merge request!31Main
......@@ -155,7 +155,7 @@ function failure(graph) {
* checks at a fixed interval whether the contents of the JSON file have changed
and reloads the program if necessary
*/
var intervalId = window.setInterval(check_if_json_changed, 5000)
var intervalId = window.setInterval(check_if_json_changed, 1000)
function check_if_json_changed() {
d3.json("json_text.json").then(function(graph) {
newjson_string = JSON.stringify(graph)
......@@ -440,8 +440,7 @@ function zoom_to_graph() {
perc_y = height/(node_bounds.height+100);
zoom_perc = d3.min([perc_x, perc_y])
d3.select('svg')
.call(zoom.scaleBy, zoom_perc);
d3.select('svg').call(zoom.scaleBy, zoom_perc);
}
/**
......@@ -450,14 +449,12 @@ function zoom_to_graph() {
function reset_view() {
d3.select('svg')
.call(zoom.scaleTo, 1)
d3.select('svg')
.call(zoom.translateTo, 0.5 * width, 0.5 * height);
d3.select('svg')
.call(zoom.translateTo, 0.5 * width, 0.5 * height)
.call(zoom.scaleBy, zoom_perc);
}
/**
* save svg as png
* saves svg as png
*/
function save_svg() {
var svgString = get_svg_string(svg.node());
......@@ -469,7 +466,7 @@ function save_svg(){
};
/**
* generate svgString
* generates svgString
* @param {object} svgNode - node
*/
function get_svg_string(svgNode) {
......@@ -542,7 +539,7 @@ function get_svg_string(svgNode) {
}
/**
* convert svgString to image and export it
* converts svgString to image and export it
* @param {object} svgString - svgString
* @param {object} width - width of image
* @param {object} height - height of image
......
......@@ -171,7 +171,7 @@ function failure(graph) {
* checks at a fixed interval whether the contents of the JSON file have changed
and reloads the program if necessary
*/
var intervalId = window.setInterval(check_if_json_changed, 5000)
var intervalId = window.setInterval(check_if_json_changed, 1000)
function check_if_json_changed() {
d3.json("json_text.json").then(function(graph) {
newjson_string = JSON.stringify(graph)
......@@ -475,8 +475,7 @@ function zoom_to_graph() {
perc_y = height/(node_bounds.height+100);
zoom_perc = d3.min([perc_x, perc_y])
d3.select('svg')
.call(zoom.scaleBy, zoom_perc);
d3.select('svg').call(zoom.scaleBy, zoom_perc);
}
/**
......@@ -485,14 +484,12 @@ function zoom_to_graph() {
function reset_view() {
d3.select('svg')
.call(zoom.scaleTo, 1)
d3.select('svg')
.call(zoom.translateTo, 0.5 * width, 0.5 * height);
d3.select('svg')
.call(zoom.translateTo, 0.5 * width, 0.5 * height)
.call(zoom.scaleBy, zoom_perc);
}
/**
* save svg as png
* saves svg as png
*/
function save_svg() {
var svgString = get_svg_string(svg.node());
......@@ -504,7 +501,7 @@ function save_svg(){
};
/**
* generate svgString
* generates svgString
* @param {object} svgNode - node
*/
function get_svg_string(svgNode) {
......@@ -577,7 +574,7 @@ function get_svg_string(svgNode) {
}
/**
* convert svgString to image and export it
* converts svgString to image and export it
* @param {object} svgString - svgString
* @param {object} width - width of image
* @param {object} height - height of image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment