Skip to content

orca always requires mapbox token #1314

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
hschult opened this issue Aug 1, 2018 · 10 comments
Closed

orca always requires mapbox token #1314

hschult opened this issue Aug 1, 2018 · 10 comments

Comments

@hschult
Copy link

hschult commented Aug 1, 2018

Like the title says the problem is that the orca() function always throws an error that a mapbox token has to be assigned even if the given plot does not depend on mapbox.

I don't think a reprex is really needed but anyway:

Sys.unsetenv("MAPBOX_TOKEN")

p <- plot_ly(z = ~volcano) %>% add_surface()
orca(p, "surface-plot.svg")
@fcasarramona
Copy link

With R 3.5.1, Plotly 4.8.0 and Orca 1.1.1 it already happens:

> pl <- plot_ly()
> pl <- add_trace(pl, y = c(1,2,3), type = "scatter", mode = "lines")
> orca(pl, "Void.png")
Error: No mapbox access token found. Obtain a token here
https://www.mapbox.com/help/create-api-access-token/
Once you have a token, assign it to an environment variable 
named 'MAPBOX_TOKEN', for example,
Sys.setenv('MAPBOX_TOKEN' = 'secret token')

@cpsievert
Copy link
Collaborator

This change isn't yet on CRAN

@bgroebe
Copy link

bgroebe commented Dec 3, 2018

I'm having a similar issue with the orca function. Also in R 3.51 and Plotly 4.8.0, but if I set MAPBOX_TOKEN to some nominal value then the orca function just hangs (even for a simple line plot of with x=1:10, y=1:10). The depreciated export() function gives me an unusual bug. My data is lognormal, and when rendering points from a lognormal distribution the resulting image is missing all of the points below a certain threshold.

p <- plot_ly() %>% add_lines(x=1:30, y=rlnorm(30)); export(p, '~/test.png')

@cpsievert
Copy link
Collaborator

Have you tried installing from Github? devtools::install_github('ropensci/plotly')

@bgroebe
Copy link

bgroebe commented Dec 3, 2018

I get an error message:
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
[tcl] grab failed: window not viewable.

@cpsievert
Copy link
Collaborator

Can you run this from the command line?

$ orca graph '{ "data": [{"y": [1,2,1]}] }' -o fig.png

@bgroebe
Copy link

bgroebe commented Dec 3, 2018

Fails with the below output. I primarily use Python 2.7, could that be part of the issue?

Edit: the bolded 'init' below should just have the double underscores wrapping it, not sure how to escape the bold face.

/usr/lib/python3/dist-packages/pyatspi/init.py:17: PyGIWarning: Atspi was imported without specifying a version first. Use gi.require_version('Atspi', '2.0') before import to ensure that the right version gets loaded.
from gi.repository import Atspi
The following are not valid: graph { "data": [{"y": [1,2,1]}] } -o fig.png
/usr/lib/python3/dist-packages/pyatspi/Accessibility.py:41: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
len=self.get_child_count()

@cpsievert
Copy link
Collaborator

I primarily use Python 2.7, could that be part of the issue?

I'm not sure, this would be a better venue to get help debugging your setup -- https://github.com/plotly/orca/issues

Make sure you can run the 'hello world' examples before using orca() in R. -- https://github.com/plotly/orca#quick-start

@ha5dzs
Copy link

ha5dzs commented Apr 13, 2019

I have the same issue here. I have submitted an issue for Orca, but got redirected here, apparently it's an R API problem.
Using Mac (Mojave 10.14.4), RStudio (1.2.1335), Plotly (4.8.0).

Everything works fine if the environment variable exists, the token doesn't have to be valid at all.

@cpsievert
Copy link
Collaborator

Plotly 4.9.0 doesn't have this problem. Install with install.packages("plotly")

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