# Additional aggregation functions

**URL:** <https://community.plotly.com/t/additional-aggregation-functions/11274>\
**Category:** plotly.js\
**Created:** [June 27, 2018, 8:03pm UTC](https://community.plotly.com/t/additional-aggregation-functions/11274 "2018-06-27T20:03:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhogan](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bhogan](https://community.plotly.com/u/bhogan)\
**Post date:** [June 27, 2018, 8:03pm UTC](https://community.plotly.com/t/additional-aggregation-functions/11274/1 "2018-06-27T20:03:03Z")

</div>

It looks like there is a pretty fixed list of available aggregation functions.

> <https://github.com/plotly/plotly.js/blob/master/src/transforms/aggregate.js#L71>

Is it possible to pass in a custom function for aggregation? If not, would you consider adding a couple of additional functions?

I believe that functions for range (i.e. max - min) and change (i.e. last - first) could be very useful for a variety of applications and would build off of functions that you already provide.

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [June 27, 2018, 9:17pm UTC](https://community.plotly.com/t/additional-aggregation-functions/11274/2 "2018-06-27T21:17:49Z")

</div>

> [@bhogan](#):
>
> Is it possible to pass in a custom function for aggregation?

No. Plotly’s API is strictly JSON, no functions are accepted.

> [@bhogan](#):
>
> If not, would you consider adding a couple of additional functions?

Yes.

---

<div class="post-metadata">

**Author:** ![bhogan](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bhogan](https://community.plotly.com/u/bhogan)\
**Post date:** [June 28, 2018, 2:15pm UTC](https://community.plotly.com/t/additional-aggregation-functions/11274/3 "2018-06-28T14:15:19Z")

</div>

Great, thank you! I will try to put together a PR for additional functions.

---

<div class="post-metadata">

**Author:** ![bhogan](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bhogan](https://community.plotly.com/u/bhogan)\
**Post date:** [June 28, 2018, 2:54pm UTC](https://community.plotly.com/t/additional-aggregation-functions/11274/4 "2018-06-28T14:54:49Z")

</div>

Here’s a github issue for further coordination: [https://github.com/plotly/plotly.js/issues/2763](https://github.com/plotly/plotly.js/issues/2763)

Thanks in advance for your consideration.
