Platform
Resources
Pricing
Sign in
Get started
Vizabi
Workspace
Fork
Public
By
Angie Hjort
Edited
Jan 29
1 fork
1
Insert cell
Insert cell
// on a regular web page you would instead install a dependency from npm
// npm i @vizabi/reader-ddfcsv
// and use a ES6 import like so:
// import "@vizabi/reader-ddfcsv/dist/reader-ddfcsv.js";
DDFCsvReader
=
require
(
'https://unpkg.com/@vizabi/reader-ddfcsv@4.5.2'
)
Insert cell
DDFCsvReader
.
versionInfo
Insert cell
DDFCsvReader
.
version
Insert cell
readerInstance
=
{
const
reader
=
new
DDFCsvReader
.
getDDFCsvReaderObject
(
)
;
reader
.
init
(
{
path
:
"https://github.com/open-numbers/ddf--gapminder--fasttrack.git"
}
)
return
reader
;
}
Insert cell
data
=
readerInstance
.
read
(
{
from
:
"datapoints"
,
language
:
"en"
,
select
:
{
key
:
[
"country"
,
"time"
]
,
value
:
[
"gdp_pcap"
,
"lex"
,
"pop"
]
}
,
where
:
{
}
}
)
Insert cell
Insert cell
chart
=
Plot
.
plot
(
{
width
,
y
:
{
type
:
"linear"
,
grid
:
true
}
,
x
:
{
type
:
"log"
,
grid
:
true
}
,
marks
:
[
Plot
.
dot
(
data
,
{
filter
:
(
f
)
=>
f
.
time
-
d3
.
utcParse
(
"%Y"
)
(
""
+
time
)
==
0
,
x
:
"gdp_pcap"
,
y
:
"lex"
,
r
:
"pop"
,
title
:
"country"
,
tip
:
true
}
)
]
}
)
Insert cell
{
//hover effect
d3
.
select
(
chart
)
.
append
(
"svg:style"
)
.
text
(
`
circle {pointer-events: visible;}
circle:hover {fill:pink;}
`
)
}
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
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
DDFCsvReader
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
readerInstance
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
time
Edit
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