textures: Assets

Description Usage Arguments Details Functions Note Examples

Description

Assets for the echarts4r package.

Usage

1
2
3
4
5
6
7
ea_asset(asset, convert = TRUE)

ea_convert(file)

ea_copy(asset, dir = "www")

ea_source(asset, dir = "www")

Arguments

asset

Name of texture, see details below.

convert

Converts image to JSON formatted arrays.

file

Path to file.

dir

Directory to copy asset to.

Details

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.

Functions

Note

See ea_bank for valid assets.

Examples

 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)

JohnCoene/echarts4r.assets documentation built on Aug. 30, 2019, 11:40 a.m.