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
36876f17
Commit
36876f17
authored
Dec 20, 2012
by
Mike Bostock
Browse files
Remove brush-ordinal example.
Replaced by <
http://bl.ocks.org/4349509
>.
parent
dd3dcedd
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/brush/brush-ordinal.html
deleted
100644 → 0
View file @
dd3dcedd
<!DOCTYPE html>
<meta
charset=
"utf-8"
>
<title>
Brush
</title>
<script
src=
"../../d3.js"
></script>
<style>
svg
{
font
:
10px
sans-serif
;
}
path
{
-webkit-transition
:
fill-opacity
250ms
linear
;
}
.selecting
path
{
fill-opacity
:
.2
;
}
.selecting
path
.selected
{
stroke
:
#f00
;
stroke-width
:
2px
;
}
.axis
path
,
.axis
line
{
fill
:
none
;
stroke
:
#000
;
shape-rendering
:
crispEdges
;
}
.brush
.extent
{
stroke
:
#fff
;
fill-opacity
:
.125
;
shape-rendering
:
crispEdges
;
}
</style>
<body>
<script>
var
data
=
d3
.
svg
.
symbolTypes
;
var
margin
=
{
top
:
10
,
right
:
10
,
bottom
:
20
,
left
:
10
},
width
=
960
-
margin
.
right
-
margin
.
left
,
height
=
100
-
margin
.
top
-
margin
.
bottom
;
var
x
=
d3
.
scale
.
ordinal
()
.
domain
(
data
)
.
rangePoints
([
0
,
width
],
1
);
var
svg
=
d3
.
select
(
"
body
"
).
append
(
"
svg
"
)
.
attr
(
"
width
"
,
width
+
margin
.
right
+
margin
.
left
)
.
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
symbol
=
svg
.
append
(
"
g
"
).
selectAll
(
"
path
"
)
.
data
(
data
)
.
enter
().
append
(
"
path
"
)
.
attr
(
"
transform
"
,
function
(
d
)
{
return
"
translate(
"
+
x
(
d
)
+
"
,
"
+
(
height
/
2
)
+
"
)
"
;
})
.
attr
(
"
d
"
,
d3
.
svg
.
symbol
().
type
(
String
).
size
(
200
));
svg
.
append
(
"
g
"
)
.
attr
(
"
class
"
,
"
brush
"
)
.
call
(
d3
.
svg
.
brush
().
x
(
x
)
.
on
(
"
brushstart
"
,
brushstart
)
.
on
(
"
brush
"
,
brushmove
)
.
on
(
"
brushend
"
,
brushend
))
.
selectAll
(
"
rect
"
)
.
attr
(
"
height
"
,
height
);
function
brushstart
()
{
svg
.
classed
(
"
selecting
"
,
true
);
}
function
brushmove
()
{
var
s
=
d3
.
event
.
target
.
extent
();
symbol
.
classed
(
"
selected
"
,
function
(
d
)
{
return
s
[
0
]
<=
(
d
=
x
(
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