Skip to content

Feature/datatables view enhance#2

Open
wardi wants to merge 9 commits intoJVickery-TBS:feature/datatables-view-enhancefrom
wardi:feature/datatables-view-enhance
Open

Feature/datatables view enhance#2
wardi wants to merge 9 commits intoJVickery-TBS:feature/datatables-view-enhancefrom
wardi:feature/datatables-view-enhance

Conversation

@wardi
Copy link

@wardi wardi commented Jan 24, 2026

Here's my version of the histogram API. I'm returning the buckets and edges in the "fields" value instead of as a separate dict.

I haven't updated the frond-end to match, but you can see the expected values in the tests provided.

We'll need a helper function to turn edges and bucket array values into histogram bar heights and widths. With discrete values like ints or dates some bars will be different widths, and the heights need to be scaled by the relative widths for accuracy. done

Other future work:

  • buckets should be calculated based on the filters of only the other columns so that users can adjust the histogram brush controls outside their current values
  • redis cache for bucket calculations(use Faster datastore_search row counts (cache version) ckan/ckan#9260 instead), only cache when no filters applied, delete individual cache values on any change to the datastore table

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@wardi
Copy link
Author

wardi commented Jan 25, 2026

I'm on the fence about including the results from datastore_bucket_histogram directly from the action instead of requiring the use of the helper. It would be more convenient for some users that way.

Maybe I'll add an include_histogram parameter defaulting to True to return the computed width, height, low and high values that make up the histograms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants