Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CiS Projekt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ockenden, Samuel
CiS Projekt
Commits
eeed399b
Commit
eeed399b
authored
3 years ago
by
Stahl, Merle
Browse files
Options
Downloads
Patches
Plain Diff
Einrückung
parent
f5d4fc5a
No related branches found
No related tags found
1 merge request
!31
Main
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/cn_default.js
+103
-106
103 additions, 106 deletions
assets/cn_default.js
assets/cn_timeline.js
+103
-106
103 additions, 106 deletions
assets/cn_timeline.js
with
206 additions
and
212 deletions
assets/cn_default.js
+
103
−
106
View file @
eeed399b
...
...
@@ -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
,
5
000
)
var
intervalId
=
window
.
setInterval
(
check_if_json_changed
,
1
000
)
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
* save
s
svg as png
*/
function
save_svg
()
{
var
svgString
=
get_svg_string
(
svg
.
node
());
...
...
@@ -469,7 +466,7 @@ function save_svg(){
};
/**
* generate svgString
* generate
s
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
* convert
s
svgString to image and export it
* @param {object} svgString - svgString
* @param {object} width - width of image
* @param {object} height - height of image
...
...
This diff is collapsed.
Click to expand it.
assets/cn_timeline.js
+
103
−
106
View file @
eeed399b
...
...
@@ -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
,
5
000
)
var
intervalId
=
window
.
setInterval
(
check_if_json_changed
,
1
000
)
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
* save
s
svg as png
*/
function
save_svg
()
{
var
svgString
=
get_svg_string
(
svg
.
node
());
...
...
@@ -504,7 +501,7 @@ function save_svg(){
};
/**
* generate svgString
* generate
s
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
* convert
s
svgString to image and export it
* @param {object} svgString - svgString
* @param {object} width - width of image
* @param {object} height - height of image
...
...
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