Description Usage Arguments Details Functions Note Examples
Assets for the echarts4r package.
1 2 3 4 5 6 7 |
asset |
Name of texture, see details below. |
convert |
Converts image to JSON formatted arrays. |
file |
Path to file. |
dir |
Directory to copy asset to. |
Due to browser
"same origin policy" security restrictions, loading textures
from a file system may lead to a security exception,
see
https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally.
References to file locations work in Shiny apps, but not in stand-alone
examples. The *texture
functions facilitates transfer of image
texture data from R into textures when convert
is set to TRUE
.
Valid run ea_bank
asset
.
ea_asset
include asset.
ea_convert
convert file to JSON formatted array.
ea_copy
moves an asset to the folder of your choice. This is useful as convert = TRUE
argment is computationally expensive, for instance, in Shiny, move the asset to your www folder for better perfromances.
ea_source
source your copied asset.
See ea_bank
for valid assets.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
library(shiny)
library(echarts4r)
# copy asset to www folder
ea_copy("world")
ui <- fluidPage(
echarts4rOutput("globe")
)
server <- function(input, output){
output$globe <- renderEcharts4r({
e_charts() %>%
e_globe(
environment = ea_source("earth"),
base_texture = e_globe_texture()
)
})
}
shinyApp(ui, server)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.