cmudig / falcon-vis

Cross-filter millions (or even billions) of data entries with no interaction delay
https://dig.cmu.edu/falcon-vis/
BSD 3-Clause "New" or "Revised" License
95 stars 2 forks source link

how to get the sum of variables within a category instead of the count of rows? #220

Closed v4lue4dded closed 2 months ago

v4lue4dded commented 6 months ago

This project looks amazing as a backend for interactive visualizations, but I can't seem to fingure out how to get a sum of a variable in a loaded table.

Say for example the sum over the Distance and the Delay variables in the Airline on-time performance dataset to get the total distance flown or total delay experienced for each date. https://dig.cmu.edu/falcon-vis/crossfilter-duckdb/

In crossfilter this was done using the reduce function and passing it reduceAdd, reduceRemove, and reduceInital sub functions.

How is it implemented here? Can you maybe add an example to the readme?

xnought commented 2 months ago

We just count the number of rows within the filter, not operations on those data (like sum or other). Check out https://github.com/uwdata/mosaic and you'll find all those features.