Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MUR Drupal
d3-library
Commits
626dd3ad
Commit
626dd3ad
authored
Dec 20, 2012
by
Mike Bostock
Browse files
Remove partition-sunburst-zoom example.
Replaced by <
http://bl.ocks.org/4348373
>.
parent
3b641b63
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/partition/partition-sunburst-zoom.html
deleted
100644 → 0
View file @
3b641b63
<!DOCTYPE html>
<meta
charset=
"utf-8"
>
<title>
Partition - Sunburst
</title>
<style>
path
{
stroke
:
#fff
;
fill-rule
:
evenodd
;
}
</style>
<body>
<script
src=
"../../d3.js"
></script>
<script>
var
width
=
960
,
height
=
700
,
radius
=
Math
.
min
(
width
,
height
)
/
2
;
var
x
=
d3
.
scale
.
linear
()
.
range
([
0
,
2
*
Math
.
PI
]);
var
y
=
d3
.
scale
.
sqrt
()
.
range
([
0
,
radius
]);
var
color
=
d3
.
scale
.
category20c
();
var
svg
=
d3
.
select
(
"
body
"
).
append
(
"
svg
"
)
.
attr
(
"
width
"
,
width
)
.
attr
(
"
height
"
,
height
)
.
append
(
"
g
"
)
.
attr
(
"
transform
"
,
"
translate(
"
+
width
/
2
+
"
,
"
+
height
/
2
+
"
)
"
);
var
partition
=
d3
.
layout
.
partition
()
.
value
(
function
(
d
)
{
return
d
.
size
;
});
var
arc
=
d3
.
svg
.
arc
()
.
startAngle
(
function
(
d
)
{
return
Math
.
max
(
0
,
Math
.
min
(
2
*
Math
.
PI
,
x
(
d
.
x
)));
})
.
endAngle
(
function
(
d
)
{
return
Math
.
max
(
0
,
Math
.
min
(
2
*
Math
.
PI
,
x
(
d
.
x
+
d
.
dx
)));
})
.
innerRadius
(
function
(
d
)
{
return
Math
.
max
(
0
,
y
(
d
.
y
));
})
.
outerRadius
(
function
(
d
)
{
return
Math
.
max
(
0
,
y
(
d
.
y
+
d
.
dy
));
});
d3
.
json
(
"
../data/flare.json
"
,
function
(
error
,
json
)
{
var
path
=
svg
.
data
([
json
]).
selectAll
(
"
path
"
)
.
data
(
partition
.
nodes
)
.
enter
().
append
(
"
path
"
)
.
attr
(
"
d
"
,
arc
)
.
style
(
"
fill
"
,
function
(
d
)
{
return
color
((
d
.
children
?
d
:
d
.
parent
).
name
);
})
.
on
(
"
click
"
,
click
);
function
click
(
d
)
{
path
.
transition
()
.
duration
(
750
)
.
attrTween
(
"
d
"
,
arcTween
(
d
));
}
});
// Interpolate the scales!
function
arcTween
(
d
)
{
var
xd
=
d3
.
interpolate
(
x
.
domain
(),
[
d
.
x
,
d
.
x
+
d
.
dx
]),
yd
=
d3
.
interpolate
(
y
.
domain
(),
[
d
.
y
,
1
]),
yr
=
d3
.
interpolate
(
y
.
range
(),
[
d
.
y
?
20
:
0
,
radius
]);
return
function
(
d
,
i
)
{
return
i
?
function
(
t
)
{
return
arc
(
d
);
}
:
function
(
t
)
{
x
.
domain
(
xd
(
t
));
y
.
domain
(
yd
(
t
)).
range
(
yr
(
t
));
return
arc
(
d
);
};
};
}
</script>
Write
Preview
Supports
Markdown
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