Platform
Resources
Pricing
Sign in
Get started
ODUCS Vis
Team for ODU Computer Science Data Vis and Info Vis classes
Workspace
Fork
Public
CS 725
By
Michele Weigle
Edited
Feb 10
Paused
Fork of
CS725-S23, D3 Vis Intro
•
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// write answer here
Insert cell
Insert cell
Insert cell
Insert cell
// write your answer here
Insert cell
Insert cell
Insert cell
Insert cell
bardata
=
[
{
xPos
:
10
,
yPos
:
50
,
width
:
30
,
height
:
50
,
color
:
'blue'
}
,
{
xPos
:
45
,
yPos
:
20
,
width
:
30
,
height
:
80
,
color
:
'red'
}
,
{
xPos
:
80
,
yPos
:
70
,
width
:
30
,
height
:
30
,
color
:
'yellow'
}
]
Insert cell
// write your answer here
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bars
=
[
{
name
:
'a'
,
value
:
5
,
color
:
'blue'
}
,
{
name
:
'b'
,
value
:
8
,
color
:
'red'
}
,
{
name
:
'c'
,
value
:
3
,
color
:
'yellow'
}
]
Insert cell
width
=
300
Insert cell
height
=
100
Insert cell
x
=
d3
.
scaleBand
(
)
.
domain
(
bars
.
map
(
d
=>
d
.
name
)
)
.
range
(
[
0
,
width
]
)
.
padding
(
0.2
)
Insert cell
y
=
d3
.
scaleLinear
(
)
.
domain
(
[
0
,
d3
.
max
(
bars
,
d
=>
d
.
value
)
]
)
.
range
(
[
0
,
height
]
)
Insert cell
Insert cell
{
const
svg
=
d3
.
create
(
'svg'
)
.
attr
(
"width"
,
width
)
.
attr
(
"height"
,
height
)
;
svg
.
selectAll
(
'rect'
)
.
data
(
bars
)
.
join
(
'rect'
)
.
attr
(
'fill'
,
d
=>
d
.
color
)
.
attr
(
'x'
,
d
=>
)
// EDIT THIS LINE
.
attr
(
'y'
,
d
=>
)
// EDIT THIS LINE
.
attr
(
'width'
,
)
// EDIT THIS LINE
.
attr
(
'height'
,
)
;
// EDIT THIS LINE
return
svg
.
node
(
)
;
}
Insert cell
Insert cell
Insert cell
Insert cell
d3
=
require
(
"d3@7"
)
Insert cell
import
{
solution
}
from
"@nyuvis/d3-introduction"
Insert cell
import
{
chart
as
scaleDiagram
}
from
"@uw-info474/animated-scale-diagram"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bardata
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bars
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
width
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
x
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
y
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML