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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ockenden, Samuel
CiS Projekt
Commits
e872074e
Commit
e872074e
authored
3 years ago
by
Stahl, Merle
Browse files
Options
Downloads
Patches
Plain Diff
aufgeräumt
parent
059e8e0b
No related branches found
No related tags found
2 merge requests
!10
Output
,
!9
Main
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Output/graph/cn.js
+54
-58
54 additions, 58 deletions
Output/graph/cn.js
Output/graph/index.html
+3
-0
3 additions, 0 deletions
Output/graph/index.html
with
57 additions
and
58 deletions
Output/graph/cn.js
+
54
−
58
View file @
e872074e
...
...
@@ -10,21 +10,13 @@ var zoom = d3.zoom().on("zoom", handle_zoom);
var
svg
=
d3
.
select
(
"
svg.graph
"
)
.
call
(
zoom
),
width
=
svg
.
attr
(
"
width
"
),
height
=
svg
.
attr
(
"
height
"
);
var
text_info
=
''
;
var
text_abstract
=
''
;
var
perc
;
/**
* creates node object and radius
*/
var
node
,
r
=
10
,
height
=
svg
.
attr
(
"
height
"
),
perc
;
/**
* scale functions that return y coordinate/color of node depending on group
*/
color
=
d3
.
scaleOrdinal
()
var
color
=
d3
.
scaleOrdinal
()
.
domain
([
"
height
"
,
"
input
"
,
"
depth
"
])
.
range
([
'
#01d7c0
'
,
'
#8b90fe
'
,
'
#a15eb2
'
]),
y_scale
=
d3
.
scaleOrdinal
()
...
...
@@ -32,6 +24,12 @@ y_scale = d3.scaleOrdinal()
.
range
([
0
,
200
,
400
]),
to_remove
;
/**
* creates node object and default radius
*/
var
node
,
r
=
10
;
/**
* creates link object
*/
...
...
@@ -59,7 +57,9 @@ arrow_group_names = ["citation","self-citation"],
group_names
=
[
"
cited by
"
,
"
input
"
,
"
reference
"
],
line_type
=
d3
.
scaleOrdinal
()
.
domain
([
"
line
"
,
"
dotted
"
])
.
range
([(
"
8,0
"
),(
"
8,8
"
)]);
.
range
([(
"
8,0
"
),(
"
8,8
"
)]),
text_info
=
''
,
text_abstract
=
''
;
var
legend
=
svg_legend
.
selectAll
(
"
.legend
"
)
.
data
(
legend_position
)
...
...
@@ -214,7 +214,7 @@ function update_nodes(nodes) {
* @param {string} target - target node
*/
function
update_marker
(
color
,
target
)
{
var
radius
=
1.5
*
r
+
target
.
citations
*
0.05
var
radius
=
1.5
*
r
+
target
.
citations
*
0.05
;
svg
.
append
(
'
defs
'
).
append
(
'
marker
'
)
.
attr
(
'
id
'
,
color
.
replace
(
"
#
"
,
""
)
+
radius
)
.
attr
(
'
viewBox
'
,
'
-0 -5 10 10
'
)
...
...
@@ -304,8 +304,9 @@ function is_link_for_node(node, link){
function
textbox_content
(
node
)
{
text_info
=
"
Title:
"
+
'
</br>
'
+
node
.
name
+
'
</br>
'
+
'
</br>
'
+
"
Author:
"
+
'
</br>
'
+
node
.
author
+
'
</br>
'
+
'
</br>
'
+
"
Date:
"
+
'
</br>
'
+
node
.
year
+
'
</br>
'
+
'
</br>
'
+
"
Journal:
"
+
'
</br>
'
+
node
.
journal
+
'
</br>
'
+
'
</br>
'
+
"
doi:
"
+
'
</br>
'
+
'
<a href="
'
+
node
.
doi
+
'
">
'
+
node
.
doi
+
'
</a>
'
+
'
</br>
'
+
'
</br>
'
+
"
Citations:
"
+
'
</br>
'
+
node
.
citations
;
+
node
.
year
+
'
</br>
'
+
'
</br>
'
+
"
Journal:
"
+
'
</br>
'
+
node
.
journal
+
'
</br>
'
+
'
</br>
'
+
"
doi:
"
+
'
</br>
'
+
'
<a href="
'
+
node
.
doi
+
'
">
'
+
node
.
doi
+
'
</a>
'
+
'
</br>
'
+
'
</br>
'
+
"
Citations:
"
+
'
</br>
'
+
node
.
citations
;
text_abstract
=
node
.
abstract
;
document
.
getElementById
(
'
textbox
'
).
innerHTML
=
text_info
;
}
...
...
@@ -399,7 +400,6 @@ function handle_zoom() {
d3
.
select
(
'
g
'
).
attr
(
"
transform
"
,
d3
.
event
.
transform
);
}
/**
* transforms svg so that the zoom is adapted to the size of the graph
*/
...
...
@@ -415,7 +415,6 @@ function zoom_to() {
.
call
(
zoom
.
scaleBy
,
perc
);
}
/**
* transforms svg so that the zoom and drag is reset
*/
...
...
@@ -426,7 +425,6 @@ function reset_view() {
.
call
(
zoom
.
translateTo
,
0.5
*
width
,
0.5
*
height
);
d3
.
select
(
'
svg
'
)
.
call
(
zoom
.
scaleBy
,
perc
);
}
/**
...
...
@@ -441,7 +439,6 @@ function save_svg(){
}
};
/**
* generate svgString
* @param {object} svgNode - node
...
...
@@ -546,7 +543,6 @@ function svg_string_to_image( svgString, width, height, format, callback ) {
if
(
callback
)
callback
(
blob
,
filesize
);
});
};
image
.
src
=
imgsrc
;
...
...
This diff is collapsed.
Click to expand it.
Output/graph/index.html
+
3
−
0
View file @
e872074e
...
...
@@ -2,6 +2,7 @@
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<!-- style specifications for button and div elements -->
<style
type=
"text/css"
>
button
{
...
...
@@ -95,9 +96,11 @@
<!-- D3 (version 5) -->
<script
src=
"https://d3js.org/d3.v5.min.js"
></script>
<!-- scripts to save svg element as png -->
<script
src=
"https://cdn.rawgit.com/eligrey/canvas-toBlob.js/f1a01896135ab378aa5c0118eadd81da55e698d8/canvas-toBlob.js"
></script>
<script
src=
"https://cdn.rawgit.com/eligrey/FileSaver.js/e9d941381475b5df8b7d7691013401e171014e89/FileSaver.min.js"
></script>
<!-- javascript for force-directed graph -->
<script
type=
"text/javascript"
id=
"cn"
src=
"cn.js"
></script>
</body>
...
...
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