Uh oh!
There was an error while loading. Please reload this page.
API redesign - #217
Conversation
…wards incompatibility
cpsievert
commented
May 7, 2015
mkcor
commented
May 8, 2015
I must say that development has been strongly guided and influenced by the Python library... For instance, |
cpsievert
commented
May 8, 2015
I'd be disappointed if this PR falls on deaf ears because it doesn't mimic the Python implementation...it's considerably simpler for both users and developers. Why was the Just FYI, it looks like the os module can handle environment variables as well -- http://nbviewer.ipython.org/github/lightning-viz/lightning-example-notebooks/blob/master/images/images.ipynb |
theengineear
commented
May 8, 2015
@cpsievert , the As for environment variables. That seems like a totally reasonable approach. If we do it for one library, the others should all support it though as the idea is transparent cross-collaboration between languages. |
theengineear
commented
May 8, 2015
Could you split out the credentials stuff into a different PR so the rest doesn't get held up? |
cpsievert
commented
May 8, 2015
At least for the R package, it'd be easy to not relay the API message to avoid that issue. I like the library(plotly)
signup("me", "me@gmail.com")
q<- qplot(1:10)
plotly(q)
That might be awkward, but I'll think about it. Considering the integration with plotly-test-table, it will go much more smoothly if we do everything at once. Give me a couple days and I'll have a new build process for the test table which will be self-contained (within this package), more efficient, and easier to maintain. |
cpsievert
commented
May 8, 2015
I can certainly see the benefit of sharing credentials between languages. If you'd like to keep the current approach of writing credentials to disk like this, just let me know, and I can add some support for reading/writing to those files (and fall back on environment variables if we don't have file permissions). |
…gets sourced during R CMD check
bpostlethwaite
commented
May 13, 2015
We are in the process of rolling out v2 of our API https://api.plot.ly/v2/ (60% complete, 100% complete in early June) and I would suggest any rewrite utilize them as existing calls will begin to return deprecation warnings. Things like exposing Let me know if there is anything we can do to help introduce these new APIs. We will begin to roll them across all of our Libraries in June. |
cpsievert
commented
May 13, 2015
That's great to know, and I plan on waiting for v2 before merging this, thanks @bpostlethwaite! The biggest thing for me is having the equivalent of the "clientresp" resource in the old API. It looks as though that will go under here https://api.plot.ly/v2/plots, but it's not quite ready yet? |
bpostlethwaite
commented
May 13, 2015
@cpsievert yes, that is correct. @theengineear and @BRONSOLO are rolling it out and can let you know, and take questions, once it is complete. |
I couldn’t help myself and took a stab at the redesign discussed in #40.
Some of the big changes include:
list$function()interface. The new interface should be more intuitive to R users and resolves documentation issues (see Define parameters forplotly()#206). See the example section inhelp(plotly)for an overview of the new interface.plotly()(and they will be automatically stored as environment variables). Also, thesignup()function will (by default) try to store these variables in~/.Rprofileso they will be loaded upon startup.knitr::knit_print()S3 generic to automatically embed plotly iframes in R Markdown files. Seetest-plotly-knitr.Rfor a simple example.embed_notebook()to embed plotly frames in IPython (I haven't tested this yet, it'd be great if others could test this functionality).Since this is such a drastic change to API, merging this would require bumping to 1.0.0. I’d be happy to work on shiny bindings as well (I’ve done this for several other R packages), but that might be appropriate for another pull request.