Repository navigation
Add ability to write out the interactive HTML table with javascript to disk - #2875
Conversation
|
I'm working on this to see how easy it is to do |
|
Ok so the code here implements with minimal changes: To-dos:
Want to take over @keflavich? :) |
|
I guess that's okay. I mean, to me it seems something easy enough for the web browser to just do, but I could also imagine this being useful to write this format out without having to invoke a browser. |
|
@embray - this could be handy if e.g. running on a Django instance and generating a table on-the-fly |
|
Just needs a "new features" changelog entry 👍 |
…ed as soon as it is no longer referenced. Instead create a temporary directory and place a file inside.
|
This is now ready for review and testing. @taldcroft @AmrAS1 - this implements a few changes to the @keflavich @embray @mdboom - the jsviewer now defaults to using remote versions of the js and css files since that is likely to be the desired behavior when writing out using the @keflavich - how is the notebook version meant to be used? Also, since you wrote the original version of this, can you review this PR? To try this out, load up a table then do: then open the |
|
Note to self: add tests! |
|
|
|
@AmrAS1 @taldcroft - one thing I was curious about, is why the HTML writer takes a dictionary of options rather than taking the options directly. Is there a reason for this design choice? |
|
@astrofrog - When I wrote the HTML class I figured I would replicate the behavior of the LaTeX writer (which accepts a parameter |
|
Looks good as far as I can tell. My memory about the jsviewer is a bit spotty, though, so I can't promise that my review did any good. Still, it's a great idea and I'm sure I'll test it - I think this will be a great way to share some astroquery results with colleagues, and maybe a sensible way to locally save my most commonly performed ones. |
|
@AmrAS1 - Ah I see - I had assumed that any parameters passed to |
|
Actually extra parameters passed to |
|
@taldcroft - ok, no problem. Do you want to review this PR? If Travis passes then it can be merged. |
|
Seems like there should be at least one unit test for the new HTML writer capability testing the three new |
There was a problem hiding this comment.
... to include when writing table (and same for the next two).
|
Apart from my comments this looks good. The HTML/js table output from |
|
@taldcroft - the look of the table can be completely controlled by the CSS file, so it's just a matter of swapping the CSS file URL which can be done by a configuration item. If we find a style we like better, such as the one you pointed out, we can always host the CSS file ourselves if it doesn't already exist somewhere reliable. |
|
I'd rather leave that kind of improvement to a CSS wizard ;) For now, this uses a similar style to |
|
OK. I was more referring to all the "cruft" in the upper and lower grey bars (Show 50 rows, search, etc) which is irrelevant for small-ish tables. I just want the option of an unadorned sortable table. |
|
@taldcroft - I agree, we can make these things controllable by options. I'd rather leave that for a separate pull request, but I agree they should be done! :) |
|
I will merge this later this evening if there are no objections, and will then open an issue to remind us to try and improve the CSS for the table view (could be done as a starter project) |
There was a problem hiding this comment.
@mdboom - is there a procedure for changing the default values for configuration items in the new system? Or is just this ok? Users that haven't customized the value should get the new default value, right?
There was a problem hiding this comment.
Exactly. I think this is fine.
Add ability to write out the interactive HTML table with javascript to disk
To go along with
t.show_in_browser, it would be cool to be able to do:which would write out the HTML pages with the javascript files by the side, all ready to upload to a web server.
cc @keflavich