Platform
Resources
Pricing
Sign in
Get started
Climate Lab
Visualizing a changing planet for The Washington Post
Workspace
Fork
Public
By
Harry Stevens
Edited
Oct 3, 2024
Fork of
Table of an Object
Importers
Insert cell
Insert cell
TableObject
(
myObject
,
{
width
:
400
}
)
Insert cell
myObject
=
(
{
name
:
"Harry"
,
age
:
100
,
location
:
[
86.925176
,
27.988109
]
,
}
)
Insert cell
// Careful about putting dates first,
// or all other values will be coerced to dates
TableObject
(
myOtherObject
,
{
width
:
400
}
)
Insert cell
myOtherObject
=
(
{
birthdate
:
new
Date
(
1921
,
11
,
18
)
,
name
:
"Harry"
,
age
:
100
,
location
:
[
86.925176
,
27.988109
]
,
}
)
Insert cell
// If the date comes later, all is well
TableObject
(
myFixedObject
,
{
width
:
400
}
)
Insert cell
myFixedObject
=
(
{
name
:
"Harry"
,
age
:
100
,
location
:
[
86.925176
,
27.988109
]
,
birthdate
:
new
Date
(
1921
,
11
,
18
)
}
)
Insert cell
TableObject
(
myFixedObject
,
{
width
:
400
,
keys
:
[
"name"
]
// specify your keys
}
)
Insert cell
function
TableObject
(
object
,
options
=
{
keys
:
null
}
)
{
const
keys
=
options
.
keys
||
Object
.
keys
(
object
)
;
return
Inputs
.
table
(
keys
.
map
(
key
=>
{
const
value
=
object
[
key
]
return
{
key
,
value
,
type
:
typeof
value
}
}
)
,
options
)
}
Insert cell
import
{
getCurrentPinnedName
}
from
'@bryangingechen/version-pinning-for-notebooks@469'
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myObject
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myOtherObject
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myFixedObject
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
TableObject
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