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
dd3dcedd
Commit
dd3dcedd
authored
Dec 20, 2012
by
Mike Bostock
Browse files
Remove brush-x-resizer example.
Replaced by <
http://bl.ocks.org/4349545
>.
parent
fc5df107
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/brush/brush-x-resizer.html
deleted
100644 → 0
View file @
fc5df107
<!DOCTYPE html>
<meta
charset=
"utf-8"
>
<title>
Brush
</title>
<script
src=
"../../d3.js"
></script>
<style>
svg
{
font
:
10px
sans-serif
;
}
circle
{
-webkit-transition
:
fill-opacity
250ms
linear
;
}
.selecting
circle
{
fill-opacity
:
.2
;
}
.selecting
circle
.selected
{
stroke
:
#f00
;
}
.resize
path
{
fill
:
#666
;
fill-opacity
:
.8
;
stroke
:
#000
;
stroke-width
:
1.5px
;
}
.axis
path
,
.axis
line
{
fill
:
none
;
stroke
:
#000
;
shape-rendering
:
crispEdges
;
}
.brush
.extent
{
fill-opacity
:
.125
;
shape-rendering
:
crispEdges
;
}
</style>
<body>
<script>
var
data
=
d3
.
range
(
800
).
map
(
Math
.
random
);
var
margin
=
{
top
:
4
,
right
:
50
,
bottom
:
20
,
left
:
50
},
width
=
960
-
margin
.
left
-
margin
.
right
,
height
=
120
-
margin
.
top
-
margin
.
bottom
;
var
x
=
d3
.
scale
.
linear
()
.
range
([
0
,
width
]);
var
y
=
d3
.
random
.
normal
(
height
/
2
,
height
/
8
);
var
brush
=
d3
.
svg
.
brush
().
x
(
x
)
.
on
(
"
brushstart
"
,
brushstart
)
.
on
(
"
brush
"
,
brushmove
)
.
on
(
"
brushend
"
,
brushend
);
var
svg
=
d3
.
select
(
"
body
"
).
append
(
"
svg
"
)
.
attr
(
"
width
"
,
width
+
margin
.
left
+
margin
.
right
)
.
attr
(
"
height
"
,
height
+
margin
.
top
+
margin
.
bottom
)
.
append
(
"
g
"
)
.
attr
(
"
transform
"
,
"
translate(
"
+
margin
.
left
+
"
,
"
+
margin
.
top
+
"
)
"
);
svg
.
append
(
"
g
"
)
.
attr
(
"
class
"
,
"
x axis
"
)
.
attr
(
"
transform
"
,
"
translate(0,
"
+
height
+
"
)
"
)
.
call
(
d3
.
svg
.
axis
().
scale
(
x
).
orient
(
"
bottom
"
));
var
circle
=
svg
.
append
(
"
g
"
).
selectAll
(
"
circle
"
)
.
data
(
data
)
.
enter
().
append
(
"
circle
"
)
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
translate(
"
+
x
(
d
)
+
"
,
"
+
y
()
+
"
)
"
;
})
.
attr
(
"
r
"
,
3.5
);
var
brushg
=
svg
.
append
(
"
g
"
)
.
attr
(
"
class
"
,
"
brush
"
)
.
call
(
brush
);
brushg
.
selectAll
(
"
.resize
"
).
append
(
"
path
"
)
.
attr
(
"
transform
"
,
"
translate(0,
"
+
height
/
2
+
"
)
"
)
.
attr
(
"
d
"
,
d3
.
svg
.
arc
()
.
outerRadius
(
height
/
2
)
.
startAngle
(
0
)
.
endAngle
(
function
(
d
,
i
)
{
return
i
?
-
Math
.
PI
:
Math
.
PI
;
}));
brushg
.
selectAll
(
"
rect
"
)
.
attr
(
"
height
"
,
height
);
function
brushstart
()
{
svg
.
classed
(
"
selecting
"
,
true
);
}
function
brushmove
()
{
var
s
=
brush
.
extent
();
circle
.
classed
(
"
selected
"
,
function
(
d
)
{
return
s
[
0
]
<=
d
&&
d
<=
s
[
1
];
});
}
function
brushend
()
{
svg
.
classed
(
"
selecting
"
,
!
d3
.
event
.
target
.
empty
());
}
</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