Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for static HTML export #282

Closed
jlstevens opened this issue Oct 8, 2015 · 6 comments
Closed

API for static HTML export #282

jlstevens opened this issue Oct 8, 2015 · 6 comments
Assignees
Labels
tag: API type: feature A major new feature
Milestone

Comments

@jlstevens
Copy link
Contributor

Philipp's has recently pulled out some more functionality out of the ipython subpackage involved in HTML generation. As this functionality is useful and something we want to support in general (so HoloViews is not necessarily tied to IPython/Jupyter) we should consider implementing a useful API for our users. Here is what I suggest:

from holoviews.plotting import Renderer
data =  Renderer.static_html(obj)  # Dictionary  e.g data['css'], data['js']
html =  Renderer.static_html(obj, html_only=True)  # Standalone HTML

One other suggestion is a template argument which defaults to 'default' (or 'basic'?) which defines the overall HTML skeleton. This would allow you to specify a custom template as a formatter with the appropriate fields (i.e 'css' and 'js' in the current example).

Lastly, I might consider splitting the HTML up a little bit more. Perhaps a 'header' field could correspond to the HTML header used to load the appropriate JavaScript libraries?

Fix: I forgot to add the obj argument to define what you want to export!

@jlstevens jlstevens added type: feature A major new feature tag: API labels Oct 8, 2015
@jlstevens jlstevens added this to the v1.4.0 milestone Oct 8, 2015
@philippjfr
Copy link
Member

For reference here is an example of the current API for exporting a standalone HTML file.

@jlstevens
Copy link
Contributor Author

Note that above the methods are on Renderer (i.e the class) but this should also work for renderer instances. In other words, this will have to be implemented as a @bothmethod

@cryptofan
Copy link

hi! I am on the user end, and I would like just to ask if this API is still under construction. I tried to run the commands given in the first post of this thread, and I got an error
'type object 'Renderer' has no attribute 'static_html''

@philippjfr
Copy link
Member

Yes, this has not been implemented yet. Hopefully we'll get around to it soon.

@philippjfr philippjfr mentioned this issue Nov 10, 2015
42 tasks
@philippjfr philippjfr self-assigned this Nov 23, 2015
@philippjfr
Copy link
Member

This has been implemented as part of #311, closing.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: API type: feature A major new feature
Projects
None yet
Development

No branches or pull requests

3 participants