Platform
Solutions
Resources
Pricing
Sign in
Sign up
Eric Field
Building and Using Tools to See. UVA Architecture + Data Science. IT Director. Instructor.
Workspace
Fork
Public
2 collections
By
Eric Field
Edited
Apr 25, 2023
2 forks
Insert cell
Insert cell
<
svg
width
=
"600"
height
=
"300"
>
<
g
id
=
"layer1"
>
</
g
>
<
text
id
=
"mytext"
x
=
"100"
y
=
"250"
>
</
text
>
<
style
>
#
mytext
{
font-family
:
Arial
,
Helvetica
,
sans-serif
;
font-size
:
30
px
;
fill
:
red
;
}
</
style
>
</
svg
>
Insert cell
Insert cell
data
=
[
{
name
:
"one"
,
value
:
1
}
,
{
name
:
"two"
,
value
:
2
}
,
{
name
:
"three"
,
value
:
3
}
,
{
name
:
"four"
,
value
:
4
}
,
{
name
:
"five"
,
value
:
5
}
]
Insert cell
viz
.
select
(
"#layer1"
)
.
selectAll
(
".mycircle"
)
.
data
(
data
)
.
join
(
"circle"
)
.
classed
(
"mycircle"
,
true
)
.
attr
(
"cx"
,
d
=>
d
.
value
*
100
)
.
attr
(
"cy"
,
150
)
.
attr
(
"r"
,
d
=>
d
.
value
*
10
)
.
style
(
"fill"
,
"steelblue"
)
.
on
(
"mouseover"
,
putText
)
// this is the critical part, calling the putText function below
Insert cell
putText
=
(
evt
,
d
)
=>
{
viz
.
select
(
"#mytext"
)
.
text
(
"this item is: "
+
d
.
name
)
;
}
Insert cell
Insert cell
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Listed in...
Interface and dynamics
Eric Field
misc
Eric Field
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
svgContainer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
viz
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
putText
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML