Skip to content

Add offline plotting that doesn't depend on Ipython/Jupyter #353

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

Closed
nzjrs opened this issue Nov 18, 2015 · 10 comments
Closed

Add offline plotting that doesn't depend on Ipython/Jupyter #353

nzjrs opened this issue Nov 18, 2015 · 10 comments

Comments

@nzjrs
Copy link

nzjrs commented Nov 18, 2015

It would be good to have two extra plotly.offline API entry points that return the rendered html for a given plot, and a second that rendered a given plot in a standalone local server.

def plot_html(figure_or_data)
    pass

class PlotServer(object):
    #starts a simple python http server to serve the plotly js / html
    def plot(figure_or_data, return_url=False, open_url=True):
        pass
@SnowRipple
Copy link

Silly question:

How can I view the plot (object IPython.core.display.HTML ) without using ipython notebook?

Because when I run a script all I get in the console is:

IPython.core.display.HTML at 0x7f86b38e2a50
IPython.core.display.HTML at 0x7f86b38e2a50
IPython.core.display.HTML at 0x7f86b38e2a50

@nzjrs
Copy link
Author

nzjrs commented Nov 18, 2015

Ummmm, that's why I filed this issue.

@SnowRipple
Copy link

A ok.. I misundersood, thanks! Btw is it possible to sent my output to already running notebook from different terminal?

@chriddyp
Copy link
Member

Great suggestion @nzjrs . I've reserved offline.plot for this functionality, to mimic the py.iplot/py.plot duality.

I think that I'd like to keep this server-less, and just embed all of the JS inside HTML page. That way, it's easier to share stand-alone HTML files (inside of a zipped collection)

@nzjrs
Copy link
Author

nzjrs commented Nov 19, 2015

Sounds good - although I would prefer that function to have an argument that controls the embedding behaviour to be either

  • standalone+embedded javascript
  • standalone+CDN javascript,
  • just the plot javascript+html fragment

@chriddyp
Copy link
Member

@nzjrs yeah, that's a great idea. That way, folks can control the size of the bundles that they are sharing.

By default, I think it should be standalone so there are no surprises when they try to open their documents in the absence of an internet connection.

@jackgolding
Copy link

I agree with nzjr with the question I asked here #358 (comment), would be really useful for us.

@pollackscience
Copy link

Hi @chriddyp , plot.ly has been a great tool for displaying interactive 3d data for me, thanks to you and your team! I also would like to chime in and request a standalone offline feature that does not depend on ipython, it would be extremely helpful. I am currently using a hack i grabbed from @pm8k here:
https://github.com/pm8k/get_plotly_html/blob/master/Utilizing%20Plotly%20Offline.ipynb

@nzjrs
Copy link
Author

nzjrs commented Dec 17, 2015

The changes are trivial and I will get to making them over Christmas.

However anyone is free to pick up the branch and finish it off. It's really only one hour work, maximum.

@chriddyp
Copy link
Member

Here's a PR: #378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants