flywire_shortenurl | R Documentation |
flywire_shortenurl
makes short URLs from long URLs or
ngscene
objects that you may have constructed in R.
flywire_expandurl
expands shortened URLs into a full
neuroglancer JSON scene specification. If the link references a specific
version of neuroglancer on a specific host URL then that will be used as
the base of the expanded URL. This is nearly always the case, but should
this ever not be so, then if the active segmentation
(choose_segmentation
) is a flywire segmentation then that is
used to define the initial part of the output URL. Failing this, the
flywire31
segmentation is used.
flywire_expandurl
will also expand tinyurl.com URLs as well as those
referencing a json fragment on a google cloud bucket (such as the flyem
link shortener). If a tinyurl.com URL maps to a short URL referencing a
json fragment, then they will successively be expanded unless
follow=FALSE
.
Finally, if the URL is actually already expanded, then this will be returned unmodified. This is a change in behaviour as of May 2024 (previously an error was thrown).
flywire_shortenurl(x, include_base = TRUE, baseurl = NULL, cache = TRUE, ...)
flywire_expandurl(x, json.only = FALSE, cache = TRUE, follow = TRUE, ...)
x |
One or more neuroglancer URLs or (for flywire_expandurl)
|
include_base |
Whether to return a full URL that will open a neuroglancer session (the default) or only the component that defines the scene (which would display JSON in your browser). |
baseurl |
Optional URL defining the neuroglancer browser to use with shortened URLs. |
cache |
Whether to cache any calls to the flywire state server
shortening or expanding URLs. Default is |
... |
Additional arguments passed to |
json.only |
Only return the JSON fragment rather than the neuroglancer
URL. Defaults to |
follow |
Whether to follow short URLs that specify other short URLs (see
details). Defaults to |
A character vector containing one or more URLs.
## Not run:
sc=ngl_blank_scene()
short=flywire_shortenurl(sc)
long=flywire_expandurl(short)
## End(Not run)
flywire_expandurl("https://globalv1.flywire-daf.com/nglstate/5747205470158848")
flywire_expandurl("https://tinyurl.com/rmr58jpn")
## Not run:
flywire_expandurl("https://tinyurl.com/flywirehb2")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.