Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weighted mean aggregation to DataTable #1635

Merged
merged 5 commits into from Feb 28, 2024
Merged

Add weighted mean aggregation to DataTable #1635

merged 5 commits into from Feb 28, 2024

Conversation

hughess
Copy link
Member

@hughess hughess commented Feb 25, 2024

Description

Adds weightedMean as a total aggregation in DataTable/Column. Should be used with weightCol to specify the column to pull the weight values from for the calculation. If no weightCol supplied, a weight of 1 is used for all values, resulting in the same output as the mean aggregation.

datatable-totalrow-agg-functions

<DataTable data={countries} totalRow=true rows=5>
  <Column id=country/>
  <Column id=gdp_usd totalAgg=sum/>
  <Column id=gdp_growth totalAgg=weightedMean weightCol=gdp_usd fmt='pct2'/>
  <Column id=population totalAgg=mean fmt='#,##0"M"'/>
</DataTable>

Checklist

  • For UI or styling changes, I have added a screenshot or gif showing before & after
  • I have added a changeset
  • I have added to the docs where applicable

Copy link

changeset-bot bot commented Feb 25, 2024

🦋 Changeset detected

Latest commit: 008ce92

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@evidence-dev/core-components Patch
evidence-docs Patch
@evidence-dev/components Patch
@evidence-dev/evidence Patch
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2024 10:54pm

Copy link

netlify bot commented Feb 25, 2024

Deploy Preview for evidence-development-workspace ready!

Name Link
🔨 Latest commit 008ce92
🔍 Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/65dfb974b7d31200082b09ea
😎 Deploy Preview https://deploy-preview-1635--evidence-development-workspace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ItsMeBrianD
Copy link
Member

Not sure why all of the changesets are showing as deleted with this branch, this might need to have origin/next merged in

@archiewood
Copy link
Member

Can this be merged

@hughess
Copy link
Member Author

hughess commented Feb 28, 2024

Just attempting to get rid of the deleted changesets then will be good to go

@hughess
Copy link
Member Author

hughess commented Feb 28, 2024

@ItsMeBrianD i think this might be caused by main not being merged back into next?

@hughess
Copy link
Member Author

hughess commented Feb 28, 2024

I'm at a loss for how to remove the deleted changesets - I've merged with next and synced, but those changes don't seem to be taking effect

@archiewood archiewood changed the base branch from next to main February 28, 2024 22:32
@archiewood archiewood changed the base branch from main to next February 28, 2024 22:32
@archiewood
Copy link
Member

solved?

@hughess
Copy link
Member Author

hughess commented Feb 28, 2024

That did most of it! Now I’m just not sure why Cormick’s changes are showing up here - they were already merged to next

@archiewood archiewood added the to-review Evidence team to review label Feb 28, 2024
@hughess hughess changed the base branch from next to main February 28, 2024 22:48
@hughess hughess changed the base branch from main to next February 28, 2024 22:48
Bumps [@tidyjs/tidy](https://github.com/pbeshai/tidy) from 2.4.4 to 2.5.2.
- [Changelog](https://github.com/pbeshai/tidy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pbeshai/tidy/commits)

---
updated-dependencies:
- dependency-name: "@tidyjs/tidy"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@hughess hughess changed the base branch from next to main February 28, 2024 22:55
@hughess hughess changed the base branch from main to next February 28, 2024 22:55
@hughess hughess merged commit 4f926fb into next Feb 28, 2024
11 checks passed
@hughess hughess deleted the weighted-mean branch February 28, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-review Evidence team to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants