Platform
Solutions
Resources
Pricing
Sign in
Sign up
Peter Beshai
Workspace
Fork
Published
tidy.js
By
Peter Beshai
Edited
May 7, 2021
7 stars
Insert cell
Insert cell
data
=
[
{
group
:
'a'
,
name
:
'n0'
,
value
:
5
}
,
{
group
:
'a'
,
name
:
'n1'
,
value
:
10
}
,
{
group
:
'b'
,
name
:
'n2'
,
value
:
12
}
,
{
group
:
'c'
,
name
:
'n3'
,
value
:
35
}
,
{
group
:
'c'
,
name
:
'n4'
,
value
:
55
}
]
Insert cell
results
=
tidy
(
data
,
groupBy
(
'group'
,
summarize
(
{
total
:
sum
(
'value'
)
,
items
:
items
=>
items
}
)
)
)
Insert cell
Table
(
results
)
Insert cell
JSON
.
stringify
(
results
)
Insert cell
Insert cell
import
{
tidy
,
groupBy
,
summarize
,
sum
}
from
'@pbeshai/tidyjs'
Insert cell
import
{
Table
}
from
"@observablehq/inputs"
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
results
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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