Closed robmarkcole closed 6 years ago
wrt the pivot tables, pandas is the package underpinning the table variable.
Pandas already has the following: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.pivot_table.html
Maybe it's worth creating an example that has a few drop downs to achieve an interactive pivot table.
When a pandas variable changes the table redraws to agree.
pivottablejs is very interactive, you can drag the pivots around, and do a wide range of plots. I definitely recommend taking a couple of minutes to try it out. I will experiment and post my results
Actually, once again, I'll just leave that as it will be implemented within jupyterlab. The pandas variables will be able to be used as an interactive pivot table within jupyterlab soon I'm sure.
If ever one of your ideas has a solution where someone has made a notebook extension I'll leave that idea because it will likely be solved by default once I make scriptedforms into a jupyterlab extension.
Also, specifically, my preference for ideas are those that you will be specifically using. The highest priority ideas will come by trying to take your needs at work and turn them into forms and finding out there is functionality missing on being able to create what you want.
OK sure, theres bound to be an explosion of extensions.
This suggestion came about as I've been asked to deal with a bunch of monstrous excel files and do pivots, and I'm sure scriptedforms can be a much nicer solution
Also, there's no harm in making each idea into an issue. That way each idea can be discussed individually.
Ahah :) thanks.
What would it look like?
This lets you upload your CSV files to do it within the browser:
https://react-pivottable.js.org
Seeing that makes me think for that use case a standalone jupyterlab extension would be perfect.
Yes your'e right, no need to reimplement in scriptedforms.
Will create separate issues for other ideas
...here's an idea... And if it works then maybe the pivot table will be more plausible:
Swap out the table element for the above...
@SimonBiggs I feel like pivot tables are a special case of table - typically I need to view them but not manipulate the data content. https://github.com/nicolaskruchten/jupyter_pivottablejs makes manipulation very easy, otherwise I have to manually add all the drop down menus etc around a standard table. Can we reopen this issue until we have a solution we are completely satisfied with?
Sure, how about we work out a way where you can include your own javascript? So instead of me including pivottablesjs, how about I just make a way for you to import that package in yourself?
Sounds good. I've virtually no javascript experience but could be a good excuse to learn
@robmarkcole try the most recent development code submitted to master. There is a file in the example module called testing-pivot-table.md
take that for a spin and let me know how you go.
@robmarkcole so, I worked around what the notebook pivot tables extension was expecting and I managed to include it in. But it is exceptionally brittle, because I have to mimic the state of the notebook javascript environment and file server handling. ... It worked, but it got in the way of what I am trying to do at the moment (get jupyterhub and mybinder to work). So I have now got rid of it again.
However! :) It shouldn't be too difficult to turn the pivottablejs into a JupyterLab extension. If you can turn it into a jupyterlab extension I can pull it in through the official channels.
A jupyterlab extension tutorial is provided at:
https://jupyterlab.readthedocs.io/en/stable/developer/xkcd_extension_tutorial.html
@SimonBiggs thanks for your efforts on this. I will look at creating the JupyterLab extension. Indeed I'm hopefully attending a Hackathon @manahl in a couple of weeks and this would be a perfect task for the event
Ahh awesome :)
@SimonBiggs are nbextensions also supported? Just learning about these but this is useful http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/varInspector/README.html
No, they aren't unfortunately. Nbextensions are the old extension method. Need to use JupyterLab extension methods...
Hi @robmarkcole,
I'm going to close this issue. I'll let you work on a JupyterLab extension for a pivottable in another repo. Once the extension is made we can open a new issue then I think.
Thought I would create an issue to track ideas.
1 See if theres anything useful to learn from https://github.com/tryexceptpass/sofi
2 I see woking with csv/tables in the browser to be a big draw to scriptedforms. Pivot tables being the common operation perhaps the following is worth a look https://github.com/nicolaskruchten/jupyter_pivottablejs and video on http://nicolas.kruchten.com/content/2015/09/jupyter_pivottablejs/