-
Notifications
You must be signed in to change notification settings - Fork 633
API redesign #217
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 redesign #217
Conversation
…wards incompatibility
I must say that development has been strongly guided and influenced by the Python library... For instance, |
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 |
@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. |
Could you split out the credentials stuff into a different PR so the rest doesn't get held up? |
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", "[email protected]")
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. |
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
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. |
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? |
@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~/.Rprofile
so they will be loaded upon startup.knitr::knit_print()
S3 generic to automatically embed plotly iframes in R Markdown files. Seetest-plotly-knitr.R
for 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.