Platform
Resources
Pricing
Sign in
Get started
Declan Naughton
👨💻 Modelling consultant 🧮 numbers 📊 actuarial 📈 viz, interactivity, transparency
Workspace
Fork
Public
playing with uwdata gemini ▶️
By
Declan Naughton
Edited
Jul 4, 2024
Fork of
Hello, Gemini!
•
1 fork
1
Insert cell
Insert cell
viewof
playButton
=
Inputs
.
button
(
"Play"
)
Insert cell
viewof
chart
=
vegaEmbed
(
startSpec
,
{
renderer
:
"svg"
}
)
Insert cell
{
if
(
playButton
)
animation
.
play
(
".chart-wrapper"
)
;
}
Insert cell
animation
=
gemini
.
animate
(
startSpec
,
endSpec
,
gemSpec
)
Insert cell
gemSpec
=
(
{
timeline
:
{
sync
:
[
{
component
:
{
axis
:
"x"
}
,
timing
:
{
duration
:
1000
}
}
,
{
component
:
{
mark
:
"marks"
}
,
timing
:
{
duration
:
1000
}
}
]
}
}
)
Insert cell
startSpec
=
gemini
.
vl2vg4gemini
(
{
data
:
{
values
:
[
{
"Hungry"
:
50
,
"Name"
:
"Gemini"
}
,
{
"Hungry"
:
100
,
"Name"
:
"Cordelia"
}
]
}
,
mark
:
"bar"
,
encoding
:
{
x
:
{
field
:
"Hungry"
,
type
:
"quantitative"
}
,
y
:
{
field
:
"Name"
,
type
:
"nominal"
}
}
}
)
Insert cell
endSpec
=
gemini
.
vl2vg4gemini
(
{
data
:
{
values
:
[
{
"Hungry"
:
100
,
"Name"
:
"Gemini"
}
,
{
"Hungry"
:
80
,
"Name"
:
"Cordelia"
}
]
}
,
mark
:
"bar"
,
encoding
:
{
x
:
{
field
:
"Hungry"
,
type
:
"quantitative"
}
,
y
:
{
field
:
"Name"
,
type
:
"nominal"
}
}
}
)
Insert cell
Insert cell
d3
=
require
(
'd3@5.14.2'
)
Insert cell
gemini
=
require
(
"https://cdn.jsdelivr.net/gh/declann/gemini@1c2e679/gemini.web.js"
)
// pinned
Insert cell
vegaEmbed
=
require
(
"https://cdn.jsdelivr.net/gh/declann/vega-embed-vl4@main/build/vega-embed.js"
)
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
playButton
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
animation
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
gemSpec
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
startSpec
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
endSpec
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
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
gemini
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vegaEmbed
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML