Platform
Resources
Pricing
Sign in
Contact us
Observable
The end-to-end solution for building and hosting better data apps, dashboards, and reports.
Workspace
Fork
Published
Video series: Learning Observable
By
Anjana Vakil
Edited
Sep 19, 2022
Fork of
User Input & Interactivity
•
2 forks
8 stars
Video series: Learning Observable
Notebooks & Cells
Reactive Markdown & HTML
Reactive Dataflow
User Input & Interactivity
JavaScript and Observable
Imports & Remixing Cells
Getting Data into a Notebook
Sharing, Publishing & Embedding
Insert cell
Insert cell
html
`<h2 style='color:${
yourColor
}'>Hello, ${
yourName
}!</h2>`
Insert cell
viewof
yourName
=
html
`<input type=text value=${
myName
}>`
Insert cell
myName
=
"Anjana"
Insert cell
viewof
yourColor
=
color
(
{
value
:
"#21abc0"
,
title
:
"Your favorite color"
}
)
Insert cell
import
{
color
}
from
"@jashkenas/inputs"
Insert cell
letterFrequencyChart
=
vl
.
markBar
(
)
// Make a bar chart
.
data
(
yourLetters
)
// Using letter frequency data
.
encode
(
vl
.
x
(
)
.
fieldO
(
"letter"
)
,
// Show letters in sequential order on the x-axis
vl
.
y
(
)
.
fieldQ
(
"frequency"
)
.
axis
(
{
format
:
"%"
}
)
,
// Show frequency on the y-axis, formatted as percent
vl
.
color
(
)
.
value
(
yourColor
)
// Set the bar color
)
.
render
(
)
// Source: https://observablehq.com/@observablehq/vega-lite-chart-types#simpleBar
Insert cell
yourLetters
=
letterFrequencies
.
filter
(
row
=>
yourName
.
toUpperCase
(
)
.
includes
(
row
.
letter
)
)
Insert cell
import
{
vl
,
alphabet
as
letterFrequencies
}
from
'@observablehq/vega-lite-chart-types'
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
Show 2 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
yourName
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myName
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
yourColor
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
letterFrequencyChart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
yourLetters
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