knitr::opts_chunk$set(echo = TRUE)
All assets currently available.
library(echarts4r) library(echarts4r.assets)
For demonstration purposes let's create a basic, non working plot to which we'll add assets.
base <- e_charts() %>% # initialise e_rm_axis("x") %>% # remove axis e_rm_axis("y")
These are not all the textures included
base %>% e_globe( environment = ea_asset("starfield"), base.texture = ea_asset("world night") )
base %>% e_globe( environment = ea_asset("galaxy"), base.texture = ea_asset("jupiter") )
base %>% e_globe( environment = ea_asset("starfield"), base.texture = ea_asset("world topo"), height.texture = ea_asset("elevation 4k") )
base %>% e_globe( environment = ea_asset("starfield"), base.texture = ea_asset("world topo"), height.texture = ea_asset("elevation 4k"), displacementScale = 0.4 )
base %>% e_globe( environment = ea_asset("starfield"), base.texture = ea_asset("world"), layers = list( list( type = "overlay", shading = "lambert", texture = ea_asset("clouds_trans"), distance = 5 ) ) )
base %>% e_globe( displacementScale = 0.1, baseColor = "#000", shading = "hatching", height.texture = ea_asset("elevation 4k"), hatchingMaterial = list( hatchingTextures = list( ea_asset("hatch0"), ea_asset("hatch1"), ea_asset("hatch2"), ea_asset("hatch3"), ea_asset("hatch4"), ea_asset("hatch5") ), textureTiling = list(10, 10) ), postEffect = list( enable = TRUE, edge = list( enable = TRUE ) ) )
You can use your own assets too of course. In shiny simply place them in your www
directory and reference the file name as texture, see the shiny section for more information. In R markdown you can simply use ea_convert
to convert your texture.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.