@fonsp This is meant to be more fun than anything serious - I came up with a nice little hack for creating interactive data tables in my Pluto notebooks
After wrangling a .csv file into a Dict with a very specific structure, I can convert it to JSON and pass it to a function that will return all of the HTML/JavaScript necessary to load the data table:
The ability to render a Vue app inside of an output cell is pretty cool and opens the door to lots of interesting possibilities. In this case, I am leveraging the Vuetify plugin for the data table and Vuetify expects a JSON object of the following form:
I might write a simple function that can wrangle any .csv with a header row into this format so that I can use this in a more general way in my Pluto notebooks I have a decent amount of experience with Vue (although I’m a bit rusty at the moment) so I can see myself leveraging it when I really want a wow factor in my Pluto notebooks.
Great idea!
It woud be good to support the Tables.jl interface for input. Then it would not only work for CSVs, but also for DataFrames, SQL Query results, etc.
I am recently thinking about wrapping Sigma.js library http://sigmajs.org/ and this might make it very easy to do (to some extent).
Any suggestions, how to include sigma.js script are welcomed, as I am a total newbie in this area, but I really want interactive tool to visualize graphs.
You should try and get TableView to work. The lazy loading is essential for performance and non-trivial to implement. Without it things get very slow with many rows of data (10k+)
Hi @mthelm85 I’m using your function, which is great btw, for composing a little report in Pluto where I need to print like 31 values, this kind of notebooks are really amazing when you export them as pdf, I would like to present the full table, 31 rows, to be able to export the notebook as pdf whit the full information, Do you think that you Table could present the 31 rows? Thanks btw.
Unfortunately, in order to display all 31 rows you would have to modify the Vuetify.js source code (I doubt it’s worth the effort). Instead, I think what I would do in your case is export your notebook as an .html file and then you should be able to just add to the HTML table that is generated. If you do a Google search for “html table generator” there are even sites that offer simple GUIs for creating your HTML table. You should then be able to plug this into the HTML document and then convert to a PDF, although I’ve never done such a thing myself.
This hack is genius and it gets me thinking – is there any way to build our own more complex javascript/Vue visualizations in a local file (say in the same repository as our notebook) and import them into pluto?