Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubo_final
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anastasiia Chirikova
kubo_final
Commits
a14d77e3
Commit
a14d77e3
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Downloads
Patches
Plain Diff
diagnostics/d3: node sizes
parent
4af5d85f
Branches
Branches containing commit
No related tags found
1 merge request
!1
New
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
diagnostics/d3/chord.html
+30
-1
30 additions, 1 deletion
diagnostics/d3/chord.html
with
30 additions
and
1 deletion
diagnostics/d3/chord.html
+
30
−
1
View file @
a14d77e3
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<style>
<style>
body
{
font
:
11px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
}
.node
{
.node
{
font
:
11px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font
:
11px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
}
}
...
@@ -12,8 +16,27 @@
...
@@ -12,8 +16,27 @@
fill
:
none
;
fill
:
none
;
}
}
#legend
{
position
:
fixed
;
top
:
10px
;
left
:
10px
;
font-size
:
14px
;
background
:
rgba
(
255
,
255
,
255
,
0.7
);
}
#legend
h1
{
font-weight
:
200
;
margin
:
0px
;
padding
:
0px
;
}
</style>
</style>
<body>
<body>
<div
id=
"legend"
>
<h1>
IPFS TestNet
</h1>
<a
href=
"http://ipfs.io"
>
ipfs.io
</a>
-
<span
id=
"node-count"
></span>
nodes
</div>
<script
src=
"http://d3js.org/d3.v3.min.js"
></script>
<script
src=
"http://d3js.org/d3.v3.min.js"
></script>
<script>
<script>
var
hash
=
window
.
location
.
hash
.
substring
(
1
)
var
hash
=
window
.
location
.
hash
.
substring
(
1
)
...
@@ -47,7 +70,7 @@ d3.json(hash, function(error, data) {
...
@@ -47,7 +70,7 @@ d3.json(hash, function(error, data) {
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
rotate(
"
+
(
d
.
x
-
90
+
rotate
)
+
"
)translate(
"
+
d
.
y
+
"
)
"
;
})
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
rotate(
"
+
(
d
.
x
-
90
+
rotate
)
+
"
)translate(
"
+
d
.
y
+
"
)
"
;
})
node
.
append
(
"
svg:circle
"
)
node
.
append
(
"
svg:circle
"
)
.
attr
(
"
r
"
,
function
(
d
)
{
return
6
;
})
.
attr
(
"
r
"
,
function
(
d
)
{
return
d
.
conns
+
3
;
})
.
style
(
"
fill
"
,
function
(
d
,
i
)
{
return
color
(
i
%
20
);
})
.
style
(
"
fill
"
,
function
(
d
,
i
)
{
return
color
(
i
%
20
);
})
node
.
append
(
"
text
"
)
node
.
append
(
"
text
"
)
...
@@ -67,6 +90,9 @@ d3.json(hash, function(error, data) {
...
@@ -67,6 +90,9 @@ d3.json(hash, function(error, data) {
+
"
S
"
+
p
(
d
[
1
])[
0
]
+
"
,
"
+
p
(
d
[
1
])[
1
]
+
"
S
"
+
p
(
d
[
1
])[
0
]
+
"
,
"
+
p
(
d
[
1
])[
1
]
+
"
"
+
p
(
d
[
2
])[
0
]
+
"
,
"
+
p
(
d
[
2
])[
1
];
+
"
"
+
p
(
d
[
2
])[
0
]
+
"
,
"
+
p
(
d
[
2
])[
1
];
})
})
.
style
(
"
stroke
"
,
function
(
d
)
{
return
color
(
d
[
0
].
index
%
20
);
})
.
style
(
"
stroke-opacity
"
,
function
(
d
)
{
return
0.3
;
})
// var mid = svg.selectAll(".node-mid")
// var mid = svg.selectAll(".node-mid")
// .data(graph.mids)
// .data(graph.mids)
...
@@ -100,6 +126,7 @@ function parseGraph(graph2) {
...
@@ -100,6 +126,7 @@ function parseGraph(graph2) {
data
.
y
=
innerRadius
data
.
y
=
innerRadius
data
.
x
=
((
360
/
graph2
.
nodes
.
length
)
*
i
)
data
.
x
=
((
360
/
graph2
.
nodes
.
length
)
*
i
)
data
.
conns
=
0
data
.
conns
=
0
data
.
index
=
i
graph
.
nodes
.
push
(
data
)
graph
.
nodes
.
push
(
data
)
graph
.
byName
[
data
.
name
]
=
data
graph
.
byName
[
data
.
name
]
=
data
})
})
...
@@ -122,6 +149,8 @@ function parseGraph(graph2) {
...
@@ -122,6 +149,8 @@ function parseGraph(graph2) {
graph
.
paths
.
push
(
path
)
graph
.
paths
.
push
(
path
)
})
})
document
.
getElementById
(
"
node-count
"
).
innerText
=
graph
.
nodes
.
length
return
graph
return
graph
}
}
...
...
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