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
a588af0d
Commit
a588af0d
authored
3 years ago
by
Katja
Browse files
Options
Downloads
Patches
Plain Diff
legend upper right
parent
991519ba
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/cn_26_11_1.js
+26
-13
26 additions, 13 deletions
Output/cn_26_11_1.js
Output/index.html
+49
-23
49 additions, 23 deletions
Output/index.html
with
75 additions
and
36 deletions
Output/cn_26_11_1.js
+
26
−
13
View file @
a588af0d
...
@@ -7,7 +7,10 @@ var zoom = d3.zoom().on("zoom", zoomHandler);
...
@@ -7,7 +7,10 @@ var zoom = d3.zoom().on("zoom", zoomHandler);
* creates svg object and associated attributes
* creates svg object and associated attributes
* applies the zoom behavior to svg
* applies the zoom behavior to svg
*/
*/
var
svg
=
d3
.
select
(
"
svg
"
)
var
svg2
=
d3
.
select
(
"
svg.legendsvg
"
)
var
svg
=
d3
.
select
(
"
svg.graph
"
)
.
call
(
zoom
),
.
call
(
zoom
),
width
=
svg
.
attr
(
"
width
"
),
width
=
svg
.
attr
(
"
width
"
),
height
=
svg
.
attr
(
"
height
"
);
height
=
svg
.
attr
(
"
height
"
);
...
@@ -23,6 +26,9 @@ color = d3.scaleOrdinal()
...
@@ -23,6 +26,9 @@ color = d3.scaleOrdinal()
yscale
=
d3
.
scaleOrdinal
()
yscale
=
d3
.
scaleOrdinal
()
.
domain
([
"
citing
"
,
"
input
"
,
"
cited
"
])
.
domain
([
"
citing
"
,
"
input
"
,
"
cited
"
])
.
range
([
0
,
200
,
400
]),
.
range
([
0
,
200
,
400
]),
linetype
=
d3
.
scaleOrdinal
()
.
domain
([
"
line
"
,
"
dotted
"
])
.
range
([(
"
8,0
"
),(
"
8,8
"
)]),
toRemove
;
toRemove
;
/**
/**
...
@@ -99,39 +105,45 @@ var rect2 = svg.append("rect")
...
@@ -99,39 +105,45 @@ var rect2 = svg.append("rect")
.
attr
(
"
width
"
,
210
)
.
attr
(
"
width
"
,
210
)
.
style
(
"
fill
"
,
'
white
'
);
.
style
(
"
fill
"
,
'
white
'
);
legendposition
=
[
70
,
110
,
150
]
legendposition
=
[
65
,
95
,
125
]
arrowlegendposition
=
[
0
,
25
]
arrowgroupnames
=
[
"
citation
"
,
"
self-citation
"
]
groupnames
=
[
"
citing
"
,
"
input
"
,
"
cited
"
]
groupnames
=
[
"
citing
"
,
"
input
"
,
"
cited
"
]
var
legend
=
svg
.
selectAll
(
"
.legend
"
)
var
legend
=
svg
2
.
selectAll
(
"
.legend
"
)
.
data
(
legendposition
)
.
data
(
legendposition
)
.
enter
()
.
enter
()
.
append
(
"
g
"
)
.
append
(
"
g
"
)
.
attr
(
"
class
"
,
"
legend
"
)
.
attr
(
"
class
"
,
"
legend
"
)
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
translate(0,
"
+
d
+
"
)
"
;
});
.
attr
(
"
transform
"
,
function
(
d
,
i
)
{
return
"
translate(0,
"
+
d
+
"
)
"
;
});
legend
.
append
(
"
text
"
)
legend
.
append
(
"
text
"
)
.
attr
(
"
x
"
,
10
0
)
.
attr
(
"
x
"
,
8
0
)
.
attr
(
"
y
"
,
0
)
.
attr
(
"
y
"
,
0
)
.
attr
(
"
dy
"
,
"
.35em
"
)
.
attr
(
"
dy
"
,
"
.35em
"
)
.
style
(
"
text-anchor
"
,
"
start
"
)
.
style
(
"
text-anchor
"
,
"
start
"
)
.
text
(
function
(
d
){
return
groupnames
[
legendposition
.
indexOf
(
d
)
]});
.
text
(
function
(
d
,
i
){
return
groupnames
[
i
]});
legend
.
append
(
"
circle
"
)
legend
.
append
(
"
circle
"
)
.
attr
(
"
r
"
,
r
)
.
attr
(
"
r
"
,
r
)
.
attr
(
"
cx
"
,
5
0
-
r
)
.
attr
(
"
cx
"
,
3
0
-
r
)
.
style
(
"
fill
"
,
color
);
.
style
(
"
fill
"
,
color
);
var
legendarrow
=
svg
.
append
(
"
g
"
)
var
legendarrow
=
svg2
.
selectAll
(
"
.legendarr
"
)
.
attr
(
"
class
"
,
"
legend
"
)
.
data
(
arrowlegendposition
)
.
attr
(
"
transform
"
,
"
translate(20,20)
"
);
.
enter
()
.
append
(
"
g
"
)
.
attr
(
"
class
"
,
"
legendarr
"
)
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
translate(0,
"
+
d
+
"
)
"
;
});
legendarrow
.
append
(
"
line
"
)
legendarrow
.
append
(
"
line
"
)
.
attr
(
"
x1
"
,
10
)
.
attr
(
"
x1
"
,
10
)
.
attr
(
"
x2
"
,
50
)
.
attr
(
"
x2
"
,
50
)
.
attr
(
"
y1
"
,
10
)
.
attr
(
"
y1
"
,
10
)
.
attr
(
"
y2
"
,
10
)
.
attr
(
"
y2
"
,
10
)
.
style
(
"
stroke-dasharray
"
,
"
8,8
"
)
.
style
(
"
stroke-dasharray
"
,
linetype
)
.
style
(
"
stroke
"
,
'
#999
'
)
.
style
(
"
stroke
"
,
'
#999
'
)
.
style
(
"
stroke-width
"
,
"
1px
"
)
.
style
(
"
stroke-width
"
,
"
1px
"
)
.
style
(
'
pointer-events
'
,
'
none
'
)
.
style
(
'
pointer-events
'
,
'
none
'
)
...
@@ -141,7 +153,7 @@ legendarrow.append("text")
...
@@ -141,7 +153,7 @@ legendarrow.append("text")
.
attr
(
"
y
"
,
10
)
.
attr
(
"
y
"
,
10
)
.
attr
(
"
dy
"
,
"
.35em
"
)
.
attr
(
"
dy
"
,
"
.35em
"
)
.
style
(
"
text-anchor
"
,
"
start
"
)
.
style
(
"
text-anchor
"
,
"
start
"
)
.
text
(
"
self-citation
"
);
.
text
(
function
(
d
,
i
){
return
arrowgroupnames
[
i
]}
);
/**
/**
...
@@ -299,7 +311,8 @@ function firstauthor(authors){
...
@@ -299,7 +311,8 @@ function firstauthor(authors){
function
textfunc
(
node
){
function
textfunc
(
node
){
document
.
getElementById
(
'
textbox
'
).
innerHTML
=
"
Title:
"
+
'
</br>
'
+
node
.
name
+
document
.
getElementById
(
'
textbox
'
).
innerHTML
=
"
Title:
"
+
'
</br>
'
+
node
.
name
+
'
</br>
'
+
'
</br>
'
+
"
Author:
"
+
'
</br>
'
+
node
.
author
+
'
</br>
'
+
'
</br>
'
+
"
Year:
"
+
'
</br>
'
'
</br>
'
+
'
</br>
'
+
"
Author:
"
+
'
</br>
'
+
node
.
author
+
'
</br>
'
+
'
</br>
'
+
"
Year:
"
+
'
</br>
'
+
node
.
year
+
'
</br>
'
+
'
</br>
'
+
"
doi:
"
+
'
</br>
'
+
node
.
doi
;
+
node
.
year
+
'
</br>
'
+
'
</br>
'
+
"
doi:
"
+
'
</br>
'
+
'
<a href="
'
+
node
.
doi
+
'
">
'
+
node
.
doi
+
'
</a>
'
+
'
</br>
'
+
'
</br>
'
+
"
Citations:
"
+
'
</br>
'
+
node
.
citations
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Output/index.html
+
49
−
23
View file @
a588af0d
...
@@ -4,35 +4,60 @@
...
@@ -4,35 +4,60 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
/*
div
.legendbox
{
width
:
270px
;
height
:
170px
;
padding
:
10px
;
/*border: 1px solid #999;*/
position
:
absolute
;
top
:
10px
;
left
:
968px
;
display
:
inline-block
;
margin
:
0
;
}
button
{
button
{
width: 150px;
width
:
100px
;
font-size: 15px;
height
:
20px
;
padding: 7px;
display
:
flex
;
border-radius: 3px;
justify-content
:
center
;
border: 3px solid #999;
position
:
absolute
;
left
:
430px
;
top
:
575px
;
}
button
.resetGraph
{
color
:
black
;
color
:
black
;
cursor: pointer;
}
position : absolute;
top: 500px;
right: 550px;
} */
button
.resetZoom
{
margin-left
:
110px
;
}
/* textbox */
button
.center
{
div
{
margin-left
:
220px
;
}
button
.save
{
margin-left
:
330px
;
}
div
.textbox
{
width
:
270px
;
width
:
270px
;
min-height
:
200px
;
min-height
:
200px
;
max-height
:
370px
;
max-height
:
370px
;
padding
:
10px
;
padding
:
10px
;
border
:
1px
solid
#999
;
border
:
1px
solid
#999
;
position
:
absolute
;
position
:
absolute
;
top
:
1
00px
;
top
:
2
00px
;
left
:
98
0
px
;
left
:
9
6
8px
;
display
:
inline-block
;
display
:
inline-block
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
margin
:
0
;
margin
:
0
;
}
}
/
textbox
*/
</style>
</style>
</head>
</head>
...
@@ -41,18 +66,19 @@
...
@@ -41,18 +66,19 @@
<p
id=
"id"
></p>
<!--for commenting with document.getElementById("id").innerHTML = "text"; -->
<p
id=
"id"
></p>
<!--for commenting with document.getElementById("id").innerHTML = "text"; -->
<!-- graph -->
<!-- graph -->
<svg
width=
"960"
height=
"5
0
0"
></svg>
<svg
class=
"graph"
width=
"960"
height=
"5
6
0"
></svg>
<div
class=
"legendbox"
>
<svg
class=
"legendsvg"
></svg>
</div>
<!-- textbox -->
<!-- textbox -->
<div
id =
"textbox"
style=
"border:1px solid"
>
Click node
</div>
<div
class=
"textbox"
id =
"textbox"
>
Click node
</div>
<!-- reset-buttons -->
<!-- reset-buttons -->
<button
onclick=
"javascript:location.reload();"
>
Reload
</button>
<!--
<button onclick="javascript:location.reload();">Reload</button>
-->
<button
onclick=
"resetGraph()"
>
Reset graph
</button>
<button
class=
"resetGraph"
onclick=
"resetGraph()"
>
Reset graph
</button>
<button
onclick=
"resetZoom()"
>
Reset zoom
</button>
<button
class=
"resetZoom"
onclick=
"resetZoom()"
>
Reset zoom
</button>
<button
onclick=
"center()"
>
Center
</button>
<button
class=
"center"
onclick=
"center()"
>
Center
</button>
<button
onclick=
"savesvg()"
>
Save
</button>
<button
class=
"save"
onclick=
"savesvg()"
>
Save
</button>
<!-- link D3 (version 5) -->
<!-- link D3 (version 5) -->
<script
src=
"https://d3js.org/d3.v5.min.js"
></script>
<script
src=
"https://d3js.org/d3.v5.min.js"
></script>
...
...
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