Thanks for sharing it, itās much clearer now! Unfortunately, the underlying react library (react-pivottable) does not support multiple average-aggregator, so I donāt think itās possible to do this without modifying how pivottable.js works behind the scene.
One hypothetical way to approach this with Dash would be to generate two pandas dataframe that would take the format youād like (each with a different āTotalsā column, but same index), and merge them. Then, render the result with something like DataTable. This approach will likely not be able to directly incorporate dash-pivottable though.
Hi @xhlu - thanks for the feedback. I hadnāt thought about this as an option as I preferred to keep everything in the dynamic pivot table object. Once I export data away from that into a āstandardā Dash Table I will lose the pivot-table elements (e.g. swapping columns about) and equally, I doubt I will be able to ānestā a Dash Table within the pivot table correctly (if that is even possible). Ideally these on-the-fly subtotal calcs and expandable sub-lists would be a feature of the pivottable library itself (e.g. the way the average/grand totals can be calculated from your input data, without first running those calcs yourself). Something for me to learn and attempt when I have time! Thanks again for the release!
This makes sense, thanks for explaining this @papalazorous! Since this is related to how react-pivottable renders the tables, we would have to add a renderer option upstream before being able to make a new release of dash-pivottable. I think a good first step would be to raise an issue in the react-pivottable repo, and perhaps take a look at the source code if you are comfortable with JS/React. Feel free to tag me and @nicolaskruchten if needed!
Hi Xhlu, Very nice tool. I am struggling to integrate Dash-Pivottable in a Django Web App. As you know, it is possible to integrate a Dash app in a Django Website with the library DjangoDash. But when I try to integrate Dash-Pivotable (dash.Dash instead), it doesnt work. Please any idea? thanks
@xhlu, is there a way to prevent certain data cuts from being graphed? For instance, if a pivot cut results in a sample size less than N, can there be a way to avoid graphing?
Dash Pivottable doesnāt use any Flask-specific features, so Iām not totally sure what the problem is. Have you tried other component libraries (like dash bootstrap components) with Django Dash? It would be great to have a reproduceable demo (either a gist or formatted with ```) with the simplest possible django app and a simple dash-pivottable, so the problem can be easily isolated and help other users in the future!
To avoid graphing, you would likely need to write a callback that only renders the pivottable when a certain condition is met. Alternatively, if you are comfortable with JavaScript, you could
clone the repo and modify the source code to implement custom rendering logic based on specific needs
use client-side callback to stop the graph from being rendered on the JS side when your sample size is smaller than N
Thanks for the reply. I didnāt invest much time into it yet, but from the look of it, it didnāt seem like there were any callbacks that could stop a render, rather the component looked like it just worked once it was defined. The only callbacks I saw in the usage.py was to show some debugging information.
You might be able to update the rendererName prop based on the input data, but I canāt guarantee whether it would work well since I havenāt ran into a use case that required me to control the rendering based on a specific UI configuration.
Iām currently having issues with the parameter valueFilter, any attribute and attribute-values (True/False) deselects them from the filter on load. Would be great if there is a way to fix this issue such that I can only select the desired filtered values of the attribute.
e.g.
valueFilter={āStatusā: {āCompletedā: True}} <- deselects the value of āCompletedā
I like this pivot table element. Thanks for taking the time to develop and share. Is it possible to change the color scheme or other styling options? Also, when I run this, I get some text printed at the bottom of the table, and I see the same text in some of the example videos. Is it possible to have this output hidden? Thanks!
I have been able to style the elements of the pivot table quite successfully, but what about changing colors of the heatmaps or the default plotly graphs? Thanks again
To modify the plotly graphs you will likely have to change the underlying Plot, so you might have to dive into the dash-pivottable source code and build your own version; the instructions are in the README.md file inside the repo.
I have made the desired changes to the stylesheet and have saved it in the assets folder. When I go to run the app, only part of my changes show up. When I inspect with the dev tools, there appears to be multiple style elements loading, some from the new css file and some from text/css. I can make a simple change to the pivottable.css (like change a comment) and then all of the other elements get passed down to the app. Any thoughts on this? Can I prevent a default css from being loaded? Thanks
The pivottable.css thatās imported in the source code src/lib/components/PivotTable.react.js is the distributed css file from react-pivottable. Once you download it and modify it, you can change the import in the source code to point to that new file, then run npm run build.
Hi -awesome component thanks !
I tried to get a list of properties I can access via Dash Input but was not sure I found the right one
Are there any which allow to send back information on which cell (or chart point( is selected, or clicked on, or hovered on ?
another question : valueFilter seems to return only the initial filter(s), and does not update (via callbanks) even when the table filters are changed - is that normal ?