Pivot Table Demo

Here’s a demo of an interactive pivot table in an Anvil app:

https://WFRNIGNPKB7G6IMG.anvil.app/XMUXHCYB22XZX6OQ65X7RL5J

You can clone the app using:
https://anvil.works/build#clone:WFRNIGNPKB7G6IMG=QYOAWQL74ZTKPOLVISUJWFGM

And here’s a screenshot of how it looks:

It uses the PivotTable.js library with the example dataset from that library’s documentation held within Anvil’s Data Tables service (2012 Canadian Members of Parliament).

When run, it will throw a deprecation warning message in the output window. This is a jQuery warning and it happens anywhere this library is used. It’s not caused by the Anvil integration.

Further work:

  • The library includes many more options than I have implemented here. I’ve only done the basics.
  • I had to include plotly.js in the demo app’s assets. I suspect that would cause problems if the app also uses Anvil’s plot component.
  • Mucking around with css to give it a ‘Material’ look and feel. (Yuck. Not my forte)!
8 Likes

Now available within Anvil Extras

2 Likes

I wish I knew what a pivot table was. I know I should know, and I’ve even nodded sagely when the subject comes up at meetings (ok ok, in the pub).

I should google it. Maybe I will. But right now, I don’t know.

I have writer’s block. Please ignore me.

4 Likes