Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
a14d77e3
Commit
a14d77e3
authored
Jan 14, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diagnostics/d3: node sizes
parent
4af5d85f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
diagnostics/d3/chord.html
diagnostics/d3/chord.html
+30
-1
No files found.
diagnostics/d3/chord.html
View file @
a14d77e3
...
...
@@ -2,6 +2,10 @@
<meta
charset=
"utf-8"
>
<style>
body
{
font
:
11px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
}
.node
{
font
:
11px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
}
...
...
@@ -12,8 +16,27 @@
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>
<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>
var
hash
=
window
.
location
.
hash
.
substring
(
1
)
...
...
@@ -47,7 +70,7 @@ d3.json(hash, function(error, data) {
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
rotate(
"
+
(
d
.
x
-
90
+
rotate
)
+
"
)translate(
"
+
d
.
y
+
"
)
"
;
})
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
);
})
node
.
append
(
"
text
"
)
...
...
@@ -67,6 +90,9 @@ d3.json(hash, function(error, data) {
+
"
S
"
+
p
(
d
[
1
])[
0
]
+
"
,
"
+
p
(
d
[
1
])[
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")
// .data(graph.mids)
...
...
@@ -100,6 +126,7 @@ function parseGraph(graph2) {
data
.
y
=
innerRadius
data
.
x
=
((
360
/
graph2
.
nodes
.
length
)
*
i
)
data
.
conns
=
0
data
.
index
=
i
graph
.
nodes
.
push
(
data
)
graph
.
byName
[
data
.
name
]
=
data
})
...
...
@@ -122,6 +149,8 @@ function parseGraph(graph2) {
graph
.
paths
.
push
(
path
)
})
document
.
getElementById
(
"
node-count
"
).
innerText
=
graph
.
nodes
.
length
return
graph
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment