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
a1a69c0b
Commit
a1a69c0b
authored
3 years ago
by
Stahl, Merle
Browse files
Options
Downloads
Patches
Plain Diff
Größe der Knoten abhängig von citations
parent
0d335f2d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!10
Output
,
!9
Main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Output/ToDo.txt
+1
-0
1 addition, 0 deletions
Output/ToDo.txt
Output/cn.js
+32
-29
32 additions, 29 deletions
Output/cn.js
with
33 additions
and
29 deletions
Output/ToDo.txt
+
1
−
0
View file @
a1a69c0b
...
...
@@ -22,3 +22,4 @@ Noch offen:
- Informationen zu Funktionen anzeigen (?)
- Speicherfunktion (?)
- Suchfunktion
- X-Achse mit Jahreszahlen
This diff is collapsed.
Click to expand it.
Output/cn.js
+
32
−
29
View file @
a1a69c0b
...
...
@@ -16,7 +16,7 @@ height = svg.attr("height");
* creates node object and associated attributes
*/
var
node
,
r
=
1
2
,
r
=
1
0
,
color
=
d3
.
scaleOrdinal
()
.
domain
([
"
citing
"
,
"
input
"
,
"
cited
"
])
.
range
([
'
#01d7c0
'
,
'
#8b90fe
'
,
'
#a15eb2
'
]),
...
...
@@ -52,8 +52,7 @@ var simulation = d3.forceSimulation()
.
force
(
"
collide
"
,
d3
.
forceCollide
(
50
))
.
force
(
"
charge
"
,
d3
.
forceManyBody
().
strength
(
-
30
))
.
force
(
"
center
"
,
d3
.
forceCenter
(
width
/
2
,
height
/
2
))
.
force
(
"
yscale
"
,
d3
.
forceY
().
strength
(
1
).
y
(
function
(
d
)
{
return
yscale
(
d
.
group
)}))
.
on
(
"
tick
"
,
tickHandler
);
.
force
(
"
yscale
"
,
d3
.
forceY
().
strength
(
1
).
y
(
function
(
d
)
{
return
yscale
(
d
.
group
)}));
/**
* creates group element
...
...
@@ -79,9 +78,12 @@ function update(links, nodes) {
updateNodes
(
nodes
);
simulation
.
nodes
(
nodes
);
.
nodes
(
nodes
)
.
on
(
"
tick
"
,
tickHandler
);
simulation
.
force
(
"
link
"
)
.
links
(
links
);
d3
.
selectAll
(
"
.link
"
).
attr
(
'
marker-end
'
,
function
(
d
)
{
return
updateMarker
(
"
#999
"
,
d
.
target
);});
}
/**
...
...
@@ -96,7 +98,6 @@ function updateLinks(links) {
.
append
(
"
line
"
)
.
style
(
"
stroke-width
"
,
"
1px
"
)
.
style
(
"
stroke
"
,
"
#999
"
)
.
attr
(
'
marker-end
'
,
marker
(
"
#999
"
))
.
attr
(
"
class
"
,
"
link
"
);
}
...
...
@@ -121,7 +122,7 @@ function updateNodes(nodes) {
node
.
append
(
"
circle
"
)
.
attr
(
"
class
"
,
"
circle
"
)
.
attr
(
"
r
"
,
r
)
.
attr
(
"
r
"
,
function
(
d
)
{
return
r
+
d
.
citations
*
0.1
}
)
.
style
(
"
fill
"
,
function
(
d
){
return
color
(
d
.
group
)})
.
on
(
'
click
'
,
clickNode
);
...
...
@@ -133,6 +134,29 @@ function updateNodes(nodes) {
.
on
(
'
click
'
,
clickNode
);
}
/**
* creates arrowhead and returns its url
* @param {string} color - color of arrowhead
* @param {string} target - target-node
*/
function
updateMarker
(
color
,
target
)
{
var
radius
=
r
+
target
.
citations
*
0.1
;
svg
.
append
(
'
defs
'
).
append
(
'
marker
'
)
//arrowhead
.
attr
(
'
id
'
,
color
.
replace
(
"
#
"
,
""
)
+
radius
)
.
attr
(
'
viewBox
'
,
'
-0 -5 10 10
'
)
.
attr
(
'
refX
'
,
radius
+
10
)
.
attr
(
'
refY
'
,
0
)
.
attr
(
'
orient
'
,
'
auto
'
)
.
attr
(
'
markerWidth
'
,
10
)
.
attr
(
'
markerHeight
'
,
15
)
.
attr
(
'
xoverflow
'
,
'
visible
'
)
.
append
(
'
svg:path
'
)
.
attr
(
'
d
'
,
'
M 0,-5 L 10 ,0 L 0,5
'
)
.
attr
(
'
fill
'
,
color
)
//arrowhead color
.
style
(
'
stroke
'
,
'
none
'
);
return
"
url(
"
+
color
+
radius
+
"
)
"
;
};
/**
* colors the circle and its links black and removes the previous markings
* @param {object} node - node
...
...
@@ -154,7 +178,7 @@ function clickRect() {
d3
.
selectAll
(
"
.circle
"
).
style
(
"
stroke
"
,
"
none
"
)
d3
.
selectAll
(
"
.link
"
)
.
style
(
"
stroke
"
,
"
#999
"
)
.
attr
(
'
marker-end
'
,
marker
(
'
#999
'
)
)
.
attr
(
'
marker-end
'
,
function
(
d
)
{
return
updateMarker
(
'
#999
'
,
d
.
target
);}
)
document
.
getElementById
(
'
textbox
'
).
innerHTML
=
"
Click node
"
;
}
...
...
@@ -168,7 +192,7 @@ function marklink(node){
.
style
(
"
stroke
"
,
function
(
o
)
{
return
isLinkForNode
(
node
,
o
)
?
"
black
"
:
"
#999
"
;})
.
attr
(
'
marker-end
'
,
function
(
o
)
{
return
isLinkForNode
(
node
,
o
)
?
m
arker
(
'
#000000
'
)
:
m
arker
(
'
#999
'
);})
return
isLinkForNode
(
node
,
o
)
?
updateM
arker
(
'
#000000
'
,
o
.
target
)
:
updateM
arker
(
'
#999
'
,
o
.
target
);})
}
/**
...
...
@@ -180,27 +204,6 @@ function isLinkForNode(node, link){
return
link
.
source
.
index
==
node
.
index
||
link
.
target
.
index
==
node
.
index
;
}
/**
* creates arrowhead and returns its url
* @param {string} color - color of arrowhead
*/
function
marker
(
color
)
{
svg
.
append
(
'
defs
'
).
append
(
'
marker
'
)
//arrowhead
.
attr
(
'
id
'
,
color
.
replace
(
"
#
"
,
""
))
.
attr
(
'
viewBox
'
,
'
-0 -5 10 10
'
)
.
attr
(
'
refX
'
,
r
+
10
)
.
attr
(
'
refY
'
,
0
)
.
attr
(
'
orient
'
,
'
auto
'
)
.
attr
(
'
markerWidth
'
,
10
)
.
attr
(
'
markerHeight
'
,
15
)
.
attr
(
'
xoverflow
'
,
'
visible
'
)
.
append
(
'
svg:path
'
)
.
attr
(
'
d
'
,
'
M 0,-5 L 10 ,0 L 0,5
'
)
.
attr
(
'
fill
'
,
color
)
//arrowhead color
.
style
(
'
stroke
'
,
'
none
'
);
return
"
url(
"
+
color
+
"
)
"
;
};
/**
* returns last name of first author
* @param {string} authors - the comma-separated string of authors
...
...
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